src/cpu/sparc/vm/cppInterpreter_sparc.cpp
Print this page
@@ -580,11 +580,13 @@
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()));
+ const Register RconstMethod = Gtmp1;
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::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,10 +618,11 @@
__ stop("tried to execute abstract method as non-abstract");
__ bind(L);
}
#endif // ASSERT
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, 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]
@@ -1045,12 +1048,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,10 +1065,13 @@
// XXX G5_method valid
// Now compute new frame size
if (native) {
+ const Register RconstMethod = Gtmp;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh( size_of_parameters, 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);
@@ -1234,13 +1238,17 @@
__ set( 0x0F0F0F0F, init_value );
#endif // ASSERT
}
if (init_value != noreg) {
Label clear_loop;
+ const Register RconstMethod = O1;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
// NOTE: If you change the frame layout, this code will need to
// be updated!
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, LogBytesPerWord, O2);
__ sll( O1, LogBytesPerWord, O1 );
__ ld_ptr(XXX_STATE(_locals), L2_scratch);
@@ -1481,17 +1489,20 @@
// Destroys args, G3_scratch, G3_scratch
// In/Out O5_savedSP (sender's original SP)
//
// assert_different_registers(state, prev_state);
const Register Gtmp = G3_scratch;
+ const RconstMethod = 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()));
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, tmp);
- __ sll(tmp, LogBytesPerWord, Gtmp); // parameter size in bytes
- __ add(args, Gtmp, Gargs); // points to first local + BytesPerWord
+ __ 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);
@@ -1539,12 +1550,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 +1757,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