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 6 11:59:49 2014
--- new/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Thu Mar 6 11:59:48 2014
*** 22,31 ****
--- 22,32 ----
*
*/
#include "precompiled.hpp"
#include "asm/assembler.hpp"
+ #include "ci/ciMethod.hpp"
#include "interpreter/bytecodeHistogram.hpp"
#include "interpreter/cppInterpreter.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterGenerator.hpp"
#include "interpreter/interpreterRuntime.hpp"
*** 2058,2068 ****
--- 2059,2069 ----
: CppInterpreterGenerator(code) {
generate_all(); // down here so it can be "virtual"
}
! 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.
*** 2096,2106 ****
--- 2097,2107 ----
// 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;
}
void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
frame* caller,
*** 2181,2235 ****
--- 2182,2277 ----
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;
}
+ template<class M> static int frame_size_helper(M* method,
+ 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<M>(extra_locals_size, method->max_stack(), monitor_size);
+ int short_frame_words = size_activation_helper<M>(extra_locals_size, method->max_stack(), monitor_size);
+ int frame_words = is_top_frame ? full_frame_words : short_frame_words;
+
+ return frame_words;
+ }
+
+ template<class M> int AbstractInterpreter::size_activation(M* method,
+ 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 unused_monitor_size = 0;
+ int unused_full_frame_words = 0;
+ return frame_size_helper(method, moncount, callee_param_size, callee_locals_size, is_top_frame,
+ unused_monitor_size, unused_full_frame_words);
+ }
+
+ 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);
! int AbstractInterpreter::layout_activation(Method* method,
! 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>(method, 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 ****
--- 2334,2341 ----
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