< prev index next >

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Print this page
*** 38,10 ***
--- 38,11 ---
  #include "oops/methodData.hpp"
  #include "oops/method.hpp"
  #include "oops/oop.inline.hpp"
  #include "prims/jvmtiExport.hpp"
  #include "prims/jvmtiThreadState.hpp"
+ #include "runtime/continuation.hpp"
  #include "runtime/deoptimization.hpp"
  #include "runtime/frame.inline.hpp"
  #include "runtime/jniHandles.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "runtime/stubRoutines.hpp"

*** 363,12 ***
--- 364,20 ---
  
  address TemplateInterpreterGenerator::generate_safept_entry_for(
          TosState state,
          address runtime_entry) {
    address entry = __ pc();
+   
+   const Register rthread = NOT_LP64(rcx) LP64_ONLY(r15_thread);
+ 
    __ push(state);
+   NOT_LP64(__ get_thread(rthread);)
+   __ push_cont_fastpath(rthread);
    __ call_VM(noreg, runtime_entry);
+   NOT_LP64(__ get_thread(rthread);)
+   __ pop_cont_fastpath(rthread);
+ 
    __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
    return entry;
  }
  
  

*** 599,10 ***
--- 608,14 ---
    // store object
    __ movptr(Address(rsp, BasicObjectLock::obj_offset_in_bytes()), rax);
    const Register lockreg = NOT_LP64(rdx) LP64_ONLY(c_rarg1);
    __ movptr(lockreg, rsp); // object address
    __ lock_object(lockreg);
+ 
+   Register rthread = NOT_LP64(rax) LP64_ONLY(r15_thread);
+   NOT_LP64(__ get_thread(rthread);)
+   __ inc_held_monitor_count(rthread);
  }
  
  // Generate a fixed interpreter frame. This is identical setup for
  // interpreted methods and for native methods hence the shared code.
  //

*** 650,10 ***
--- 663,31 ---
    __ movptr(Address(rsp, 0), rsp); // set expression stack bottom
  }
  
  // End of helpers
  
+ address TemplateInterpreterGenerator::generate_Continuation_doYield_entry(void) {
+ #ifdef _LP64
+   address entry = __ pc();
+   assert(StubRoutines::cont_doYield() != NULL, "stub not yet generated");
+ 
+   // __ movl(c_rarg1, Address(rsp, wordSize)); // scopes
+   const Register thread1 = NOT_LP64(rdi) LP64_ONLY(r15_thread);
+   NOT_LP64(__ get_thread(thread1));
+   __ push_cont_fastpath(thread1);
+   
+   __ jump(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::cont_doYield())));
+   // return value is in rax
+ 
+   return entry;
+ #else
+   // Not implemented. Allow startup of legacy Java code that does not touch
+   // Continuation.doYield yet. Throw AbstractMethodError on access.
+   return generate_abstract_entry();
+ #endif
+ }
+ 
  // Method entry for java.lang.ref.Reference.get.
  address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
    // Code: _aload_0, _getfield, _areturn
    // parameter size = 1
    //

*** 1207,10 ***
--- 1241,12 ---
                     InterpreterRuntime::throw_illegal_monitor_state_exception));
        __ should_not_reach_here();
  
        __ bind(unlock);
        __ unlock_object(regmon);
+       NOT_LP64(__ get_thread(thread);)
+       __ dec_held_monitor_count(thread);
      }
      __ bind(L);
    }
  
    // jvmti support

*** 1275,11 ***
  address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
    // determine code generation flags
    bool inc_counter  = UseCompiler || CountCompiledCalls || LogTouchedMethods;
  
    // ebx: Method*
!   // rbcp: sender sp
    address entry_point = __ pc();
  
    const Address constMethod(rbx, Method::const_offset());
    const Address access_flags(rbx, Method::access_flags_offset());
    const Address size_of_parameters(rdx,
--- 1311,11 ---
  address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
    // determine code generation flags
    bool inc_counter  = UseCompiler || CountCompiledCalls || LogTouchedMethods;
  
    // ebx: Method*
!   // rbcp: sender sp (set in InterpreterMacroAssembler::prepare_to_jump_from_interpreted / generate_call_stub)
    address entry_point = __ pc();
  
    const Address constMethod(rbx, Method::const_offset());
    const Address access_flags(rbx, Method::access_flags_offset());
    const Address size_of_parameters(rdx,
< prev index next >