< prev index next > src/hotspot/share/runtime/frame.cpp
Print this page
// locks for synchronization
for (BasicObjectLock* current = interpreter_frame_monitor_end();
current < interpreter_frame_monitor_begin();
current = next_monitor_in_interpreter_frame(current)) {
st->print(" - obj [%s", current->obj() == nullptr ? "null" : "");
- if (current->obj() != nullptr) current->obj()->print_value_on(st);
+ oop obj = current->obj();
+ if (obj != nullptr) {
+ if (!is_heap_frame()) {
+ obj->print_value_on(st);
+ } else {
+ // Might be an invalid oop. We don't have the
+ // stackChunk to correct it so just print address.
+ st->print(INTPTR_FORMAT, p2i(obj));
+ }
+ }
st->print_cr("]");
st->print(" - lock [");
- current->lock()->print_on(st, current->obj());
+ if (!is_heap_frame()) {
+ current->lock()->print_on(st, obj);
+ }
st->print_cr("]");
}
// monitor
st->print_cr(" - monitor[" INTPTR_FORMAT "]", p2i(interpreter_frame_monitor_begin()));
// bcp
assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", p2i(r), p2i(r));
return r;
}
- BasicLock* frame::get_native_monitor() {
+ BasicLock* frame::get_native_monitor() const {
nmethod* nm = (nmethod*)_cb;
assert(_cb != nullptr && _cb->is_nmethod() && nm->method()->is_native(),
"Should not call this unless it's a native nmethod");
int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
assert(byte_offset >= 0, "should not see invalid offset");
return (BasicLock*) &sp()[byte_offset / wordSize];
}
- oop frame::get_native_receiver() {
+ oop frame::get_native_receiver() const {
nmethod* nm = (nmethod*)_cb;
assert(_cb != nullptr && _cb->is_nmethod() && nm->method()->is_native(),
"Should not call this unless it's a native nmethod");
int byte_offset = in_bytes(nm->native_receiver_sp_offset());
assert(byte_offset >= 0, "should not see invalid offset");
_base->push(base_loc);
_derived->push(derived_loc);
}
bool is_good(oop* p) {
- return *p == nullptr || (dbg_is_safe(*p, -1) && dbg_is_safe((*p)->klass(), -1) && oopDesc::is_oop_or_null(*p));
+ return *p == nullptr || (dbg_is_safe(*p, -1) && oopDesc::is_oop_or_null(*p));
}
void describe(FrameValues& values, int frame_no) {
for (int i = 0; i < _oops->length(); i++) {
oop* p = _oops->at(i);
values.describe(frame_no, (intptr_t*)p, err_msg("oop%s for #%d", is_good(p) ? "" : " (BAD)", frame_no));
}
};
// callers need a ResourceMark because of name_and_sig_as_C_string() usage,
// RA allocated string is returned to the caller
- void frame::describe(FrameValues& values, int frame_no, const RegisterMap* reg_map) {
+ void frame::describe(FrameValues& values, int frame_no, const RegisterMap* reg_map, bool top) {
// boundaries: sp and the 'real' frame pointer
values.describe(-1, sp(), err_msg("sp for #%d", frame_no), 0);
+ if (top) {
+ values.describe(-1, sp() - 1, err_msg("sp[-1] for #%d", frame_no), 0);
+ values.describe(-1, sp() - 2, err_msg("sp[-2] for #%d", frame_no), 0);
+ }
+
intptr_t* frame_pointer = real_fp(); // Note: may differ from fp()
// print frame info at the highest boundary
intptr_t* info_address = MAX2(sp(), frame_pointer);
oopsFn.describe(values, frame_no);
}
} else if (is_entry_frame()) {
// For now just label the frame
values.describe(-1, info_address, err_msg("#%d entry frame", frame_no), 2);
- } else if (cb()->is_nmethod()) {
+ } else if (cb() && cb()->is_nmethod()) {
// For now just label the frame
nmethod* nm = cb()->as_nmethod();
values.describe(-1, info_address,
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method J %s%s", frame_no,
p2i(nm),
< prev index next >