src/cpu/x86/vm/cppInterpreter_x86.cpp

Print this page
rev 4376 : 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:

*** 537,552 **** __ subptr(rsp, wordSize); // pre-push stack __ movptr(STATE(_stack), rsp); // set current expression stack tos // compute full expression stack limit - const int extra_stack = 0; //6815692//Method::extra_stack_words(); __ movptr(rdx, Address(rbx, Method::const_offset())); __ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words __ negptr(rdx); // so we can subtract in next step // Allocate expression stack ! __ lea(rsp, Address(rsp, rdx, Address::times_ptr, -extra_stack)); __ movptr(STATE(_stack_limit), rsp); } #ifdef _LP64 // Make sure stack is properly aligned and sized for the abi --- 537,551 ---- __ subptr(rsp, wordSize); // pre-push stack __ movptr(STATE(_stack), rsp); // set current expression stack tos // compute full expression stack limit __ movptr(rdx, Address(rbx, Method::const_offset())); __ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words __ negptr(rdx); // so we can subtract in next step // Allocate expression stack ! __ lea(rsp, Address(rsp, rdx, Address::times_ptr)); __ movptr(STATE(_stack_limit), rsp); } #ifdef _LP64 // Make sure stack is properly aligned and sized for the abi
*** 682,695 **** // locals + overhead, in bytes // Always give one monitor to allow us to start interp if sync method. // Any additional monitors need a check when moving the expression stack const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize; - const int extra_stack = 0; //6815692//Method::extra_stack_entries(); __ movptr(rax, Address(rbx, Method::const_offset())); __ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words ! __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), extra_stack + one_monitor)); __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); #ifdef ASSERT Label stack_base_okay, stack_size_okay; // verify that thread stack base is non-zero --- 681,693 ---- // locals + overhead, in bytes // Always give one monitor to allow us to start interp if sync method. // Any additional monitors need a check when moving the expression stack const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize; __ movptr(rax, Address(rbx, Method::const_offset())); __ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words ! __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor)); __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); #ifdef ASSERT Label stack_base_okay, stack_size_okay; // verify that thread stack base is non-zero
*** 2275,2286 **** // address, saved rbp and 2 words for a "static long no_params() method" issue. const int overhead_size = sizeof(BytecodeInterpreter)/wordSize + ( frame::sender_sp_offset - frame::link_offset) + 2; ! const int extra_stack = 0; //6815692//Method::extra_stack_entries(); ! const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) * Interpreter::stackElementWords; return overhead_size + method_stack + stub_code; } // returns the activation size. --- 2273,2283 ---- // address, saved rbp and 2 words for a "static long no_params() method" issue. const int overhead_size = sizeof(BytecodeInterpreter)/wordSize + ( frame::sender_sp_offset - frame::link_offset) + 2; ! const int method_stack = (method->max_locals() + method->max_stack()) * Interpreter::stackElementWords; return overhead_size + method_stack + stub_code; } // returns the activation size.
*** 2341,2352 **** to_fill->_oop_temp = NULL; to_fill->_stack_base = stack_base; // Need +1 here because stack_base points to the word just above the first expr stack entry // and stack_limit is supposed to point to the word just below the last expr stack entry. // See generate_compute_interpreter_state. ! int extra_stack = 0; //6815692//Method::extra_stack_entries(); ! to_fill->_stack_limit = stack_base - (method->max_stack() + extra_stack + 1); to_fill->_monitor_base = (BasicObjectLock*) monitor_base; to_fill->_self_link = to_fill; assert(stack >= to_fill->_stack_limit && stack < to_fill->_stack_base, "Stack top out of range"); --- 2338,2348 ---- to_fill->_oop_temp = NULL; to_fill->_stack_base = stack_base; // Need +1 here because stack_base points to the word just above the first expr stack entry // and stack_limit is supposed to point to the word just below the last expr stack entry. // See generate_compute_interpreter_state. ! to_fill->_stack_limit = stack_base - (method->max_stack() + 1); to_fill->_monitor_base = (BasicObjectLock*) monitor_base; to_fill->_self_link = to_fill; assert(stack >= to_fill->_stack_limit && stack < to_fill->_stack_base, "Stack top out of range");
*** 2390,2401 **** // First calculate the frame size without any java expression stack int short_frame_size = size_activation_helper(extra_locals_size, monitor_size); // Now with full size expression stack ! int extra_stack = 0; //6815692//Method::extra_stack_entries(); ! int full_frame_size = short_frame_size + (method->max_stack() + extra_stack) * BytesPerWord; // and now with only live portion of the expression stack short_frame_size = short_frame_size + tempcount * BytesPerWord; // the size the activation is right now. Only top frame is full size --- 2386,2396 ---- // First calculate the frame size without any java expression stack int short_frame_size = size_activation_helper(extra_locals_size, monitor_size); // Now with full size expression stack ! int full_frame_size = short_frame_size + method->max_stack() * BytesPerWord; // and now with only live portion of the expression stack short_frame_size = short_frame_size + tempcount * BytesPerWord; // the size the activation is right now. Only top frame is full size