Fri, 14 Dec 2012 11:45:55 -0800
Merge
1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Thu Dec 13 09:06:38 2012 -0800 1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Fri Dec 14 11:45:55 2012 -0800 1.3 @@ -69,6 +69,8 @@ 1.4 signatureIndex = new CIntField(type.getCIntegerField("_signature_index"), 0); 1.5 idnum = new CIntField(type.getCIntegerField("_method_idnum"), 0); 1.6 maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0); 1.7 + maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0); 1.8 + sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0); 1.9 1.10 // start of byte code 1.11 bytecodeOffset = type.getSize(); 1.12 @@ -96,6 +98,8 @@ 1.13 private static CIntField signatureIndex; 1.14 private static CIntField idnum; 1.15 private static CIntField maxStack; 1.16 + private static CIntField maxLocals; 1.17 + private static CIntField sizeOfParameters; 1.18 1.19 // start of bytecode 1.20 private static long bytecodeOffset; 1.21 @@ -151,6 +155,14 @@ 1.22 return maxStack.getValue(this); 1.23 } 1.24 1.25 + public long getMaxLocals() { 1.26 + return maxLocals.getValue(this); 1.27 + } 1.28 + 1.29 + public long getSizeOfParameters() { 1.30 + return sizeOfParameters.getValue(this); 1.31 + } 1.32 + 1.33 public Symbol getName() { 1.34 return getMethod().getName(); 1.35 } 1.36 @@ -247,6 +259,8 @@ 1.37 visitor.doCInt(signatureIndex, true); 1.38 visitor.doCInt(codeSize, true); 1.39 visitor.doCInt(maxStack, true); 1.40 + visitor.doCInt(maxLocals, true); 1.41 + visitor.doCInt(sizeOfParameters, true); 1.42 } 1.43 1.44 // Accessors
2.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Thu Dec 13 09:06:38 2012 -0800 2.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Fri Dec 14 11:45:55 2012 -0800 2.3 @@ -50,8 +50,6 @@ 2.4 constMethod = type.getAddressField("_constMethod"); 2.5 methodData = type.getAddressField("_method_data"); 2.6 methodSize = new CIntField(type.getCIntegerField("_method_size"), 0); 2.7 - maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0); 2.8 - sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0); 2.9 accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); 2.10 code = type.getAddressField("_code"); 2.11 vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); 2.12 @@ -83,8 +81,6 @@ 2.13 private static AddressField constMethod; 2.14 private static AddressField methodData; 2.15 private static CIntField methodSize; 2.16 - private static CIntField maxLocals; 2.17 - private static CIntField sizeOfParameters; 2.18 private static CIntField accessFlags; 2.19 private static CIntField vtableIndex; 2.20 private static CIntField invocationCounter; 2.21 @@ -134,8 +130,8 @@ 2.22 /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ 2.23 public long getMethodSize() { return methodSize.getValue(this); } 2.24 public long getMaxStack() { return getConstMethod().getMaxStack(); } 2.25 - public long getMaxLocals() { return maxLocals.getValue(this); } 2.26 - public long getSizeOfParameters() { return sizeOfParameters.getValue(this); } 2.27 + public long getMaxLocals() { return getConstMethod().getMaxLocals(); } 2.28 + public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); } 2.29 public long getNameIndex() { return getConstMethod().getNameIndex(); } 2.30 public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); } 2.31 public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); } 2.32 @@ -282,8 +278,6 @@ 2.33 2.34 public void iterateFields(MetadataVisitor visitor) { 2.35 visitor.doCInt(methodSize, true); 2.36 - visitor.doCInt(maxLocals, true); 2.37 - visitor.doCInt(sizeOfParameters, true); 2.38 visitor.doCInt(accessFlags, true); 2.39 } 2.40
3.1 --- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Thu Dec 13 09:06:38 2012 -0800 3.2 +++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Fri Dec 14 11:45:55 2012 -0800 3.3 @@ -582,7 +582,9 @@ 3.4 // the following temporary registers are used during frame creation 3.5 const Register Gtmp1 = G3_scratch ; 3.6 const Register Gtmp2 = G1_scratch; 3.7 - const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 3.8 + const Register RconstMethod = Gtmp1; 3.9 + const Address constMethod(G5_method, 0, in_bytes(Method::const_offset())); 3.10 + const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset())); 3.11 3.12 bool inc_counter = UseCompiler || CountCompiledCalls; 3.13 3.14 @@ -618,6 +620,7 @@ 3.15 } 3.16 #endif // ASSERT 3.17 3.18 + __ ld_ptr(constMethod, RconstMethod); 3.19 __ lduh(size_of_parameters, Gtmp1); 3.20 __ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes 3.21 __ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord 3.22 @@ -1047,8 +1050,6 @@ 3.23 const Register Gtmp = G3_scratch; 3.24 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset())); 3.25 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset())); 3.26 - const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 3.27 - const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset())); 3.28 3.29 // slop factor is two extra slots on the expression stack so that 3.30 // we always have room to store a result when returning from a call without parameters 3.31 @@ -1066,6 +1067,9 @@ 3.32 // Now compute new frame size 3.33 3.34 if (native) { 3.35 + const Register RconstMethod = Gtmp; 3.36 + const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset())); 3.37 + __ ld_ptr(constMethod, RconstMethod); 3.38 __ lduh( size_of_parameters, Gtmp ); 3.39 __ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words 3.40 } else { 3.41 @@ -1236,9 +1240,13 @@ 3.42 } 3.43 if (init_value != noreg) { 3.44 Label clear_loop; 3.45 + const Register RconstMethod = O1; 3.46 + const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset())); 3.47 + const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset())); 3.48 3.49 // NOTE: If you change the frame layout, this code will need to 3.50 // be updated! 3.51 + __ ld_ptr( constMethod, RconstMethod ); 3.52 __ lduh( size_of_locals, O2 ); 3.53 __ lduh( size_of_parameters, O1 ); 3.54 __ sll( O2, LogBytesPerWord, O2); 3.55 @@ -1483,13 +1491,16 @@ 3.56 // 3.57 // assert_different_registers(state, prev_state); 3.58 const Register Gtmp = G3_scratch; 3.59 + const RconstMethod = G3_scratch; 3.60 const Register tmp = O2; 3.61 - const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 3.62 - const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset())); 3.63 + const Address constMethod(G5_method, 0, in_bytes(Method::const_offset())); 3.64 + const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset())); 3.65 + const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset())); 3.66 3.67 + __ ld_ptr(constMethod, RconstMethod); 3.68 __ lduh(size_of_parameters, tmp); 3.69 - __ sll(tmp, LogBytesPerWord, Gtmp); // parameter size in bytes 3.70 - __ add(args, Gtmp, Gargs); // points to first local + BytesPerWord 3.71 + __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes 3.72 + __ add(args, Gargs, Gargs); // points to first local + BytesPerWord 3.73 // NEW 3.74 __ add(Gargs, -wordSize, Gargs); // points to first local[0] 3.75 // determine extra space for non-argument locals & adjust caller's SP 3.76 @@ -1541,8 +1552,6 @@ 3.77 3.78 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset())); 3.79 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset())); 3.80 - const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 3.81 - const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset())); 3.82 3.83 address entry_point = __ pc(); 3.84 __ mov(G0, prevState); // no current activation 3.85 @@ -1750,7 +1759,9 @@ 3.86 3.87 __ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method 3.88 __ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack 3.89 - __ lduh(L4_scratch, in_bytes(Method::size_of_parameters_offset()), L2_scratch); // get parameter size 3.90 + // get parameter size 3.91 + __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch); 3.92 + __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch); 3.93 __ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes 3.94 __ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result 3.95 __ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index
4.1 --- a/src/cpu/sparc/vm/methodHandles_sparc.cpp Thu Dec 13 09:06:38 2012 -0800 4.2 +++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp Fri Dec 14 11:45:55 2012 -0800 4.3 @@ -171,7 +171,8 @@ 4.4 4.5 if (VerifyMethodHandles && !for_compiler_entry) { 4.6 // make sure recv is already on stack 4.7 - __ load_sized_value(Address(method_temp, Method::size_of_parameters_offset()), 4.8 + __ ld_ptr(method_temp, in_bytes(Method::const_offset()), temp2); 4.9 + __ load_sized_value(Address(temp2, ConstMethod::size_of_parameters_offset()), 4.10 temp2, 4.11 sizeof(u2), /*is_signed*/ false); 4.12 // assert(sizeof(u2) == sizeof(Method::_size_of_parameters), ""); 4.13 @@ -233,7 +234,8 @@ 4.14 int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid); 4.15 assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic"); 4.16 if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) { 4.17 - __ load_sized_value(Address(G5_method, Method::size_of_parameters_offset()), 4.18 + __ ld_ptr(G5_method, in_bytes(Method::const_offset()), O4_param_size); 4.19 + __ load_sized_value(Address(O4_param_size, ConstMethod::size_of_parameters_offset()), 4.20 O4_param_size, 4.21 sizeof(u2), /*is_signed*/ false); 4.22 // assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
5.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Dec 13 09:06:38 2012 -0800 5.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Fri Dec 14 11:45:55 2012 -0800 5.3 @@ -494,9 +494,6 @@ 5.4 // (gri - 2/25/2000) 5.5 5.6 5.7 - const Address size_of_parameters(G5_method, Method::size_of_parameters_offset()); 5.8 - const Address size_of_locals (G5_method, Method::size_of_locals_offset()); 5.9 - const Address constMethod (G5_method, Method::const_offset()); 5.10 int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong ); 5.11 5.12 const int extra_space = 5.13 @@ -506,11 +503,15 @@ 5.14 (native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0); 5.15 5.16 const Register Glocals_size = G3; 5.17 + const Register RconstMethod = Glocals_size; 5.18 const Register Otmp1 = O3; 5.19 const Register Otmp2 = O4; 5.20 // Lscratch can't be used as a temporary because the call_stub uses 5.21 // it to assert that the stack frame was setup correctly. 5.22 + const Address constMethod (G5_method, Method::const_offset()); 5.23 + const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset()); 5.24 5.25 + __ ld_ptr( constMethod, RconstMethod ); 5.26 __ lduh( size_of_parameters, Glocals_size); 5.27 5.28 // Gargs points to first local + BytesPerWord 5.29 @@ -530,6 +531,8 @@ 5.30 // 5.31 // Compute number of locals in method apart from incoming parameters 5.32 // 5.33 + const Address size_of_locals (Otmp1, ConstMethod::size_of_locals_offset()); 5.34 + __ ld_ptr( constMethod, Otmp1 ); 5.35 __ lduh( size_of_locals, Otmp1 ); 5.36 __ sub( Otmp1, Glocals_size, Glocals_size ); 5.37 __ round_to( Glocals_size, WordsPerLong ); 5.38 @@ -1256,8 +1259,7 @@ 5.39 // make sure registers are different! 5.40 assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2); 5.41 5.42 - const Address size_of_parameters(G5_method, Method::size_of_parameters_offset()); 5.43 - const Address size_of_locals (G5_method, Method::size_of_locals_offset()); 5.44 + const Address constMethod (G5_method, Method::const_offset()); 5.45 // Seems like G5_method is live at the point this is used. So we could make this look consistent 5.46 // and use in the asserts. 5.47 const Address access_flags (Lmethod, Method::access_flags_offset()); 5.48 @@ -1307,8 +1309,13 @@ 5.49 init_value = G0; 5.50 Label clear_loop; 5.51 5.52 + const Register RconstMethod = O1; 5.53 + const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset()); 5.54 + const Address size_of_locals (RconstMethod, ConstMethod::size_of_locals_offset()); 5.55 + 5.56 // NOTE: If you change the frame layout, this code will need to 5.57 // be updated! 5.58 + __ ld_ptr( constMethod, RconstMethod ); 5.59 __ lduh( size_of_locals, O2 ); 5.60 __ lduh( size_of_parameters, O1 ); 5.61 __ sll( O2, Interpreter::logStackElementSize, O2); 5.62 @@ -1823,9 +1830,13 @@ 5.63 5.64 const Register Gtmp1 = G3_scratch; 5.65 const Register Gtmp2 = G1_scratch; 5.66 + const Register RconstMethod = Gtmp1; 5.67 + const Address constMethod(Lmethod, Method::const_offset()); 5.68 + const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset()); 5.69 5.70 // Compute size of arguments for saving when returning to deoptimized caller 5.71 - __ lduh(Lmethod, in_bytes(Method::size_of_parameters_offset()), Gtmp1); 5.72 + __ ld_ptr(constMethod, RconstMethod); 5.73 + __ lduh(size_of_parameters, Gtmp1); 5.74 __ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1); 5.75 __ sub(Llocals, Gtmp1, Gtmp2); 5.76 __ add(Gtmp2, wordSize, Gtmp2);
6.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Dec 13 09:06:38 2012 -0800 6.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp Fri Dec 14 11:45:55 2012 -0800 6.3 @@ -3040,7 +3040,8 @@ 6.4 Register Rtemp = G4_scratch; 6.5 6.6 // Load receiver from stack slot 6.7 - __ lduh(G5_method, in_bytes(Method::size_of_parameters_offset()), G4_scratch); 6.8 + __ ld_ptr(G5_method, in_bytes(Method::const_offset()), G4_scratch); 6.9 + __ lduh(G4_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), G4_scratch); 6.10 __ load_receiver(G4_scratch, O0); 6.11 6.12 // receiver NULL check
7.1 --- a/src/cpu/x86/vm/cppInterpreter_x86.cpp Thu Dec 13 09:06:38 2012 -0800 7.2 +++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp Fri Dec 14 11:45:55 2012 -0800 7.3 @@ -611,8 +611,6 @@ 7.4 // C++ interpreter only 7.5 // rsi/r13 - previous interpreter state pointer 7.6 7.7 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 7.8 - 7.9 // InterpreterRuntime::frequency_counter_overflow takes one argument 7.10 // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). 7.11 // The call returns the address of the verified entry point for the method or NULL 7.12 @@ -977,15 +975,16 @@ 7.13 // to save/restore. 7.14 address entry_point = __ pc(); 7.15 7.16 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 7.17 - const Address size_of_locals (rbx, Method::size_of_locals_offset()); 7.18 + const Address constMethod (rbx, Method::const_offset()); 7.19 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); 7.20 const Address access_flags (rbx, Method::access_flags_offset()); 7.21 + const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset()); 7.22 7.23 // rsi/r13 == state/locals rdi == prevstate 7.24 const Register locals = rdi; 7.25 7.26 // get parameter size (always needed) 7.27 + __ movptr(rcx, constMethod); 7.28 __ load_unsigned_short(rcx, size_of_parameters); 7.29 7.30 // rbx: Method* 7.31 @@ -994,6 +993,7 @@ 7.32 // for natives the size of locals is zero 7.33 7.34 // compute beginning of parameters /locals 7.35 + 7.36 __ lea(locals, Address(rsp, rcx, Address::times_ptr, -wordSize)); 7.37 7.38 // initialize fixed part of activation frame 7.39 @@ -1107,11 +1107,14 @@ 7.40 const Register method = rbx; 7.41 const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rdi); 7.42 const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1 7.43 + const Address constMethod (method, Method::const_offset()); 7.44 + const Address size_of_parameters(t, ConstMethod::size_of_parameters_offset()); 7.45 7.46 // allocate space for parameters 7.47 __ movptr(method, STATE(_method)); 7.48 __ verify_method_ptr(method); 7.49 - __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset())); 7.50 + __ movptr(t, constMethod); 7.51 + __ load_unsigned_short(t, size_of_parameters); 7.52 __ shll(t, 2); 7.53 #ifdef _LP64 7.54 __ subptr(rsp, t); 7.55 @@ -1700,15 +1703,17 @@ 7.56 // save sender sp 7.57 __ push(rcx); 7.58 7.59 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 7.60 - const Address size_of_locals (rbx, Method::size_of_locals_offset()); 7.61 + const Address constMethod (rbx, Method::const_offset()); 7.62 const Address access_flags (rbx, Method::access_flags_offset()); 7.63 + const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset()); 7.64 + const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset()); 7.65 7.66 // const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize); 7.67 // const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize); 7.68 // const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock)); 7.69 7.70 // get parameter size (always needed) 7.71 + __ movptr(rdx, constMethod); 7.72 __ load_unsigned_short(rcx, size_of_parameters); 7.73 7.74 // rbx: Method* 7.75 @@ -1989,7 +1994,9 @@ 7.76 __ movptr(rbx, STATE(_result._to_call._callee)); 7.77 7.78 // callee left args on top of expression stack, remove them 7.79 - __ load_unsigned_short(rcx, Address(rbx, Method::size_of_parameters_offset())); 7.80 + __ movptr(rcx, constMethod); 7.81 + __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); 7.82 + 7.83 __ lea(rsp, Address(rsp, rcx, Address::times_ptr)); 7.84 7.85 __ movl(rcx, Address(rbx, Method::result_index_offset())); 7.86 @@ -2159,7 +2166,9 @@ 7.87 // Make it look like call_stub calling conventions 7.88 7.89 // Get (potential) receiver 7.90 - __ load_unsigned_short(rcx, size_of_parameters); // get size of parameters in words 7.91 + // get size of parameters in words 7.92 + __ movptr(rcx, constMethod); 7.93 + __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); 7.94 7.95 ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)); 7.96 __ pushptr(recursive.addr()); // make it look good in the debugger
8.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp Thu Dec 13 09:06:38 2012 -0800 8.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp Fri Dec 14 11:45:55 2012 -0800 8.3 @@ -169,8 +169,9 @@ 8.4 8.5 if (VerifyMethodHandles && !for_compiler_entry) { 8.6 // make sure recv is already on stack 8.7 + __ movptr(temp2, Address(method_temp, Method::const_offset())); 8.8 __ load_sized_value(temp2, 8.9 - Address(method_temp, Method::size_of_parameters_offset()), 8.10 + Address(temp2, ConstMethod::size_of_parameters_offset()), 8.11 sizeof(u2), /*is_signed*/ false); 8.12 // assert(sizeof(u2) == sizeof(Method::_size_of_parameters), ""); 8.13 Label L; 8.14 @@ -234,8 +235,9 @@ 8.15 int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid); 8.16 assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic"); 8.17 if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) { 8.18 + __ movptr(rdx_argp, Address(rbx_method, Method::const_offset())); 8.19 __ load_sized_value(rdx_argp, 8.20 - Address(rbx_method, Method::size_of_parameters_offset()), 8.21 + Address(rdx_argp, ConstMethod::size_of_parameters_offset()), 8.22 sizeof(u2), /*is_signed*/ false); 8.23 // assert(sizeof(u2) == sizeof(Method::_size_of_parameters), ""); 8.24 rdx_first_arg_addr = __ argument_address(rdx_argp, -1);
9.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Thu Dec 13 09:06:38 2012 -0800 9.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Fri Dec 14 11:45:55 2012 -0800 9.3 @@ -424,8 +424,6 @@ 9.4 // C++ interpreter only 9.5 // rsi - previous interpreter state pointer 9.6 9.7 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 9.8 - 9.9 // InterpreterRuntime::frequency_counter_overflow takes one argument 9.10 // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). 9.11 // The call returns the address of the verified entry point for the method or NULL 9.12 @@ -868,12 +866,13 @@ 9.13 // rsi: previous interpreter state (C++ interpreter) must preserve 9.14 address entry_point = __ pc(); 9.15 9.16 - 9.17 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 9.18 + const Address constMethod (rbx, Method::const_offset()); 9.19 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); 9.20 const Address access_flags (rbx, Method::access_flags_offset()); 9.21 + const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset()); 9.22 9.23 // get parameter size (always needed) 9.24 + __ movptr(rcx, constMethod); 9.25 __ load_unsigned_short(rcx, size_of_parameters); 9.26 9.27 // native calls don't need the stack size check since they have no expression stack 9.28 @@ -988,7 +987,9 @@ 9.29 9.30 // allocate space for parameters 9.31 __ get_method(method); 9.32 - __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset())); 9.33 + __ movptr(t, Address(method, Method::const_offset())); 9.34 + __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset())); 9.35 + 9.36 __ shlptr(t, Interpreter::logStackElementSize); 9.37 __ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror 9.38 __ subptr(rsp, t); 9.39 @@ -1297,13 +1298,14 @@ 9.40 // rsi: sender sp 9.41 address entry_point = __ pc(); 9.42 9.43 - 9.44 - const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); 9.45 - const Address size_of_locals (rbx, Method::size_of_locals_offset()); 9.46 + const Address constMethod (rbx, Method::const_offset()); 9.47 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); 9.48 const Address access_flags (rbx, Method::access_flags_offset()); 9.49 + const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset()); 9.50 + const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset()); 9.51 9.52 // get parameter size (always needed) 9.53 + __ movptr(rdx, constMethod); 9.54 __ load_unsigned_short(rcx, size_of_parameters); 9.55 9.56 // rbx,: Method* 9.57 @@ -1734,7 +1736,8 @@ 9.58 9.59 // Compute size of arguments for saving when returning to deoptimized caller 9.60 __ get_method(rax); 9.61 - __ load_unsigned_short(rax, Address(rax, in_bytes(Method::size_of_parameters_offset()))); 9.62 + __ movptr(rax, Address(rax, Method::const_offset())); 9.63 + __ load_unsigned_short(rax, Address(rax, ConstMethod::size_of_parameters_offset())); 9.64 __ shlptr(rax, Interpreter::logStackElementSize); 9.65 __ restore_locals(); 9.66 __ subptr(rdi, rax);
10.1 --- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Thu Dec 13 09:06:38 2012 -0800 10.2 +++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Fri Dec 14 11:45:55 2012 -0800 10.3 @@ -369,9 +369,6 @@ 10.4 // Everything as it was on entry 10.5 // rdx is not restored. Doesn't appear to really be set. 10.6 10.7 - const Address size_of_parameters(rbx, 10.8 - Method::size_of_parameters_offset()); 10.9 - 10.10 // InterpreterRuntime::frequency_counter_overflow takes two 10.11 // arguments, the first (thread) is passed by call_VM, the second 10.12 // indicates if the counter overflow occurs at a backwards branch 10.13 @@ -844,14 +841,17 @@ 10.14 10.15 address entry_point = __ pc(); 10.16 10.17 - const Address size_of_parameters(rbx, Method:: 10.18 - size_of_parameters_offset()); 10.19 + const Address constMethod (rbx, Method::const_offset()); 10.20 const Address invocation_counter(rbx, Method:: 10.21 invocation_counter_offset() + 10.22 InvocationCounter::counter_offset()); 10.23 const Address access_flags (rbx, Method::access_flags_offset()); 10.24 + const Address size_of_parameters(rcx, ConstMethod:: 10.25 + size_of_parameters_offset()); 10.26 + 10.27 10.28 // get parameter size (always needed) 10.29 + __ movptr(rcx, constMethod); 10.30 __ load_unsigned_short(rcx, size_of_parameters); 10.31 10.32 // native calls don't need the stack size check since they have no 10.33 @@ -967,9 +967,8 @@ 10.34 10.35 // allocate space for parameters 10.36 __ get_method(method); 10.37 - __ load_unsigned_short(t, 10.38 - Address(method, 10.39 - Method::size_of_parameters_offset())); 10.40 + __ movptr(t, Address(method, Method::const_offset())); 10.41 + __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset())); 10.42 __ shll(t, Interpreter::logStackElementSize); 10.43 10.44 __ subptr(rsp, t); 10.45 @@ -1302,15 +1301,18 @@ 10.46 // r13: sender sp 10.47 address entry_point = __ pc(); 10.48 10.49 - const Address size_of_parameters(rbx, 10.50 - Method::size_of_parameters_offset()); 10.51 - const Address size_of_locals(rbx, Method::size_of_locals_offset()); 10.52 + const Address constMethod(rbx, Method::const_offset()); 10.53 const Address invocation_counter(rbx, 10.54 Method::invocation_counter_offset() + 10.55 InvocationCounter::counter_offset()); 10.56 const Address access_flags(rbx, Method::access_flags_offset()); 10.57 + const Address size_of_parameters(rdx, 10.58 + ConstMethod::size_of_parameters_offset()); 10.59 + const Address size_of_locals(rdx, ConstMethod::size_of_locals_offset()); 10.60 + 10.61 10.62 // get parameter size (always needed) 10.63 + __ movptr(rdx, constMethod); 10.64 __ load_unsigned_short(rcx, size_of_parameters); 10.65 10.66 // rbx: Method* 10.67 @@ -1752,7 +1754,8 @@ 10.68 // Compute size of arguments for saving when returning to 10.69 // deoptimized caller 10.70 __ get_method(rax); 10.71 - __ load_unsigned_short(rax, Address(rax, in_bytes(Method:: 10.72 + __ movptr(rax, Address(rax, Method::const_offset())); 10.73 + __ load_unsigned_short(rax, Address(rax, in_bytes(ConstMethod:: 10.74 size_of_parameters_offset()))); 10.75 __ shll(rax, Interpreter::logStackElementSize); 10.76 __ restore_locals(); // XXX do we need this?
11.1 --- a/src/share/vm/oops/constMethod.hpp Thu Dec 13 09:06:38 2012 -0800 11.2 +++ b/src/share/vm/oops/constMethod.hpp Fri Dec 14 11:45:55 2012 -0800 11.3 @@ -46,6 +46,7 @@ 11.4 // | interp_kind | flags | code_size | 11.5 // | name index | signature index | 11.6 // | method_idnum | max_stack | 11.7 +// | max_locals | size_of_parameters | 11.8 // |------------------------------------------------------| 11.9 // | | 11.10 // | byte codes | 11.11 @@ -150,7 +151,8 @@ 11.12 // initially corresponds to the index into the methods array. 11.13 // but this may change with redefinition 11.14 u2 _max_stack; // Maximum number of entries on the expression stack 11.15 - 11.16 + u2 _max_locals; // Number of local variables used by this method 11.17 + u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words 11.18 11.19 // Constructor 11.20 ConstMethod(int byte_code_size, 11.21 @@ -338,6 +340,11 @@ 11.22 11.23 static ByteSize max_stack_offset() 11.24 { return byte_offset_of(ConstMethod, _max_stack); } 11.25 + static ByteSize size_of_locals_offset() 11.26 + { return byte_offset_of(ConstMethod, _max_locals); } 11.27 + static ByteSize size_of_parameters_offset() 11.28 + { return byte_offset_of(ConstMethod, _size_of_parameters); } 11.29 + 11.30 11.31 // Unique id for the method 11.32 static const u2 MAX_IDNUM; 11.33 @@ -349,6 +356,14 @@ 11.34 int max_stack() const { return _max_stack; } 11.35 void set_max_stack(int size) { _max_stack = size; } 11.36 11.37 + // max locals 11.38 + int max_locals() const { return _max_locals; } 11.39 + void set_max_locals(int size) { _max_locals = size; } 11.40 + 11.41 + // size of parameters 11.42 + int size_of_parameters() const { return _size_of_parameters; } 11.43 + void set_size_of_parameters(int size) { _size_of_parameters = size; } 11.44 + 11.45 // Deallocation for RedefineClasses 11.46 void deallocate_contents(ClassLoaderData* loader_data); 11.47 bool is_klass() const { return false; }
12.1 --- a/src/share/vm/oops/method.hpp Thu Dec 13 09:06:38 2012 -0800 12.2 +++ b/src/share/vm/oops/method.hpp Fri Dec 14 11:45:55 2012 -0800 12.3 @@ -73,8 +73,7 @@ 12.4 // |------------------------------------------------------| 12.5 // | result_index (C++ interpreter only) | 12.6 // |------------------------------------------------------| 12.7 -// | method_size | max_locals | 12.8 -// | size_of_parameters | intrinsic_id| flags | 12.9 +// | method_size | intrinsic_id| flags | 12.10 // |------------------------------------------------------| 12.11 // | throwout_count | num_breakpoints | 12.12 // |------------------------------------------------------| 12.13 @@ -116,8 +115,6 @@ 12.14 int _result_index; // C++ interpreter needs for converting results to/from stack 12.15 #endif 12.16 u2 _method_size; // size of this object 12.17 - u2 _max_locals; // Number of local variables used by this method 12.18 - u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words 12.19 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) 12.20 u1 _jfr_towrite : 1, // Flags 12.21 _force_inline : 1, 12.22 @@ -292,8 +289,8 @@ 12.23 void set_max_stack(int size) { constMethod()->set_max_stack(size); } 12.24 12.25 // max locals 12.26 - int max_locals() const { return _max_locals; } 12.27 - void set_max_locals(int size) { _max_locals = size; } 12.28 + int max_locals() const { return constMethod()->max_locals(); } 12.29 + void set_max_locals(int size) { constMethod()->set_max_locals(size); } 12.30 12.31 int highest_comp_level() const; 12.32 void set_highest_comp_level(int level); 12.33 @@ -311,7 +308,8 @@ 12.34 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; } 12.35 12.36 // size of parameters 12.37 - int size_of_parameters() const { return _size_of_parameters; } 12.38 + int size_of_parameters() const { return constMethod()->size_of_parameters(); } 12.39 + void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); } 12.40 12.41 bool has_stackmap_table() const { 12.42 return constMethod()->has_stackmap_table(); 12.43 @@ -588,8 +586,6 @@ 12.44 #ifdef CC_INTERP 12.45 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); } 12.46 #endif /* CC_INTERP */ 12.47 - static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); } 12.48 - static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); } 12.49 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } 12.50 static ByteSize code_offset() { return byte_offset_of(Method, _code); } 12.51 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); } 12.52 @@ -796,9 +792,6 @@ 12.53 Array<AnnotationArray*>* methods_default_annotations, 12.54 bool idempotent = false); 12.55 12.56 - // size of parameters 12.57 - void set_size_of_parameters(int size) { _size_of_parameters = size; } 12.58 - 12.59 // Deallocation function for redefine classes or if an error occurs 12.60 void deallocate_contents(ClassLoaderData* loader_data); 12.61
13.1 --- a/src/share/vm/runtime/vmStructs.cpp Thu Dec 13 09:06:38 2012 -0800 13.2 +++ b/src/share/vm/runtime/vmStructs.cpp Fri Dec 14 11:45:55 2012 -0800 13.3 @@ -355,8 +355,6 @@ 13.4 nonstatic_field(Method, _access_flags, AccessFlags) \ 13.5 nonstatic_field(Method, _vtable_index, int) \ 13.6 nonstatic_field(Method, _method_size, u2) \ 13.7 - nonstatic_field(Method, _max_locals, u2) \ 13.8 - nonstatic_field(Method, _size_of_parameters, u2) \ 13.9 nonstatic_field(Method, _interpreter_throwout_count, u2) \ 13.10 nonstatic_field(Method, _number_of_breakpoints, u2) \ 13.11 nonstatic_field(Method, _invocation_counter, InvocationCounter) \ 13.12 @@ -378,6 +376,8 @@ 13.13 nonstatic_field(ConstMethod, _signature_index, u2) \ 13.14 nonstatic_field(ConstMethod, _method_idnum, u2) \ 13.15 nonstatic_field(ConstMethod, _max_stack, u2) \ 13.16 + nonstatic_field(ConstMethod, _max_locals, u2) \ 13.17 + nonstatic_field(ConstMethod, _size_of_parameters, u2) \ 13.18 nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \ 13.19 nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \ 13.20 volatile_nonstatic_field(Symbol, _refcount, int) \