< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page




2660 
2661     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), robj);
2662 
2663     __ bind(skip_register_finalizer);
2664   }
2665 
2666 #ifdef _LP64
2667   if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
2668     Label no_safepoint;
2669     NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
2670     __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2671     __ jcc(Assembler::zero, no_safepoint);
2672     __ push(state);
2673     __ call_VM(noreg, CAST_FROM_FN_PTR(address,
2674                                     InterpreterRuntime::at_safepoint));
2675     __ pop(state);
2676     __ bind(no_safepoint);
2677   }
2678 #endif
2679   if (state == qtos) {
2680     const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
2681     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::return_value), rax);
2682     NOT_LP64(__ get_thread(thread1));
2683     __ get_vm_result(rax, thread1);














2684   }
2685 
2686   // Narrow result if state is itos but result type is smaller.
2687   // Need to narrow in the return bytecode rather than in generate_return_entry
2688   // since compiled code callers expect the result to already be narrowed.
2689   if (state == itos) {
2690     __ narrow(rax);
2691   }
2692 
2693 #ifdef ASSERT
2694   if (EnableMVT || EnableValhalla) {
2695     if (state == atos) {
2696       const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
2697       __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::check_areturn), rax);
2698       NOT_LP64(__ get_thread(thread1));
2699       __ get_vm_result(rax, thread1);
2700     }
2701   }
2702 #endif // ASSERT
2703 




2660 
2661     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), robj);
2662 
2663     __ bind(skip_register_finalizer);
2664   }
2665 
2666 #ifdef _LP64
2667   if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
2668     Label no_safepoint;
2669     NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
2670     __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2671     __ jcc(Assembler::zero, no_safepoint);
2672     __ push(state);
2673     __ call_VM(noreg, CAST_FROM_FN_PTR(address,
2674                                     InterpreterRuntime::at_safepoint));
2675     __ pop(state);
2676     __ bind(no_safepoint);
2677   }
2678 #endif
2679   if (state == qtos) {
2680 #ifndef _LP64
2681     ShouldNotReachHere();
2682 #else
2683     Label not_buffered;
2684     __ lea(r14, ExternalAddress(VTBuffer::_base));
2685     __ cmpptr(rax, r14);
2686     __ jcc(Assembler::below, not_buffered);
2687     __ lea(r14, ExternalAddress(VTBuffer::_end));
2688     __ cmpptr(rax, r14);
2689     __ jcc(Assembler::aboveEqual, not_buffered);
2690     if (ReturnValuesInThreadLocalBuffer) {
2691       __ movptr((Address(r15_thread, JavaThread::return_buffered_value_offset())), rax);
2692     } else {
2693       __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::reallocate_value_in_heap), rax);
2694       __ get_vm_result(rax, r15_thread);
2695     }
2696     __ bind(not_buffered);
2697 #endif
2698   }
2699 
2700   // Narrow result if state is itos but result type is smaller.
2701   // Need to narrow in the return bytecode rather than in generate_return_entry
2702   // since compiled code callers expect the result to already be narrowed.
2703   if (state == itos) {
2704     __ narrow(rax);
2705   }
2706 
2707 #ifdef ASSERT
2708   if (EnableMVT || EnableValhalla) {
2709     if (state == atos) {
2710       const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
2711       __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::check_areturn), rax);
2712       NOT_LP64(__ get_thread(thread1));
2713       __ get_vm_result(rax, thread1);
2714     }
2715   }
2716 #endif // ASSERT
2717 


< prev index next >