136
137 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
138 Label run_compiled_code;
139 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
140 // compiled code in threads for which the event is enabled. Check here for
141 // interp_only_mode if these events CAN be enabled.
142 #ifdef _LP64
143 Register rthread = r15_thread;
144 #else
145 Register rthread = temp;
146 __ get_thread(rthread);
147 #endif
148 // interp_only is an int, on little endian it is sufficient to test the byte only
149 // Is a cmpl faster?
150 __ cmpb(Address(rthread, JavaThread::interp_only_mode_offset()), 0);
151 __ jccb(Assembler::zero, run_compiled_code);
152 __ jmp(Address(method, Method::interpreter_entry_offset()));
153 __ BIND(run_compiled_code);
154 }
155
156 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :
157 Method::from_interpreted_offset();
158 __ jmp(Address(method, entry_offset));
159
160 __ bind(L_no_such_method);
161 __ jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
162 }
163
164 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
165 Register recv, Register method_temp,
166 Register temp2,
167 bool for_compiler_entry) {
168 BLOCK_COMMENT("jump_to_lambda_form {");
169 // This is the initial entry point of a lazy method handle.
170 // After type checking, it picks up the invoker from the LambdaForm.
171 assert_different_registers(recv, method_temp, temp2);
172 assert(recv != noreg, "required register");
173 assert(method_temp == rbx, "required register for loading method");
174
175 // Load the invoker, as MH -> MH.form -> LF.vmentry
176 __ verify_oop(recv);
|
136
137 if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
138 Label run_compiled_code;
139 // JVMTI events, such as single-stepping, are implemented partly by avoiding running
140 // compiled code in threads for which the event is enabled. Check here for
141 // interp_only_mode if these events CAN be enabled.
142 #ifdef _LP64
143 Register rthread = r15_thread;
144 #else
145 Register rthread = temp;
146 __ get_thread(rthread);
147 #endif
148 // interp_only is an int, on little endian it is sufficient to test the byte only
149 // Is a cmpl faster?
150 __ cmpb(Address(rthread, JavaThread::interp_only_mode_offset()), 0);
151 __ jccb(Assembler::zero, run_compiled_code);
152 __ jmp(Address(method, Method::interpreter_entry_offset()));
153 __ BIND(run_compiled_code);
154 }
155
156 // The following jump might pass an inline type argument that was erased to Object as oop to a
157 // callee that expects inline type arguments to be passed as fields. We need to call the compiled
158 // value entry (_code->inline_entry_point() or _adapter->c2i_inline_entry()) which will take care
159 // of translating between the calling conventions.
160 const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_inline_offset() :
161 Method::from_interpreted_offset();
162 __ jmp(Address(method, entry_offset));
163
164 __ bind(L_no_such_method);
165 __ jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
166 }
167
168 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
169 Register recv, Register method_temp,
170 Register temp2,
171 bool for_compiler_entry) {
172 BLOCK_COMMENT("jump_to_lambda_form {");
173 // This is the initial entry point of a lazy method handle.
174 // After type checking, it picks up the invoker from the LambdaForm.
175 assert_different_registers(recv, method_temp, temp2);
176 assert(recv != noreg, "required register");
177 assert(method_temp == rbx, "required register for loading method");
178
179 // Load the invoker, as MH -> MH.form -> LF.vmentry
180 __ verify_oop(recv);
|