提交 a559e3b0 编写于 作者: B bdelsart

7120450: complete information dumped by frame_describe

Summary: improvements of frame_describe
Reviewed-by: never, twisti
上级 b1dea640
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -820,11 +820,19 @@ void frame::describe_pd(FrameValues& values, int frame_no) { ...@@ -820,11 +820,19 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
values.describe(frame_no, sp() + w, err_msg("register save area word %d", w), 1); values.describe(frame_no, sp() + w, err_msg("register save area word %d", w), 1);
} }
if (is_interpreted_frame()) { if (is_ricochet_frame()) {
MethodHandles::RicochetFrame::describe(this, values, frame_no);
} else if (is_interpreted_frame()) {
DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp);
DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp);
DESCRIBE_FP_OFFSET(interpreter_frame_padding); DESCRIBE_FP_OFFSET(interpreter_frame_padding);
DESCRIBE_FP_OFFSET(interpreter_frame_oop_temp); DESCRIBE_FP_OFFSET(interpreter_frame_oop_temp);
// esp, according to Lesp (e.g. not depending on bci), if seems valid
intptr_t* esp = *interpreter_frame_esp_addr();
if ((esp >= sp()) && (esp < fp())) {
values.describe(-1, esp, "*Lesp");
}
} }
if (!is_compiled_frame()) { if (!is_compiled_frame()) {
...@@ -844,4 +852,3 @@ intptr_t *frame::initial_deoptimization_info() { ...@@ -844,4 +852,3 @@ intptr_t *frame::initial_deoptimization_info() {
// unused... but returns fp() to minimize changes introduced by 7087445 // unused... but returns fp() to minimize changes introduced by 7087445
return fp(); return fp();
} }
/* /*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1000,6 +1000,24 @@ void MethodHandles::move_return_value(MacroAssembler* _masm, BasicType type, ...@@ -1000,6 +1000,24 @@ void MethodHandles::move_return_value(MacroAssembler* _masm, BasicType type,
BLOCK_COMMENT("} move_return_value"); BLOCK_COMMENT("} move_return_value");
} }
#ifdef ASSERT
void MethodHandles::RicochetFrame::describe(const frame* fr, FrameValues& values, int frame_no) {
RicochetFrame* rf = new RicochetFrame(*fr);
// ricochet slots (kept in registers for sparc)
values.describe(frame_no, rf->register_addr(I5_savedSP), err_msg("exact_sender_sp reg for #%d", frame_no));
values.describe(frame_no, rf->register_addr(L5_conversion), err_msg("conversion reg for #%d", frame_no));
values.describe(frame_no, rf->register_addr(L4_saved_args_base), err_msg("saved_args_base reg for #%d", frame_no));
values.describe(frame_no, rf->register_addr(L3_saved_args_layout), err_msg("saved_args_layout reg for #%d", frame_no));
values.describe(frame_no, rf->register_addr(L2_saved_target), err_msg("saved_target reg for #%d", frame_no));
values.describe(frame_no, rf->register_addr(L1_continuation), err_msg("continuation reg for #%d", frame_no));
// relevant ricochet targets (in caller frame)
values.describe(-1, rf->saved_args_base(), err_msg("*saved_args_base for #%d", frame_no));
values.describe(-1, (intptr_t *)(STACK_BIAS+(uintptr_t)rf->exact_sender_sp()), err_msg("*exact_sender_sp+STACK_BIAS for #%d", frame_no));
}
#endif // ASSERT
#ifndef PRODUCT #ifndef PRODUCT
extern "C" void print_method_handle(oop mh); extern "C" void print_method_handle(oop mh);
void trace_method_handle_stub(const char* adaptername, void trace_method_handle_stub(const char* adaptername,
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -145,6 +145,8 @@ class RicochetFrame : public ResourceObj { ...@@ -145,6 +145,8 @@ class RicochetFrame : public ResourceObj {
} }
static void verify_clean(MacroAssembler* _masm) NOT_DEBUG_RETURN; static void verify_clean(MacroAssembler* _masm) NOT_DEBUG_RETURN;
static void describe(const frame* fr, FrameValues& values, int frame_no) NOT_DEBUG_RETURN;
}; };
// Additional helper methods for MethodHandles code generation: // Additional helper methods for MethodHandles code generation:
......
...@@ -657,7 +657,9 @@ intptr_t* frame::interpreter_frame_tos_at(jint offset) const { ...@@ -657,7 +657,9 @@ intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
values.describe(frame_no, fp() + frame::name##_offset, #name) values.describe(frame_no, fp() + frame::name##_offset, #name)
void frame::describe_pd(FrameValues& values, int frame_no) { void frame::describe_pd(FrameValues& values, int frame_no) {
if (is_interpreted_frame()) { if (is_ricochet_frame()) {
MethodHandles::RicochetFrame::describe(this, values, frame_no);
} else if (is_interpreted_frame()) {
DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp);
DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);
DESCRIBE_FP_OFFSET(interpreter_frame_method); DESCRIBE_FP_OFFSET(interpreter_frame_method);
...@@ -667,7 +669,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { ...@@ -667,7 +669,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
DESCRIBE_FP_OFFSET(interpreter_frame_bcx); DESCRIBE_FP_OFFSET(interpreter_frame_bcx);
DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp); DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);
} }
} }
#endif #endif
......
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -990,6 +990,26 @@ void MethodHandles::move_return_value(MacroAssembler* _masm, BasicType type, ...@@ -990,6 +990,26 @@ void MethodHandles::move_return_value(MacroAssembler* _masm, BasicType type,
BLOCK_COMMENT("} move_return_value"); BLOCK_COMMENT("} move_return_value");
} }
#ifdef ASSERT
#define DESCRIBE_RICOCHET_OFFSET(rf, name) \
values.describe(frame_no, (intptr_t *) (((uintptr_t)rf) + MethodHandles::RicochetFrame::name##_offset_in_bytes()), #name)
void MethodHandles::RicochetFrame::describe(const frame* fr, FrameValues& values, int frame_no) {
address bp = (address) fr->fp();
RicochetFrame* rf = (RicochetFrame*)(bp - sender_link_offset_in_bytes());
// ricochet slots
DESCRIBE_RICOCHET_OFFSET(rf, exact_sender_sp);
DESCRIBE_RICOCHET_OFFSET(rf, conversion);
DESCRIBE_RICOCHET_OFFSET(rf, saved_args_base);
DESCRIBE_RICOCHET_OFFSET(rf, saved_args_layout);
DESCRIBE_RICOCHET_OFFSET(rf, saved_target);
DESCRIBE_RICOCHET_OFFSET(rf, continuation);
// relevant ricochet targets (in caller frame)
values.describe(-1, rf->saved_args_base(), err_msg("*saved_args_base for #%d", frame_no));
}
#endif // ASSERT
#ifndef PRODUCT #ifndef PRODUCT
extern "C" void print_method_handle(oop mh); extern "C" void print_method_handle(oop mh);
......
/* /*
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -224,6 +224,8 @@ class RicochetFrame { ...@@ -224,6 +224,8 @@ class RicochetFrame {
} }
static void verify_clean(MacroAssembler* _masm) NOT_DEBUG_RETURN; static void verify_clean(MacroAssembler* _masm) NOT_DEBUG_RETURN;
static void describe(const frame* fr, FrameValues& values, int frame_no) NOT_DEBUG_RETURN;
}; };
// Additional helper methods for MethodHandles code generation: // Additional helper methods for MethodHandles code generation:
......
...@@ -1334,21 +1334,31 @@ void frame::interpreter_frame_verify_monitor(BasicObjectLock* value) const { ...@@ -1334,21 +1334,31 @@ void frame::interpreter_frame_verify_monitor(BasicObjectLock* value) const {
void frame::describe(FrameValues& values, int frame_no) { void frame::describe(FrameValues& values, int frame_no) {
intptr_t* frame_pointer = real_fp(); // boundaries: sp and the 'real' frame pointer
values.describe(-1, sp(), err_msg("sp for #%d", frame_no), 1);
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);
if (info_address != frame_pointer) {
// print frame_pointer explicitly if not marked by the frame info
values.describe(-1, frame_pointer, err_msg("frame pointer for #%d", frame_no), 1);
}
if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) { if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) {
// Label values common to most frames // Label values common to most frames
values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no)); values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no));
values.describe(-1, sp(), err_msg("sp for #%d", frame_no));
values.describe(-1, frame_pointer, err_msg("frame pointer for #%d", frame_no));
} }
if (is_interpreted_frame()) { if (is_interpreted_frame()) {
methodOop m = interpreter_frame_method(); methodOop m = interpreter_frame_method();
int bci = interpreter_frame_bci(); int bci = interpreter_frame_bci();
// Label the method and current bci // Label the method and current bci
values.describe(-1, MAX2(sp(), frame_pointer), values.describe(-1, info_address,
FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2); FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2);
values.describe(-1, MAX2(sp(), frame_pointer), values.describe(-1, info_address,
err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1); err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1);
if (m->max_locals() > 0) { if (m->max_locals() > 0) {
intptr_t* l0 = interpreter_frame_local_at(0); intptr_t* l0 = interpreter_frame_local_at(0);
...@@ -1380,21 +1390,36 @@ void frame::describe(FrameValues& values, int frame_no) { ...@@ -1380,21 +1390,36 @@ void frame::describe(FrameValues& values, int frame_no) {
} }
} else if (is_entry_frame()) { } else if (is_entry_frame()) {
// For now just label the frame // For now just label the frame
values.describe(-1, MAX2(sp(), frame_pointer), err_msg("#%d entry frame", frame_no), 2); values.describe(-1, info_address, err_msg("#%d entry frame", frame_no), 2);
} else if (is_compiled_frame()) { } else if (is_compiled_frame()) {
// For now just label the frame // For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null(); nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), frame_pointer), values.describe(-1, info_address,
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no, FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no,
nm, nm->method()->name_and_sig_as_C_string(), nm, nm->method()->name_and_sig_as_C_string(),
is_deoptimized_frame() ? " (deoptimized" : ""), 2); (_deopt_state == is_deoptimized) ?
" (deoptimized)" :
((_deopt_state == unknown) ? " (state unknown)" : "")),
2);
} else if (is_native_frame()) { } else if (is_native_frame()) {
// For now just label the frame // For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null(); nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), frame_pointer), values.describe(-1, info_address,
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
nm, nm->method()->name_and_sig_as_C_string()), 2); nm, nm->method()->name_and_sig_as_C_string()), 2);
} else if (is_ricochet_frame()) {
values.describe(-1, info_address, err_msg("#%d ricochet frame", frame_no), 2);
} else {
// provide default info if not handled before
char *info = (char *) "special frame";
if ((_cb != NULL) &&
(_cb->name() != NULL)) {
info = (char *)_cb->name();
}
values.describe(-1, info_address, err_msg("#%d <%s>", frame_no, info), 2);
} }
// platform dependent additional data
describe_pd(values, frame_no); describe_pd(values, frame_no);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册