< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

176 
177    Label L_no_such_method;
178    __ testptr(rbx, rbx);
179    __ jcc(Assembler::zero, L_no_such_method);
180 
181   verify_method(_masm, method, temp, iid);
182 
183   if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
184     Label run_compiled_code;
185     // JVMTI events, such as single-stepping, are implemented partly by avoiding running
186     // compiled code in threads for which the event is enabled.  Check here for
187     // interp_only_mode if these events CAN be enabled.
188     // interp_only is an int, on little endian it is sufficient to test the byte only
189     // Is a cmpl faster?
190     __ cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0);
191     __ jccb(Assembler::zero, run_compiled_code);
192     __ jmp(Address(method, Method::interpreter_entry_offset()));
193     __ BIND(run_compiled_code);
194   }
195 
196   const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :




197                                                      Method::from_interpreted_offset();
198   __ jmp(Address(method, entry_offset));
199 
200   __ bind(L_no_such_method);
201   __ jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
202 }
203 
204 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
205                                         Register recv, Register method_temp,
206                                         Register temp2,
207                                         bool for_compiler_entry) {
208   BLOCK_COMMENT("jump_to_lambda_form {");
209   // This is the initial entry point of a lazy method handle.
210   // After type checking, it picks up the invoker from the LambdaForm.
211   assert_different_registers(recv, method_temp, temp2);
212   assert(recv != noreg, "required register");
213   assert(method_temp == rbx, "required register for loading method");
214 
215   // Load the invoker, as MH -> MH.form -> LF.vmentry
216   __ verify_oop(recv);

176 
177    Label L_no_such_method;
178    __ testptr(rbx, rbx);
179    __ jcc(Assembler::zero, L_no_such_method);
180 
181   verify_method(_masm, method, temp, iid);
182 
183   if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
184     Label run_compiled_code;
185     // JVMTI events, such as single-stepping, are implemented partly by avoiding running
186     // compiled code in threads for which the event is enabled.  Check here for
187     // interp_only_mode if these events CAN be enabled.
188     // interp_only is an int, on little endian it is sufficient to test the byte only
189     // Is a cmpl faster?
190     __ cmpb(Address(r15_thread, JavaThread::interp_only_mode_offset()), 0);
191     __ jccb(Assembler::zero, run_compiled_code);
192     __ jmp(Address(method, Method::interpreter_entry_offset()));
193     __ BIND(run_compiled_code);
194   }
195 
196   // The following jump might pass an inline type argument that was erased to Object as oop to a
197   // callee that expects inline type arguments to be passed as fields. We need to call the compiled
198   // value entry (_code->inline_entry_point() or _adapter->c2i_inline_entry()) which will take care
199   // of translating between the calling conventions.
200   const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_inline_offset() :
201                                                      Method::from_interpreted_offset();
202   __ jmp(Address(method, entry_offset));
203 
204   __ bind(L_no_such_method);
205   __ jump(RuntimeAddress(SharedRuntime::throw_AbstractMethodError_entry()));
206 }
207 
208 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
209                                         Register recv, Register method_temp,
210                                         Register temp2,
211                                         bool for_compiler_entry) {
212   BLOCK_COMMENT("jump_to_lambda_form {");
213   // This is the initial entry point of a lazy method handle.
214   // After type checking, it picks up the invoker from the LambdaForm.
215   assert_different_registers(recv, method_temp, temp2);
216   assert(recv != noreg, "required register");
217   assert(method_temp == rbx, "required register for loading method");
218 
219   // Load the invoker, as MH -> MH.form -> LF.vmentry
220   __ verify_oop(recv);
< prev index next >