< prev index next >
src/cpu/x86/vm/frame_x86.cpp
Print this page
*** 146,155 ****
--- 146,159 ----
sender_sp = _unextended_sp + _cb->frame_size();
// On Intel the return_address is always the word on the stack
sender_pc = (address) *(sender_sp-1);
}
+ if (SharedRuntime::is_memento_stack_trace_return_handler(sender_pc)) {
+ sender_pc = thread->memento_original_return_address();
+ }
+
// If the potential sender is the interpreter then we can do some more checking
if (Interpreter::contains(sender_pc)) {
// ebp is always saved in a recognizable place in any code we generate. However
*** 163,173 ****
return false;
}
// construct the potential sender
! frame sender(sender_sp, saved_fp, sender_pc);
return sender.is_interpreted_frame_valid(thread);
}
--- 167,177 ----
return false;
}
// construct the potential sender
! frame sender(thread, sender_sp, saved_fp, sender_pc);
return sender.is_interpreted_frame_valid(thread);
}
*** 201,211 ****
return false;
}
// construct the potential sender
! frame sender(sender_sp, saved_fp, sender_pc);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
--- 205,215 ----
return false;
}
// construct the potential sender
! frame sender(thread, sender_sp, saved_fp, sender_pc);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
*** 272,281 ****
--- 276,290 ----
address* pc_addr = &(((address*) sp())[-1]);
if (TracePcPatching) {
tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]",
pc_addr, *pc_addr, pc);
}
+ assert(!SharedRuntime::is_memento_stack_trace_return_handler(pc), "new return address must not be memento return handler");
+ if (SharedRuntime::is_memento_stack_trace_return_handler(*pc_addr)) {
+ pc_addr = &(thread->memento_original_return_address());
+ assert(*pc_addr != NULL, "memento original return address must be set");
+ }
// Either the return address is the original one or we are going to
// patch in the same address that's already there.
assert(_pc == *pc_addr || pc == *pc_addr, "must be");
*pc_addr = pc;
_cb = CodeCache::find_blob(pc);
*** 371,384 ****
assert(!entry_frame_is_first(), "next Java fp must be non zero");
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
if (jfa->last_Java_pc() != NULL ) {
! frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
return fr;
}
! frame fr(jfa->last_Java_sp(), jfa->last_Java_fp());
return fr;
}
//------------------------------------------------------------------------------
// frame::verify_deopt_original_pc
--- 380,393 ----
assert(!entry_frame_is_first(), "next Java fp must be non zero");
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
if (jfa->last_Java_pc() != NULL ) {
! frame fr(map->thread(), jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
return fr;
}
! frame fr(map->thread(), jfa->last_Java_sp(), jfa->last_Java_fp());
return fr;
}
//------------------------------------------------------------------------------
// frame::verify_deopt_original_pc
*** 454,464 ****
if (map->update_map()) {
update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));
}
#endif // COMPILER2
! return frame(sender_sp, unextended_sp, link(), sender_pc());
}
//------------------------------------------------------------------------------
// frame::sender_for_compiled_frame
--- 463,473 ----
if (map->update_map()) {
update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));
}
#endif // COMPILER2
! return frame(map->thread(), sender_sp, unextended_sp, link(), sender_pc());
}
//------------------------------------------------------------------------------
// frame::sender_for_compiled_frame
*** 491,501 ****
// since if our caller was compiled code there could be live jvm state in it.
update_map_with_saved_link(map, saved_fp_addr);
}
assert(sender_sp != sp(), "must have changed");
! return frame(sender_sp, unextended_sp, *saved_fp_addr, sender_pc);
}
//------------------------------------------------------------------------------
// frame::sender
--- 500,510 ----
// since if our caller was compiled code there could be live jvm state in it.
update_map_with_saved_link(map, saved_fp_addr);
}
assert(sender_sp != sp(), "must have changed");
! return frame(map->thread(), sender_sp, unextended_sp, *saved_fp_addr, sender_pc);
}
//------------------------------------------------------------------------------
// frame::sender
*** 511,521 ****
if (_cb != NULL) {
return sender_for_compiled_frame(map);
}
// Must be native-compiled frame, i.e. the marshaling code for native
// methods that exists in the core system.
! return frame(sender_sp(), link(), sender_pc());
}
bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) {
assert(is_interpreted_frame(), "must be interpreter frame");
--- 520,530 ----
if (_cb != NULL) {
return sender_for_compiled_frame(map);
}
// Must be native-compiled frame, i.e. the marshaling code for native
// methods that exists in the core system.
! return frame(map->thread(), sender_sp(), link(), sender_pc());
}
bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) {
assert(is_interpreted_frame(), "must be interpreter frame");
*** 708,716 ****
return fp();
}
#ifndef PRODUCT
// This is a generic constructor which is only used by pns() in debug.cpp.
! frame::frame(void* sp, void* fp, void* pc) {
! init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
}
#endif
--- 717,725 ----
return fp();
}
#ifndef PRODUCT
// This is a generic constructor which is only used by pns() in debug.cpp.
! frame::frame(Thread* thread, void* sp, void* fp, void* pc) {
! init(thread, (intptr_t*)sp, (intptr_t*)fp, (address)pc);
}
#endif
< prev index next >