1.1 --- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Mon May 02 10:51:36 2011 -0700 1.2 +++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Mon May 02 18:53:37 2011 -0700 1.3 @@ -1698,35 +1698,21 @@ 1.4 popframe_extra_args; 1.5 1.6 int local_words = method->max_locals() * Interpreter::stackElementWords; 1.7 - int parm_words = method->size_of_parameters() * Interpreter::stackElementWords; 1.8 - NEEDS_CLEANUP; 1.9 intptr_t* locals; 1.10 - if (caller->is_interpreted_frame()) { 1.11 - // Can force the locals area to end up properly overlapping the top of the expression stack. 1.12 - intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1; 1.13 - // Note that this computation means we replace size_of_parameters() values from the caller 1.14 - // interpreter frame's expression stack with our argument locals 1.15 - locals = Lesp_ptr + parm_words; 1.16 - int delta = local_words - parm_words; 1.17 - int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0; 1.18 - *interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS; 1.19 + if (caller->is_compiled_frame()) { 1.20 + // Compiled frames do not allocate a varargs area so place them 1.21 + // next to the register save area. 1.22 + locals = fp + frame::register_save_words + local_words - 1; 1.23 + // Caller wants his own SP back 1.24 + int caller_frame_size = caller->cb()->frame_size(); 1.25 + *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS; 1.26 } else { 1.27 - assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases"); 1.28 - // Don't have Lesp available; lay out locals block in the caller 1.29 - // adjacent to the register window save area. 1.30 - // 1.31 - // Compiled frames do not allocate a varargs area which is why this if 1.32 - // statement is needed. 1.33 - // 1.34 - if (caller->is_compiled_frame()) { 1.35 - locals = fp + frame::register_save_words + local_words - 1; 1.36 - } else { 1.37 - locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1; 1.38 - } 1.39 - if (!caller->is_entry_frame()) { 1.40 - // Caller wants his own SP back 1.41 - int caller_frame_size = caller->cb()->frame_size(); 1.42 - *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS; 1.43 + assert(caller->is_interpreted_frame() || caller->is_entry_frame(), "only possible cases"); 1.44 + // The entry and interpreter frames are laid out like normal C 1.45 + // frames so place the locals adjacent to the varargs area. 1.46 + locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1; 1.47 + if (caller->is_interpreted_frame()) { 1.48 + *interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + rounded_cls) - STACK_BIAS; 1.49 } 1.50 } 1.51 if (TraceDeoptimization) {