src/cpu/sparc/vm/cppInterpreter_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Thu Mar 20 11:28:53 2014
--- new/src/cpu/sparc/vm/cppInterpreter_sparc.cpp	Thu Mar 20 11:28:52 2014

*** 2181,2235 **** --- 2181,2259 ---- void BytecodeInterpreter::pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp) { istate->_last_Java_pc = (intptr_t*) last_Java_pc; } + static int frame_size_helper(int max_stack, + int moncount, + int callee_param_size, + int callee_locals_size, + bool is_top_frame, + int& monitor_size, + int& full_frame_words) { + int extra_locals_size = callee_locals_size - callee_param_size; + monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize; + full_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); + int short_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); + int frame_words = is_top_frame ? full_frame_words : short_frame_words; + + return frame_words; + } + + int AbstractInterpreter::size_activation(int max_stack, + int tempcount, + int popframe_extra_args, + int moncount, + int callee_param_size, + int callee_locals_size, + bool is_top_frame) { + assert(popframe_extra_args == 0, "NEED TO FIX"); + // NOTE: return size is in words not bytes + // Calculate the amount our frame will be adjust by the callee. For top frame + // this is zero. + + // NOTE: ia64 seems to do this wrong (or at least backwards) in that it + // calculates the extra locals based on itself. Not what the callee does + // to it. So it ignores last_frame_adjust value. Seems suspicious as far + // as getting sender_sp correct. int AbstractInterpreter::layout_activation(Method* method, + int unused_monitor_size = 0; + int unused_full_frame_words = 0; + return frame_size_helper(max_stack, moncount, callee_param_size, callee_locals_size, is_top_frame, + unused_monitor_size, unused_full_frame_words); + } + void AbstractInterpreter::layout_activation(Method* method, int tempcount, // Number of slots on java expression stack in use int popframe_extra_args, int moncount, // Number of active monitors int caller_actual_parameters, int callee_param_size, int callee_locals_size, frame* caller, frame* interpreter_frame, bool is_top_frame, bool is_bottom_frame) { assert(popframe_extra_args == 0, "NEED TO FIX"); // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state() // does as far as allocating an interpreter frame. ! // If interpreter_frame!=NULL, set up the method, locals, and monitors. - // The frame interpreter_frame, if not NULL, is guaranteed to be the right size, ! // as determined by a previous call to this method. ! // Set up the method, locals, and monitors. ! // The frame interpreter_frame is guaranteed to be the right size, ! // as determined by a previous call to the size_activation() method. // It is also guaranteed to be walkable even though it is in a skeletal state // NOTE: return size is in words not bytes // NOTE: tempcount is the current size of the java expression stack. For top most // frames we will allocate a full sized expression stack and not the curback // version that non-top frames have. // Calculate the amount our frame will be adjust by the callee. For top frame // this is zero. // NOTE: ia64 seems to do this wrong (or at least backwards) in that it // calculates the extra locals based on itself. Not what the callee does // to it. So it ignores last_frame_adjust value. Seems suspicious as far // as getting sender_sp correct. int extra_locals_size = callee_locals_size - callee_param_size; int monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize; int full_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size); int short_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size); int frame_words = is_top_frame ? full_frame_words : short_frame_words; + int monitor_size = 0; + int full_frame_words = 0; + int frame_words = frame_size_helper(method->max_stack(), moncount, callee_param_size, callee_locals_size, + is_top_frame, monitor_size, full_frame_words); /* ! if we actually have a frame to layout we must now fill in all the pieces. This means both ! We must now fill in all the pieces of the frame. This means both the interpreterState and the registers. */ if (interpreter_frame != NULL) { // MUCHO HACK intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words); // 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode.
*** 2292,2302 **** --- 2316,2323 ---- monitor_base, frame_bottom, is_top_frame); BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp()); } return frame_words; } #endif // CC_INTERP

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