src/cpu/sparc/vm/cppInterpreter_sparc.cpp
Print this page
@@ -580,11 +580,10 @@
address entry = __ pc();
// the following temporary registers are used during frame creation
const Register Gtmp1 = G3_scratch ;
const Register Gtmp2 = G1_scratch;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
bool inc_counter = UseCompiler || CountCompiledCalls;
// make sure registers are different!
assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
@@ -616,11 +615,12 @@
__ stop("tried to execute abstract method as non-abstract");
__ bind(L);
}
#endif // ASSERT
- __ lduh(size_of_parameters, Gtmp1);
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), Gtmp1);
+ __ lduh(Gtmp1, in_bytes(ConstMethod::size_of_parameters_offset()), Gtmp1);
__ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes
__ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord
// NEW
__ add(Gargs, -wordSize, Gargs); // points to first local[0]
// generate the code to allocate the interpreter stack frame
@@ -1045,12 +1045,10 @@
assert_different_registers(state, prev_state);
assert_different_registers(prev_state, G3_scratch);
const Register Gtmp = G3_scratch;
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
// slop factor is two extra slots on the expression stack so that
// we always have room to store a result when returning from a call without parameters
// that returns a result.
@@ -1064,11 +1062,12 @@
// XXX G5_method valid
// Now compute new frame size
if (native) {
- __ lduh( size_of_parameters, Gtmp );
+ __ ld_ptr(constMethod, Gtmp);
+ __ lduh(Gtmp, in_bytes(ConstMethod::size_of_parameters_offset()), Gtmp );
__ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
} else {
// Full size expression stack
__ ld_ptr(constMethod, Gtmp);
__ lduh(Gtmp, in_bytes(ConstMethod::max_stack_offset()), Gtmp);
@@ -1237,12 +1236,13 @@
if (init_value != noreg) {
Label clear_loop;
// NOTE: If you change the frame layout, this code will need to
// be updated!
- __ lduh( size_of_locals, O2 );
- __ lduh( size_of_parameters, O1 );
+ __ ld_ptr( constMethod, O1 );
+ __ lduh( O1, in_bytes(ConstMethod::size_of_locals_offset()), O2 );
+ __ lduh(O1, in_bytes(ConstMethod::size_of_parameters_offset()), O1);
__ sll( O2, LogBytesPerWord, O2);
__ sll( O1, LogBytesPerWord, O1 );
__ ld_ptr(XXX_STATE(_locals), L2_scratch);
__ sub( L2_scratch, O2, O2 );
__ sub( L2_scratch, O1, O1 );
@@ -1482,21 +1482,20 @@
// In/Out O5_savedSP (sender's original SP)
//
// assert_different_registers(state, prev_state);
const Register Gtmp = G3_scratch;
const Register tmp = O2;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
- __ lduh(size_of_parameters, tmp);
- __ sll(tmp, LogBytesPerWord, Gtmp); // parameter size in bytes
- __ add(args, Gtmp, Gargs); // points to first local + BytesPerWord
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), Gtmp);
+ __ lduh(Gtmp, in_bytes(ConstMethod::size_of_parameters_offset()), tmp);
+ __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes
+ __ add(args, Gargs, Gargs); // points to first local + BytesPerWord
// NEW
__ add(Gargs, -wordSize, Gargs); // points to first local[0]
// determine extra space for non-argument locals & adjust caller's SP
// Gtmp1: parameter size in words
- __ lduh(size_of_locals, Gtmp);
+ __ lduh(Gtmp, in_bytes(ConstMethod::size_of_locals_offset()), Gtmp);
__ compute_extra_locals_size_in_bytes(tmp, Gtmp, Gtmp);
#if 1
// c2i adapters place the final interpreter argument in the register save area for O0/I0
// the call_stub will place the final interpreter argument at
@@ -1539,12 +1538,10 @@
const Register Gtmp1 = G3_scratch;
// const Register Lmirror = L1; // native mirror (native calls only)
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
address entry_point = __ pc();
__ mov(G0, prevState); // no current activation
@@ -1748,11 +1745,13 @@
// Process the native abi result to java expression stack
__ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method
__ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack
- __ lduh(L4_scratch, in_bytes(Method::size_of_parameters_offset()), L2_scratch); // get parameter size
+ // get parameter size
+ __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch);
+ __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch);
__ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes
__ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result
__ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index
// tosca is really just native abi