< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page

137 
138   if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
139     Label run_compiled_code;
140     // JVMTI events, such as single-stepping, are implemented partly by avoiding running
141     // compiled code in threads for which the event is enabled.  Check here for
142     // interp_only_mode if these events CAN be enabled.
143 #ifdef _LP64
144     Register rthread = r15_thread;
145 #else
146     Register rthread = temp;
147     __ get_thread(rthread);
148 #endif
149     // interp_only is an int, on little endian it is sufficient to test the byte only
150     // Is a cmpl faster?
151     __ cmpb(Address(rthread, JavaThread::interp_only_mode_offset()), 0);
152     __ jccb(Assembler::zero, run_compiled_code);
153     __ jmp(Address(method, Method::interpreter_entry_offset()));
154     __ BIND(run_compiled_code);
155   }
156 
157   const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() :




158                                                      Method::from_interpreted_offset();
159   __ jmp(Address(method, entry_offset));
160 
161   __ bind(L_no_such_method);
162   __ jump(RuntimeAddress(StubRoutines::throw_AbstractMethodError_entry()));
163 }
164 
165 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
166                                         Register recv, Register method_temp,
167                                         Register temp2,
168                                         bool for_compiler_entry) {
169   BLOCK_COMMENT("jump_to_lambda_form {");
170   // This is the initial entry point of a lazy method handle.
171   // After type checking, it picks up the invoker from the LambdaForm.
172   assert_different_registers(recv, method_temp, temp2);
173   assert(recv != noreg, "required register");
174   assert(method_temp == rbx, "required register for loading method");
175 
176   // Load the invoker, as MH -> MH.form -> LF.vmentry
177   __ verify_oop(recv);

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