comparison src/cpu/sparc/vm/cppInterpreter_sparc.cpp @ 7183:b2dbd323c668

8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Summary: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Reviewed-by: bdelsart, sspitsyn, coleenp
author jiangli
date Tue, 27 Nov 2012 17:03:56 -0500
parents da91efe96a93
children fd74228fd5ca
comparison
equal deleted inserted replaced
7165:e1d42ba865de 7183:b2dbd323c668
1046 assert_different_registers(prev_state, G3_scratch); 1046 assert_different_registers(prev_state, G3_scratch);
1047 const Register Gtmp = G3_scratch; 1047 const Register Gtmp = G3_scratch;
1048 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset())); 1048 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
1049 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset())); 1049 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
1050 const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 1050 const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
1051 const Address max_stack (G5_method, 0, in_bytes(Method::max_stack_offset()));
1052 const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset())); 1051 const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
1053 1052
1054 // slop factor is two extra slots on the expression stack so that 1053 // slop factor is two extra slots on the expression stack so that
1055 // we always have room to store a result when returning from a call without parameters 1054 // we always have room to store a result when returning from a call without parameters
1056 // that returns a result. 1055 // that returns a result.
1068 1067
1069 if (native) { 1068 if (native) {
1070 __ lduh( size_of_parameters, Gtmp ); 1069 __ lduh( size_of_parameters, Gtmp );
1071 __ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words 1070 __ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
1072 } else { 1071 } else {
1073 __ lduh(max_stack, Gtmp); // Full size expression stack 1072 // Full size expression stack
1073 __ ld_ptr(constMethod, Gtmp);
1074 __ lduh(Gtmp, in_bytes(ConstMethod::max_stack_offset()), Gtmp);
1074 } 1075 }
1075 __ add(Gtmp, fixed_size, Gtmp); // plus the fixed portion 1076 __ add(Gtmp, fixed_size, Gtmp); // plus the fixed portion
1076 1077
1077 __ neg(Gtmp); // negative space for stack/parameters in words 1078 __ neg(Gtmp); // negative space for stack/parameters in words
1078 __ and3(Gtmp, -WordsPerLong, Gtmp); // make multiple of 2 (SP must be 2-word aligned) 1079 __ and3(Gtmp, -WordsPerLong, Gtmp); // make multiple of 2 (SP must be 2-word aligned)
1204 __ st_ptr(O2, XXX_STATE(_stack_base)); 1205 __ st_ptr(O2, XXX_STATE(_stack_base));
1205 1206
1206 __ sub(O2, wordSize, O2); // prepush 1207 __ sub(O2, wordSize, O2); // prepush
1207 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH 1208 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH
1208 1209
1209 __ lduh(max_stack, O3); // Full size expression stack 1210 // Full size expression stack
1211 __ ld_ptr(constMethod, O3);
1212 __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3);
1210 guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692 1213 guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692
1211 //6815692//if (EnableInvokeDynamic) 1214 //6815692//if (EnableInvokeDynamic)
1212 //6815692// __ inc(O3, Method::extra_stack_entries()); 1215 //6815692// __ inc(O3, Method::extra_stack_entries());
1213 __ sll(O3, LogBytesPerWord, O3); 1216 __ sll(O3, LogBytesPerWord, O3);
1214 __ sub(O2, O3, O3); 1217 __ sub(O2, O3, O3);
1537 // const Register Lmirror = L1; // native mirror (native calls only) 1540 // const Register Lmirror = L1; // native mirror (native calls only)
1538 1541
1539 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset())); 1542 const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
1540 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset())); 1543 const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
1541 const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset())); 1544 const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
1542 const Address max_stack (G5_method, 0, in_bytes(Method::max_stack_offset()));
1543 const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset())); 1545 const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
1544 1546
1545 address entry_point = __ pc(); 1547 address entry_point = __ pc();
1546 __ mov(G0, prevState); // no current activation 1548 __ mov(G0, prevState); // no current activation
1547 1549