2759 }
2760
2761 if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
2762 Label no_safepoint;
2763 NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
2764 #ifdef _LP64
2765 __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2766 #else
2767 const Register thread = rdi;
2768 __ get_thread(thread);
2769 __ testb(Address(thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2770 #endif
2771 __ jcc(Assembler::zero, no_safepoint);
2772 __ push(state);
2773 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
2774 InterpreterRuntime::at_safepoint));
2775 __ pop(state);
2776 __ bind(no_safepoint);
2777 }
2778
2779 if (state == atos) {
2780 if (ValueTypesBufferMaxMemory > 0) {
2781 Label notBuffered;
2782
2783 __ test_value_is_not_buffered(rax, rbx, notBuffered);
2784 const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
2785 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::return_value), rax);
2786 NOT_LP64(__ get_thread(thread1));
2787 __ get_vm_result(rax, thread1);
2788 __ bind(notBuffered);
2789 }
2790 }
2791
2792 // Narrow result if state is itos but result type is smaller.
2793 // Need to narrow in the return bytecode rather than in generate_return_entry
2794 // since compiled code callers expect the result to already be narrowed.
2795 if (state == itos) {
2796 __ narrow(rax);
2797 }
2798
2799 __ remove_activation(state, rbcp, true, true, true, /*state == qtos*/ false && ValueTypeReturnedAsFields);
|
2759 }
2760
2761 if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
2762 Label no_safepoint;
2763 NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
2764 #ifdef _LP64
2765 __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2766 #else
2767 const Register thread = rdi;
2768 __ get_thread(thread);
2769 __ testb(Address(thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
2770 #endif
2771 __ jcc(Assembler::zero, no_safepoint);
2772 __ push(state);
2773 __ call_VM(noreg, CAST_FROM_FN_PTR(address,
2774 InterpreterRuntime::at_safepoint));
2775 __ pop(state);
2776 __ bind(no_safepoint);
2777 }
2778
2779 if (EnableValhalla && state == atos) {
2780 Label not_returning_null_vt;
2781 const Register method = rbx, tmp = rdx;
2782
2783 __ testl(rax, rax);
2784 __ jcc(Assembler::notZero, not_returning_null_vt);
2785 __ get_method(method);
2786 __ load_unsigned_short(tmp, Address(rbx, Method::flags_offset()));
2787 __ testl(tmp, Method::is_returning_vt_mask());
2788 __ jcc(Assembler::zero, not_returning_null_vt);
2789 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::deoptimize_caller_frame_for_vt), method);
2790 __ bind(not_returning_null_vt);
2791
2792 if (ValueTypesBufferMaxMemory > 0) {
2793 Label notBuffered;
2794
2795 __ test_value_is_not_buffered(rax, rbx, notBuffered);
2796 const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
2797 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::return_value), rax);
2798 NOT_LP64(__ get_thread(thread1));
2799 __ get_vm_result(rax, thread1);
2800 __ bind(notBuffered);
2801 }
2802 }
2803
2804 // Narrow result if state is itos but result type is smaller.
2805 // Need to narrow in the return bytecode rather than in generate_return_entry
2806 // since compiled code callers expect the result to already be narrowed.
2807 if (state == itos) {
2808 __ narrow(rax);
2809 }
2810
2811 __ remove_activation(state, rbcp, true, true, true, /*state == qtos*/ false && ValueTypeReturnedAsFields);
|