src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Thu Mar  6 11:59:49 2014
--- new/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Thu Mar  6 11:59:48 2014

*** 22,31 **** --- 22,32 ---- * */ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" + #include "ci/ciMethod.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateTable.hpp"
*** 1524,1534 **** --- 1525,1535 ---- // : arguments : // | | <--- Llocals // +---------------+ <--- Gargs // | | ! template<class M> static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) { // Figure out the size of an interpreter frame (in words) given that we have a fully allocated // expression stack, the callee will have callee_extra_locals (so we can account for // frame extension) and monitor_size for monitors. Basically we need to calculate // this exactly like generate_fixed_frame/generate_compute_interpreter_state.
*** 1561,1602 **** --- 1562,1589 ---- // Save space for one monitor to get into the interpreted method in case // the method is synchronized int monitor_size = method->is_synchronized() ? 1*frame::interpreter_frame_monitor_size() : 0; ! return size_activation_helper<Method>(method->max_locals(), method->max_stack(), monitor_size) + call_stub_size; } ! int AbstractInterpreter::layout_activation(Method* method, ! int tempcount, ! int popframe_extra_args, ! int moncount, ! int caller_actual_parameters, ! int callee_param_count, int callee_local_count, frame* caller, frame* interpreter_frame, bool is_top_frame, bool is_bottom_frame) { ! template<class M> int AbstractInterpreter::size_activation(M* method, ! int temps, ! int popframe_args, ! int monitors, ! int callee_params, ! int callee_locals, + bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup // in InterpreterGenerator::generate_fixed_frame. // If f!=NULL, set up the following variables: // - Lmethod // - Llocals // - Lmonitors (to the indicated number of monitors) // - Lesp (to the indicated number of temps) // The frame f (if not NULL) on entry is a description of the caller of the frame // we are about to layout. We are guaranteed that we will be able to fill in a // new interpreter frame as its callee (i.e. the stack space is allocated and // the amount was determined by an earlier call to this method with f == NULL). // On return f (if not NULL) while describe the interpreter frame we just layed out. ! int monitor_size = moncount * frame::interpreter_frame_monitor_size(); int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong); ! int monitor_size = monitors * frame::interpreter_frame_monitor_size(); assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align"); + // // Note: if you look closely this appears to be doing something much different // than generate_fixed_frame. What is happening is this. On sparc we have to do // this dance with interpreter_sp_adjustment because the window save area would // appear just below the bottom (tos) of the caller's java expression stack. Because
*** 1617,1637 **** --- 1604,1669 ---- // this code aware of what the interactions are when that initial caller fram was an osr or // other adapter frame. deoptimization is complicated enough and hard enough to debug that // there is no sense in messing working code. // ! int rounded_cls = round_to((callee_local_count - callee_param_count), WordsPerLong); ! int rounded_cls = round_to((callee_locals - callee_params), WordsPerLong); assert(rounded_cls == round_to(rounded_cls, WordsPerLong), "must align"); ! int raw_frame_size = size_activation_helper<M>(rounded_cls, method->max_stack(), monitor_size); if (interpreter_frame != NULL) { + return raw_frame_size; + } + + template int AbstractInterpreter::size_activation<Method>(Method* method, + int temps, + int popframe_args, + int monitors, + int callee_params, + int callee_locals, + bool is_top_frame); + + template int AbstractInterpreter::size_activation<ciMethod>(ciMethod* method, + int temps, + int popframe_args, + int monitors, + int callee_params, + int callee_locals, + bool is_top_frame); + + void AbstractInterpreter::layout_activation(Method* method, + int tempcount, + int popframe_extra_args, + int moncount, + int caller_actual_parameters, + int callee_param_count, + int callee_local_count, + frame* caller, + frame* interpreter_frame, + bool is_top_frame, + bool is_bottom_frame) { + // Set up the following variables: + // - Lmethod + // - Llocals + // - Lmonitors (to the indicated number of monitors) + // - Lesp (to the indicated number of temps) + // The frame caller on entry is a description of the caller of the + // frame we are about to layout. We are guaranteed that we will be + // able to fill in a new interpreter frame as its callee (i.e. the + // stack space is allocated and the amount was determined by an + // earlier call to the size_activation() method). On return caller + // while describe the interpreter frame we just layed out. + // The skeleton frame must already look like an interpreter frame // even if not fully filled out. assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame"); + int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong); + int monitor_size = moncount * frame::interpreter_frame_monitor_size(); + assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align"); + intptr_t* fp = interpreter_frame->fp(); JavaThread* thread = JavaThread::current(); RegisterMap map(thread, false); // More verification that skeleton frame is properly walkable
*** 1754,1766 **** --- 1786,1795 ---- intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1); intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words; assert(lo < monitors && montop <= hi, "monitors in bounds"); assert(lo <= esp && esp < monitors, "esp in bounds"); #endif // ASSERT } return raw_frame_size; } //---------------------------------------------------------------------------------------------------- // Exceptions void TemplateInterpreterGenerator::generate_throw_exception() {

src/cpu/sparc/vm/templateInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File