2827 } 2828 2829 2830 void TemplateTable::_return(TosState state) { 2831 transition(state, state); 2832 assert(_desc->calls_vm(), "inconsistent calls_vm information"); // call in remove_activation 2833 2834 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { 2835 Label skip_register_finalizer; 2836 assert(state == vtos, "only valid state"); 2837 __ ldr(R1, aaddress(0)); 2838 __ load_klass(Rtemp, R1); 2839 __ ldr_u32(Rtemp, Address(Rtemp, Klass::access_flags_offset())); 2840 __ tbz(Rtemp, exact_log2(JVM_ACC_HAS_FINALIZER), skip_register_finalizer); 2841 2842 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), R1); 2843 2844 __ bind(skip_register_finalizer); 2845 } 2846 2847 // Narrow result if state is itos but result type is smaller. 2848 // Need to narrow in the return bytecode rather than in generate_return_entry 2849 // since compiled code callers expect the result to already be narrowed. 2850 if (state == itos) { 2851 __ narrow(R0_tos); 2852 } 2853 __ remove_activation(state, LR); 2854 2855 __ interp_verify_oop(R0_tos, state, __FILE__, __LINE__); 2856 2857 #ifndef AARCH64 2858 // According to interpreter calling conventions, result is returned in R0/R1, 2859 // so ftos (S0) and dtos (D0) are moved to R0/R1. 2860 // This conversion should be done after remove_activation, as it uses 2861 // push(state) & pop(state) to preserve return value. 2862 __ convert_tos_to_retval(state); 2863 #endif // !AARCH64 2864 2865 __ ret(); 2866 | 2827 } 2828 2829 2830 void TemplateTable::_return(TosState state) { 2831 transition(state, state); 2832 assert(_desc->calls_vm(), "inconsistent calls_vm information"); // call in remove_activation 2833 2834 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { 2835 Label skip_register_finalizer; 2836 assert(state == vtos, "only valid state"); 2837 __ ldr(R1, aaddress(0)); 2838 __ load_klass(Rtemp, R1); 2839 __ ldr_u32(Rtemp, Address(Rtemp, Klass::access_flags_offset())); 2840 __ tbz(Rtemp, exact_log2(JVM_ACC_HAS_FINALIZER), skip_register_finalizer); 2841 2842 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), R1); 2843 2844 __ bind(skip_register_finalizer); 2845 } 2846 2847 // Explicitly reset last_sp, for handling special case in TemplateInterpreter::deopt_reexecute_entry 2848 #ifndef AARCH64 2849 if (state == vtos) { 2850 __ mov(Rtemp, 0); 2851 __ str(Rtemp, Address(FP, frame::interpreter_frame_last_sp_offset * wordSize)); 2852 } 2853 #endif 2854 2855 // Narrow result if state is itos but result type is smaller. 2856 // Need to narrow in the return bytecode rather than in generate_return_entry 2857 // since compiled code callers expect the result to already be narrowed. 2858 if (state == itos) { 2859 __ narrow(R0_tos); 2860 } 2861 __ remove_activation(state, LR); 2862 2863 __ interp_verify_oop(R0_tos, state, __FILE__, __LINE__); 2864 2865 #ifndef AARCH64 2866 // According to interpreter calling conventions, result is returned in R0/R1, 2867 // so ftos (S0) and dtos (D0) are moved to R0/R1. 2868 // This conversion should be done after remove_activation, as it uses 2869 // push(state) & pop(state) to preserve return value. 2870 __ convert_tos_to_retval(state); 2871 #endif // !AARCH64 2872 2873 __ ret(); 2874 |