2742 2743 if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) { 2744 Label no_safepoint; 2745 NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll")); 2746 #ifdef _LP64 2747 __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); 2748 #else 2749 const Register thread = rdi; 2750 __ get_thread(thread); 2751 __ testb(Address(thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); 2752 #endif 2753 __ jcc(Assembler::zero, no_safepoint); 2754 __ push(state); 2755 __ call_VM(noreg, CAST_FROM_FN_PTR(address, 2756 InterpreterRuntime::at_safepoint)); 2757 __ pop(state); 2758 __ bind(no_safepoint); 2759 } 2760 2761 if (state == atos) { 2762 if (ValueTypesBufferMaxMemory > 0) { 2763 Label notBuffered; 2764 2765 __ test_value_is_not_buffered(rax, rbx, notBuffered); 2766 const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread); 2767 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::return_value), rax); 2768 NOT_LP64(__ get_thread(thread1)); 2769 __ get_vm_result(rax, thread1); 2770 __ bind(notBuffered); 2771 } 2772 } 2773 2774 // Narrow result if state is itos but result type is smaller. 2775 // Need to narrow in the return bytecode rather than in generate_return_entry 2776 // since compiled code callers expect the result to already be narrowed. 2777 if (state == itos) { 2778 __ narrow(rax); 2779 } 2780 2781 __ remove_activation(state, rbcp, true, true, true, /*state == qtos*/ false && ValueTypeReturnedAsFields); | 2742 2743 if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) { 2744 Label no_safepoint; 2745 NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll")); 2746 #ifdef _LP64 2747 __ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); 2748 #else 2749 const Register thread = rdi; 2750 __ get_thread(thread); 2751 __ testb(Address(thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit()); 2752 #endif 2753 __ jcc(Assembler::zero, no_safepoint); 2754 __ push(state); 2755 __ call_VM(noreg, CAST_FROM_FN_PTR(address, 2756 InterpreterRuntime::at_safepoint)); 2757 __ pop(state); 2758 __ bind(no_safepoint); 2759 } 2760 2761 if (state == atos) { 2762 Label not_returning_null_vt; 2763 const Register method = rbx; 2764 2765 __ testl(rax, rax); 2766 __ jcc(Assembler::notZero, not_returning_null_vt); 2767 __ get_method(method); 2768 __ cmpb(Address(rbx, Method::flags_offset() + in_ByteSize(1)), Method::byte_value_for_known_not_returning_vt()); 2769 __ jcc(Assembler::equal, not_returning_null_vt); 2770 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::deoptimize_caller_frame_for_vt), method); 2771 __ bind(not_returning_null_vt); 2772 if (ValueTypesBufferMaxMemory > 0) { 2773 Label notBuffered; 2774 2775 __ test_value_is_not_buffered(rax, rbx, notBuffered); 2776 const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread); 2777 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::return_value), rax); 2778 NOT_LP64(__ get_thread(thread1)); 2779 __ get_vm_result(rax, thread1); 2780 __ bind(notBuffered); 2781 } 2782 } 2783 2784 // Narrow result if state is itos but result type is smaller. 2785 // Need to narrow in the return bytecode rather than in generate_return_entry 2786 // since compiled code callers expect the result to already be narrowed. 2787 if (state == itos) { 2788 __ narrow(rax); 2789 } 2790 2791 __ remove_activation(state, rbcp, true, true, true, /*state == qtos*/ false && ValueTypeReturnedAsFields); |