< prev index next >

src/hotspot/cpu/x86/methodHandles_x86.cpp

Print this page




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




 151                                                      Method::from_interpreted_offset();
 152   __ jmp(Address(method, entry_offset));
 153 
 154   __ bind(L_no_such_method);
 155   __ jump(RuntimeAddress(StubRoutines::throw_AbstractMethodError_entry()));
 156 }
 157 
 158 void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
 159                                         Register recv, Register method_temp,
 160                                         Register temp2,
 161                                         bool for_compiler_entry) {
 162   BLOCK_COMMENT("jump_to_lambda_form {");
 163   // This is the initial entry point of a lazy method handle.
 164   // After type checking, it picks up the invoker from the LambdaForm.
 165   assert_different_registers(recv, method_temp, temp2);
 166   assert(recv != noreg, "required register");
 167   assert(method_temp == rbx, "required register for loading method");
 168 
 169   //NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
 170 




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


< prev index next >