99 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
100 bool for_compiler_entry) {
101 assert(method == rmethod, "interpreter calling convention");
102 Label L_no_such_method;
103 __ cbz(rmethod, L_no_such_method);
104 __ verify_method_ptr(method);
105
106 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
107 Label run_compiled_code;
108 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
109 // compiled code in threads for which the event is enabled. Check here for
110 // interp_only_mode if these events CAN be enabled.
111
112 __ ldrw(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
113 __ cbzw(rscratch1, run_compiled_code);
114 __ ldr(rscratch1, Address(method, Method::interpreter_entry_offset()));
115 __ br(rscratch1);
116 __ BIND(run_compiled_code);
117 }
118
119 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
120 Method::from_interpreted_offset();
121 __ ldr(rscratch1,Address(method, entry_offset));
122 __ br(rscratch1);
123 __ bind(L_no_such_method);
124 __ far_jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
125 }
126
127 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
128 Register recv, Register method_temp,
129 Register temp2,
130 bool for_compiler_entry) {
131 BLOCK_COMMENT("jump_to_lambda_form {");
132 // This is the initial entry point of a lazy method handle.
133 // After type checking, it picks up the invoker from the LambdaForm.
134 assert_different_registers(recv, method_temp, temp2);
135 assert(recv != noreg, "required register");
136 assert(method_temp == rmethod, "required register for loading method");
137
138 // Load the invoker, as MH -> MH.form -> LF.vmentry
139 __ verify_oop(recv);
|
99 void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
100 bool for_compiler_entry) {
101 assert(method == rmethod, "interpreter calling convention");
102 Label L_no_such_method;
103 __ cbz(rmethod, L_no_such_method);
104 __ verify_method_ptr(method);
105
106 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
107 Label run_compiled_code;
108 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
109 // compiled code in threads for which the event is enabled. Check here for
110 // interp_only_mode if these events CAN be enabled.
111
112 __ ldrw(rscratch1, Address(rthread, JavaThread::interp_only_mode_offset()));
113 __ cbzw(rscratch1, run_compiled_code);
114 __ ldr(rscratch1, Address(method, Method::interpreter_entry_offset()));
115 __ br(rscratch1);
116 __ BIND(run_compiled_code);
117 }
118
119 // The following jump might pass an inline type argument that was erased to Object as oop to a
120 // callee that expects inline type arguments to be passed as fields. We need to call the compiled
121 // value entry (_code->inline_entry_point() or _adapter->c2i_inline_entry()) which will take care
122 // of translating between the calling conventions.
123 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_inline_offset() :
124 Method::from_interpreted_offset();
125 __ ldr(rscratch1,Address(method, entry_offset));
126 __ br(rscratch1);
127 __ bind(L_no_such_method);
128 __ far_jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
129 }
130
131 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
132 Register recv, Register method_temp,
133 Register temp2,
134 bool for_compiler_entry) {
135 BLOCK_COMMENT("jump_to_lambda_form {");
136 // This is the initial entry point of a lazy method handle.
137 // After type checking, it picks up the invoker from the LambdaForm.
138 assert_different_registers(recv, method_temp, temp2);
139 assert(recv != noreg, "required register");
140 assert(method_temp == rmethod, "required register for loading method");
141
142 // Load the invoker, as MH -> MH.form -> LF.vmentry
143 __ verify_oop(recv);
|