src/cpu/x86/vm/cppInterpreter_x86.cpp
Print this page
@@ -609,12 +609,10 @@
// rsp - sender_sp
// C++ interpreter only
// rsi/r13 - previous interpreter state pointer
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes one argument
// indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
// The call returns the address of the verified entry point for the method or NULL
// if the compilation did not complete (either went background or bailed out).
__ movptr(rax, (int32_t)false);
@@ -975,20 +973,20 @@
// rsi/r13: previous interpreter state (if called from C++ interpreter) must preserve
// in any case. If called via c1/c2/call_stub rsi/r13 is junk (to use) but harmless
// to save/restore.
address entry_point = __ pc();
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
// rsi/r13 == state/locals rdi == prevstate
const Register locals = rdi;
// get parameter size (always needed)
- __ load_unsigned_short(rcx, size_of_parameters);
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
// rbx: Method*
// rcx: size of parameters
__ pop(rax); // get return address
// for natives the size of locals is zero
@@ -1109,11 +1107,12 @@
const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1
// allocate space for parameters
__ movptr(method, STATE(_method));
__ verify_method_ptr(method);
- __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
+ __ movptr(t, Address(method, Method::const_offset()));
+ __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset()));
__ shll(t, 2);
#ifdef _LP64
__ subptr(rsp, t);
__ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
__ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI)
@@ -1698,24 +1697,25 @@
__ bind(dispatch_entry_2);
// save sender sp
__ push(rcx);
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address access_flags (rbx, Method::access_flags_offset());
// const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
// const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
// const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock));
// get parameter size (always needed)
- __ load_unsigned_short(rcx, size_of_parameters);
+ __ movptr(rdx, constMethod);
+ __ load_unsigned_short(rcx, Address(rdx, ConstMethod::size_of_parameters_offset()));
// rbx: Method*
// rcx: size of parameters
- __ load_unsigned_short(rdx, size_of_locals); // get size of locals in words
+ // get size of locals in words
+ __ load_unsigned_short(rdx, Address(rdx, ConstMethod::size_of_locals_offset()));
__ subptr(rdx, rcx); // rdx = no. of additional locals
// see if we've got enough room on the stack for locals plus overhead.
generate_stack_overflow_check(); // C++
@@ -1987,11 +1987,13 @@
// get method just executed
__ movptr(rbx, STATE(_result._to_call._callee));
// callee left args on top of expression stack, remove them
- __ load_unsigned_short(rcx, Address(rbx, Method::size_of_parameters_offset()));
+ __ movptr(rcx, Address(rbx, Method::const_offset()));
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
+
__ lea(rsp, Address(rsp, rcx, Address::times_ptr));
__ movl(rcx, Address(rbx, Method::result_index_offset()));
ExternalAddress tosca_to_stack((address)CppInterpreter::_tosca_to_stack);
// Address index(noreg, rax, Address::times_ptr);
@@ -2157,11 +2159,13 @@
// don't need a return address if reinvoking interpreter
// Make it look like call_stub calling conventions
// Get (potential) receiver
- __ load_unsigned_short(rcx, size_of_parameters); // get size of parameters in words
+ // get size of parameters in words
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation));
__ pushptr(recursive.addr()); // make it look good in the debugger
InternalAddress entry(entry_point);