< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page
rev 47596 : imported patch Interpreter-Poll-7
rev 47597 : imported patch Interpreter-Poll-Wide_Ret-8
rev 47598 : imported patch Interpreter-Poll-Switch-10
rev 47599 : imported patch Interpreter-Poll-Ret-11

@@ -2082,11 +2082,11 @@
     __ subptr(rax, Address(rcx, Method::const_offset()));
     // Adjust the bcp in r13 by the displacement in rdx
     __ addptr(rbcp, rdx);
     // jsr returns atos that is not an oop
     __ push_i(rax);
-    __ dispatch_only(vtos);
+    __ dispatch_only(vtos, true);
     return;
   }
 
   // Normal (non-jsr) branch handling
 

@@ -2201,11 +2201,11 @@
 
   // continue with the bytecode @ target
   // rax: return bci for jsr's, unused otherwise
   // rbx: target bytecode
   // r13: target bcp
-  __ dispatch_only(vtos);
+  __ dispatch_only(vtos, true);
 
   if (UseLoopCounter) {
     if (ProfileInterpreter) {
       // Out-of-line code to allocate method data oop.
       __ bind(profile_method);

@@ -2330,22 +2330,22 @@
   __ profile_ret(rbx, rcx);
   __ get_method(rax);
   __ movptr(rbcp, Address(rax, Method::const_offset()));
   __ lea(rbcp, Address(rbcp, rbx, Address::times_1,
                       ConstMethod::codes_offset()));
-  __ dispatch_next(vtos);
+  __ dispatch_next(vtos, 0, true);
 }
 
 void TemplateTable::wide_ret() {
   transition(vtos, vtos);
   locals_index_wide(rbx);
   __ movptr(rbx, aaddress(rbx)); // get return bci, compute return bcp
   __ profile_ret(rbx, rcx);
   __ get_method(rax);
   __ movptr(rbcp, Address(rax, Method::const_offset()));
   __ lea(rbcp, Address(rbcp, rbx, Address::times_1, ConstMethod::codes_offset()));
-  __ dispatch_next(vtos);
+  __ dispatch_next(vtos, 0, true);
 }
 
 void TemplateTable::tableswitch() {
   Label default_case, continue_execution;
   transition(itos, vtos);

@@ -2371,11 +2371,11 @@
   __ bind(continue_execution);
   __ bswapl(rdx);
   LP64_ONLY(__ movl2ptr(rdx, rdx));
   __ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1));
   __ addptr(rbcp, rdx);
-  __ dispatch_only(vtos);
+  __ dispatch_only(vtos, true);
   // handle default
   __ bind(default_case);
   __ profile_switch_default(rax);
   __ movl(rdx, Address(rbx, 0));
   __ jmp(continue_execution);

@@ -2419,11 +2419,11 @@
   __ bind(continue_execution);
   __ bswapl(rdx);
   __ movl2ptr(rdx, rdx);
   __ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1));
   __ addptr(rbcp, rdx);
-  __ dispatch_only(vtos);
+  __ dispatch_only(vtos, true);
 }
 
 void TemplateTable::fast_binaryswitch() {
   transition(itos, vtos);
   // Implementation using the following core algorithm:

@@ -2523,11 +2523,11 @@
   NOT_LP64(__ restore_bcp());
   NOT_LP64(__ restore_locals());                           // restore rdi
 
   __ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1));
   __ addptr(rbcp, j);
-  __ dispatch_only(vtos);
+  __ dispatch_only(vtos, true);
 
   // default case -> j = default offset
   __ bind(default_case);
   __ profile_switch_default(i);
   __ movl(j, Address(array, -2 * BytesPerInt));

@@ -2537,16 +2537,30 @@
   NOT_LP64(__ restore_bcp());
   NOT_LP64(__ restore_locals());
 
   __ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1));
   __ addptr(rbcp, j);
-  __ dispatch_only(vtos);
+  __ dispatch_only(vtos, true);
 }
 
 void TemplateTable::_return(TosState state) {
   transition(state, state);
 
+#ifdef _LP64
+  if (SafepointMechanism::uses_thread_local_poll()) {
+    Label no_safepoint;
+    NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
+    __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
+    __ jcc(Assembler::zero, no_safepoint);
+    __ push(state);
+    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
+                                    InterpreterRuntime::at_safepoint));
+    __ pop(state);
+    __ bind(no_safepoint);
+  }
+#endif
+
   assert(_desc->calls_vm(),
          "inconsistent calls_vm information"); // call in remove_activation
 
   if (_desc->bytecode() == Bytecodes::_return_register_finalizer) {
     assert(state == vtos, "only valid state");
< prev index next >