< prev index next >

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Print this page
@@ -36,10 +36,11 @@
  #include "oops/arrayOop.hpp"
  #include "oops/methodCounters.hpp"
  #include "oops/methodData.hpp"
  #include "oops/method.hpp"
  #include "oops/oop.inline.hpp"
+ #include "oops/inlineKlass.hpp"
  #include "oops/resolvedIndyEntry.hpp"
  #include "oops/resolvedMethodEntry.hpp"
  #include "prims/jvmtiExport.hpp"
  #include "prims/jvmtiThreadState.hpp"
  #include "runtime/continuation.hpp"

@@ -61,11 +62,11 @@
  // Size of interpreter code.  Increase if too small.  Interpreter will
  // fail with a guarantee ("not enough space for interpreter generation");
  // if too small.
  // Run with +PrintInterpreter to get the VM to print out the size.
  // Max size with JVMTI
- int TemplateInterpreter::InterpreterCodeSize = JVMCI_ONLY(268) NOT_JVMCI(256) * 1024;
+ int TemplateInterpreter::InterpreterCodeSize = JVMCI_ONLY(280) NOT_JVMCI(268) * 1024;
  
  // Global Register Names
  static const Register rbcp     = r13;
  static const Register rlocals  = r14;
  

@@ -174,15 +175,19 @@
  
  address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
    address entry = __ pc();
  
    // Restore stack bottom in case i2c adjusted stack
-   __ movptr(rcx, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
-   __ lea(rsp, Address(rbp, rcx, Address::times_ptr));
+   __ movptr(rscratch1, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
+   __ lea(rsp, Address(rbp, rscratch1, Address::times_ptr));
    // and null it as marker that esp is now tos until next java call
    __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
  
+   if (state == atos && InlineTypeReturnedAsFields) {
+     __ store_inline_type_fields_to_buf(nullptr);
+   }
+ 
    __ restore_bcp();
    __ restore_locals();
  
    if (state == atos) {
      Register mdp = rbx;

@@ -1227,11 +1232,11 @@
  }
  
  //
  // Generic interpreted method entry to (asm) interpreter
  //
- address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
+ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized, bool object_init) {
    // determine code generation flags
    bool inc_counter  = UseCompiler || CountCompiledCalls;
  
    // ebx: Method*
    // rbcp: sender sp (set in InterpreterMacroAssembler::prepare_to_jump_from_interpreted / generate_call_stub)

@@ -1348,10 +1353,16 @@
        __ bind(L);
      }
  #endif
    }
  
+   // If object_init == true, we should insert a StoreStore barrier here to
+   // prevent strict fields initial default values from being observable.
+   // However, x86 is a TSO platform, so if `this` escapes, strict fields
+   // initialized values are guaranteed to be the ones observed, so the
+   // barrier can be elided.
+ 
    // start execution
  #ifdef ASSERT
    {
      Label L;
       const Address monitor_block_top (rbp,
< prev index next >