Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/cppInterpreter_sparc.cpp @ 10393:603ca7e51354
8010460: Interpreter on some platforms loads ConstMethod::_max_stack and misses extra stack slots for JSR 292
Summary: ConstMethod::max_stack() doesn't account for JSR 292 appendix.
Reviewed-by: kvn
author | roland |
---|---|
date | Wed, 24 Apr 2013 11:49:38 +0200 |
parents | aeaca88565e6 |
children | bd3237e0e18d |
comparison
equal
deleted
inserted
replaced
10392:c07dd9be16e8 | 10393:603ca7e51354 |
---|---|
1063 // that returns a result. | 1063 // that returns a result. |
1064 | 1064 |
1065 const int slop_factor = 2*wordSize; | 1065 const int slop_factor = 2*wordSize; |
1066 | 1066 |
1067 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? | 1067 const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? |
1068 //6815692//Method::extra_stack_words() + // extra push slots for MH adapters | 1068 Method::extra_stack_entries() + // extra stack for jsr 292 |
1069 frame::memory_parameter_word_sp_offset + // register save area + param window | 1069 frame::memory_parameter_word_sp_offset + // register save area + param window |
1070 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class | 1070 (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class |
1071 | 1071 |
1072 // XXX G5_method valid | 1072 // XXX G5_method valid |
1073 | 1073 |
1219 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH | 1219 __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH |
1220 | 1220 |
1221 // Full size expression stack | 1221 // Full size expression stack |
1222 __ ld_ptr(constMethod, O3); | 1222 __ ld_ptr(constMethod, O3); |
1223 __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); | 1223 __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); |
1224 guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692 | 1224 __ inc(O3, Method::extra_stack_entries()); |
1225 //6815692//if (EnableInvokeDynamic) | |
1226 //6815692// __ inc(O3, Method::extra_stack_entries()); | |
1227 __ sll(O3, LogBytesPerWord, O3); | 1225 __ sll(O3, LogBytesPerWord, O3); |
1228 __ sub(O2, O3, O3); | 1226 __ sub(O2, O3, O3); |
1229 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds | 1227 // __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds |
1230 __ st_ptr(O3, XXX_STATE(_stack_limit)); | 1228 __ st_ptr(O3, XXX_STATE(_stack_limit)); |
1231 | 1229 |
2082 // is "slop_factor" here. | 2080 // is "slop_factor" here. |
2083 const int slop_factor = 2; | 2081 const int slop_factor = 2; |
2084 | 2082 |
2085 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object | 2083 const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object |
2086 frame::memory_parameter_word_sp_offset; // register save area + param window | 2084 frame::memory_parameter_word_sp_offset; // register save area + param window |
2087 const int extra_stack = 0; //6815692//Method::extra_stack_entries(); | |
2088 return (round_to(max_stack + | 2085 return (round_to(max_stack + |
2089 extra_stack + | |
2090 slop_factor + | 2086 slop_factor + |
2091 fixed_size + | 2087 fixed_size + |
2092 monitor_size + | 2088 monitor_size + |
2093 (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); | 2089 (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); |
2094 | 2090 |
2171 to_fill->_oop_temp = NULL; | 2167 to_fill->_oop_temp = NULL; |
2172 to_fill->_stack_base = stack_base; | 2168 to_fill->_stack_base = stack_base; |
2173 // Need +1 here because stack_base points to the word just above the first expr stack entry | 2169 // Need +1 here because stack_base points to the word just above the first expr stack entry |
2174 // and stack_limit is supposed to point to the word just below the last expr stack entry. | 2170 // and stack_limit is supposed to point to the word just below the last expr stack entry. |
2175 // See generate_compute_interpreter_state. | 2171 // See generate_compute_interpreter_state. |
2176 int extra_stack = 0; //6815692//Method::extra_stack_entries(); | 2172 to_fill->_stack_limit = stack_base - (method->max_stack() + 1); |
2177 to_fill->_stack_limit = stack_base - (method->max_stack() + 1 + extra_stack); | |
2178 to_fill->_monitor_base = (BasicObjectLock*) monitor_base; | 2173 to_fill->_monitor_base = (BasicObjectLock*) monitor_base; |
2179 | 2174 |
2180 // sparc specific | 2175 // sparc specific |
2181 to_fill->_frame_bottom = frame_bottom; | 2176 to_fill->_frame_bottom = frame_bottom; |
2182 to_fill->_self_link = to_fill; | 2177 to_fill->_self_link = to_fill; |