1695
1696 // preallocate stack space
1697 intptr_t* esp = monitors - 1 -
1698 (tempcount * Interpreter::stackElementWords) -
1699 popframe_extra_args;
1700
1701 int local_words = method->max_locals() * Interpreter::stackElementWords;
1702 NEEDS_CLEANUP;
1703 intptr_t* locals;
1704 if (caller->is_interpreted_frame()) {
1705 // Can force the locals area to end up properly overlapping the top of the expression stack.
1706 intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
1707 // Note that this computation means we replace size_of_parameters() values from the caller
1708 // interpreter frame's expression stack with our argument locals
1709 int parm_words = caller_actual_parameters * Interpreter::stackElementWords;
1710 locals = Lesp_ptr + parm_words;
1711 int delta = local_words - parm_words;
1712 int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
1713 *interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
1714 } else {
1715 assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
1716 // Don't have Lesp available; lay out locals block in the caller
1717 // adjacent to the register window save area.
1718 //
1719 // Compiled frames do not allocate a varargs area which is why this if
1720 // statement is needed.
1721 //
1722 if (caller->is_compiled_frame()) {
1723 locals = fp + frame::register_save_words + local_words - 1;
1724 } else {
1725 locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
1726 }
1727 if (!caller->is_entry_frame()) {
1728 // Caller wants his own SP back
1729 int caller_frame_size = caller->cb()->frame_size();
1730 *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
1731 }
1732 }
1733 if (TraceDeoptimization) {
1734 if (caller->is_entry_frame()) {
1735 // make sure I5_savedSP and the entry frames notion of saved SP
|
1695
1696 // preallocate stack space
1697 intptr_t* esp = monitors - 1 -
1698 (tempcount * Interpreter::stackElementWords) -
1699 popframe_extra_args;
1700
1701 int local_words = method->max_locals() * Interpreter::stackElementWords;
1702 NEEDS_CLEANUP;
1703 intptr_t* locals;
1704 if (caller->is_interpreted_frame()) {
1705 // Can force the locals area to end up properly overlapping the top of the expression stack.
1706 intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
1707 // Note that this computation means we replace size_of_parameters() values from the caller
1708 // interpreter frame's expression stack with our argument locals
1709 int parm_words = caller_actual_parameters * Interpreter::stackElementWords;
1710 locals = Lesp_ptr + parm_words;
1711 int delta = local_words - parm_words;
1712 int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
1713 *interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
1714 } else {
1715 assert(caller->is_compiled_frame() || caller->is_entry_frame() || caller->is_ricochet_frame(), "only possible cases");
1716 // Don't have Lesp available; lay out locals block in the caller
1717 // adjacent to the register window save area.
1718 //
1719 // Compiled frames do not allocate a varargs area which is why this if
1720 // statement is needed.
1721 //
1722 if (caller->is_compiled_frame()) {
1723 locals = fp + frame::register_save_words + local_words - 1;
1724 } else {
1725 locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
1726 }
1727 if (!caller->is_entry_frame()) {
1728 // Caller wants his own SP back
1729 int caller_frame_size = caller->cb()->frame_size();
1730 *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
1731 }
1732 }
1733 if (TraceDeoptimization) {
1734 if (caller->is_entry_frame()) {
1735 // make sure I5_savedSP and the entry frames notion of saved SP
|