< prev index next >

src/hotspot/cpu/x86/interp_masm_x86.cpp

Print this page

        

@@ -1121,42 +1121,40 @@
     bind(no_reserved_zone_enabling);
   }
 
   // Code below is taking care of recycling TLVB memory, no safepoint should
   // occur between this point and the end of the remove_activation() method
-  Label vtbuffer_slow, vtbuffer_done, no_buffered_value_returned;
   const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
   const uintptr_t chunk_mask = VTBufferChunk::chunk_mask();
+
+  Label TLVB_cleanup_done;
+  if (state == qtos) {
+    Label no_buffered_value_returned;
+    if (ReturnValuesInThreadLocalBuffer) {
   NOT_LP64(get_thread(thread1));
   cmpptr(Address(thread1, JavaThread::return_buffered_value_offset()), (intptr_t)NULL_WORD);
   jcc(Assembler::equal, no_buffered_value_returned);
   movptr(rbx, Address(rbp, frame::interpreter_frame_vt_alloc_ptr_offset * wordSize));
   call_VM_leaf(CAST_FROM_FN_PTR(address,
-                                  InterpreterRuntime::return_value_step2), rax, rbx);
+          InterpreterRuntime::relocate_return_value), rax, rbx);
   NOT_LP64(get_thread(thread1));
   get_vm_result(rax, thread1);
-  jmp(vtbuffer_done);
+      jmp(TLVB_cleanup_done); // clean up has been performed during relocation
   bind(no_buffered_value_returned);
+    }
+  }
   movptr(rbx, Address(rbp, frame::interpreter_frame_vt_alloc_ptr_offset * wordSize));
   NOT_LP64(get_thread(thread1));
   movptr(rcx, Address(thread1, JavaThread::vt_alloc_ptr_offset()));
   cmpptr(rbx, rcx);
-  jcc(Assembler::equal, vtbuffer_done);
-  andptr(rbx, chunk_mask);
-  andptr(rcx, chunk_mask);
-  cmpptr(rbx, rcx);
-  jcc(Assembler::notEqual, vtbuffer_slow);
-  movptr(rbx, Address(rbp, frame::interpreter_frame_vt_alloc_ptr_offset * wordSize));
-  movptr(Address(thread1, JavaThread::vt_alloc_ptr_offset()), rbx);
-  jmp(vtbuffer_done);
-  bind(vtbuffer_slow);
+  jcc(Assembler::equal, TLVB_cleanup_done);
   push(state);
   movptr(rbx, Address(rbp, frame::interpreter_frame_vt_alloc_ptr_offset * wordSize));
   call_VM_leaf(CAST_FROM_FN_PTR(address,
                                   InterpreterRuntime::recycle_vtbuffer), rbx);
   pop(state);
-  bind(vtbuffer_done);
+  bind(TLVB_cleanup_done);
 
   // remove activation
   // get sender sp
   movptr(rbx,
          Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
< prev index next >