src/share/vm/runtime/deoptimization.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
7090904 Cdiff src/share/vm/runtime/deoptimization.cpp
src/share/vm/runtime/deoptimization.cpp
Print this page
*** 360,371 ****
// Compute the vframes' sizes. Note that frame_sizes[] entries are ordered from outermost to innermost
// virtual activation, which is the reverse of the elements in the vframes array.
intptr_t* frame_sizes = NEW_C_HEAP_ARRAY(intptr_t, number_of_frames);
// +1 because we always have an interpreter return address for the final slot.
address* frame_pcs = NEW_C_HEAP_ARRAY(address, number_of_frames + 1);
- int callee_parameters = 0;
- int callee_locals = 0;
int popframe_extra_args = 0;
// Create an interpreter return address for the stub to use as its return
// address so the skeletal frames are perfectly walkable
frame_pcs[number_of_frames] = Interpreter::deopt_entry(vtos, 0);
--- 360,369 ----
*** 385,402 ****
// It's possible that the number of paramters at the call site is
// different than number of arguments in the callee when method
// handles are used. If the caller is interpreted get the real
// value so that the proper amount of space can be added to it's
// frame.
! int caller_actual_parameters = callee_parameters;
if (deopt_sender.is_interpreted_frame()) {
methodHandle method = deopt_sender.interpreter_frame_method();
Bytecode_invoke cur = Bytecode_invoke_check(method,
deopt_sender.interpreter_frame_bci());
! Symbol* signature = method->constants()->signature_ref_at(cur.index());
! ArgumentSizeComputer asc(signature);
! caller_actual_parameters = asc.size() + (cur.has_receiver() ? 1 : 0);
}
//
// frame_sizes/frame_pcs[0] oldest frame (int or c2i)
// frame_sizes/frame_pcs[1] next oldest frame (int)
--- 383,406 ----
// It's possible that the number of paramters at the call site is
// different than number of arguments in the callee when method
// handles are used. If the caller is interpreted get the real
// value so that the proper amount of space can be added to it's
// frame.
! bool caller_was_method_handle = false;
if (deopt_sender.is_interpreted_frame()) {
methodHandle method = deopt_sender.interpreter_frame_method();
Bytecode_invoke cur = Bytecode_invoke_check(method,
deopt_sender.interpreter_frame_bci());
! if (cur.code() == Bytecodes::_invokedynamic ||
! (cur.code() == Bytecodes::_invokevirtual &&
! method->constants()->klass_ref_at_noresolve(cur.index()) == vmSymbols::java_lang_invoke_MethodHandle() &&
! methodOopDesc::is_method_handle_invoke_name(cur.name()))) {
! // Method handle invokes may involve fairly arbitrary chains of
! // calls so it's impossible to know how much actual space the
! // caller has for locals.
! caller_was_method_handle = true;
! }
}
//
// frame_sizes/frame_pcs[0] oldest frame (int or c2i)
// frame_sizes/frame_pcs[1] next oldest frame (int)
*** 409,426 ****
// 0.._frames-1. Index 0 is the youngest frame and _frame - 1 is the oldest (root) frame.
// When we create the skeletal frames we need the oldest frame to be in the zero slot
// in the frame_sizes/frame_pcs so the assembly code can do a trivial walk.
// so things look a little strange in this loop.
//
for (int index = 0; index < array->frames(); index++ ) {
// frame[number_of_frames - 1 ] = on_stack_size(youngest)
// frame[number_of_frames - 2 ] = on_stack_size(sender(youngest))
// frame[number_of_frames - 3 ] = on_stack_size(sender(sender(youngest)))
int caller_parms = callee_parameters;
! if (index == array->frames() - 1) {
! // Use the value from the interpreted caller
! caller_parms = caller_actual_parameters;
}
frame_sizes[number_of_frames - 1 - index] = BytesPerWord * array->element(index)->on_stack_size(caller_parms,
callee_parameters,
callee_locals,
index == 0,
--- 413,431 ----
// 0.._frames-1. Index 0 is the youngest frame and _frame - 1 is the oldest (root) frame.
// When we create the skeletal frames we need the oldest frame to be in the zero slot
// in the frame_sizes/frame_pcs so the assembly code can do a trivial walk.
// so things look a little strange in this loop.
//
+ int callee_parameters = 0;
+ int callee_locals = 0;
for (int index = 0; index < array->frames(); index++ ) {
// frame[number_of_frames - 1 ] = on_stack_size(youngest)
// frame[number_of_frames - 2 ] = on_stack_size(sender(youngest))
// frame[number_of_frames - 3 ] = on_stack_size(sender(sender(youngest)))
int caller_parms = callee_parameters;
! if ((index == array->frames() - 1) && caller_was_method_handle) {
! caller_parms = 0;
}
frame_sizes[number_of_frames - 1 - index] = BytesPerWord * array->element(index)->on_stack_size(caller_parms,
callee_parameters,
callee_locals,
index == 0,
*** 458,474 ****
// may not even be enough space).
// QQQ I'd rather see this pushed down into last_frame_adjust
// and have it take the sender (aka caller).
! if (deopt_sender.is_compiled_frame()) {
caller_adjustment = last_frame_adjust(0, callee_locals);
! } else if (callee_locals > caller_actual_parameters) {
// The caller frame may need extending to accommodate
// non-parameter locals of the first unpacked interpreted frame.
// Compute that adjustment.
! caller_adjustment = last_frame_adjust(caller_actual_parameters, callee_locals);
}
// If the sender is deoptimized the we must retrieve the address of the handler
// since the frame will "magically" show the original pc before the deopt
// and we'd undo the deopt.
--- 463,479 ----
// may not even be enough space).
// QQQ I'd rather see this pushed down into last_frame_adjust
// and have it take the sender (aka caller).
! if (deopt_sender.is_compiled_frame() || caller_was_method_handle) {
caller_adjustment = last_frame_adjust(0, callee_locals);
! } else if (callee_locals > callee_parameters) {
// The caller frame may need extending to accommodate
// non-parameter locals of the first unpacked interpreted frame.
// Compute that adjustment.
! caller_adjustment = last_frame_adjust(callee_parameters, callee_locals);
}
// If the sender is deoptimized the we must retrieve the address of the handler
// since the frame will "magically" show the original pc before the deopt
// and we'd undo the deopt.
*** 479,489 ****
assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
#endif // SHARK
UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord,
caller_adjustment * BytesPerWord,
! caller_actual_parameters,
number_of_frames,
frame_sizes,
frame_pcs,
return_type);
// On some platforms, we need a way to pass some platform dependent
--- 484,494 ----
assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
#endif // SHARK
UnrollBlock* info = new UnrollBlock(array->frame_size() * BytesPerWord,
caller_adjustment * BytesPerWord,
! caller_was_method_handle ? 0 : callee_parameters,
number_of_frames,
frame_sizes,
frame_pcs,
return_type);
// On some platforms, we need a way to pass some platform dependent
src/share/vm/runtime/deoptimization.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File