提交 40b1343a 编写于 作者: B bdelsart

7120448: Fix FP values for compiled frames in frame::describe

Summary: fix for debug method frame::describe
Reviewed-by: never, kvn
上级 ac0ef1e7
/*
* Copyright (c) 1997, 2010, 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -82,6 +82,8 @@ inline address* frame::O0_addr() const { return (address*) &younger_sp()[ I0->s
inline intptr_t* frame::sender_sp() const { return fp(); }
inline intptr_t* frame::real_fp() const { return fp(); }
// Used only in frame::oopmapreg_to_location
// This return a value in VMRegImpl::slot_size
inline int frame::pd_oop_map_offset_adjustment() const {
......
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -675,3 +675,21 @@ intptr_t *frame::initial_deoptimization_info() {
// used to reset the saved FP
return fp();
}
intptr_t* frame::real_fp() const {
if (_cb != NULL) {
// use the frame size if valid
int size = _cb->frame_size();
if ((size > 0) &&
(! is_ricochet_frame())) {
// Work-around: ricochet explicitly excluded because frame size is not
// constant for the ricochet blob but its frame_size could not, for
// some reasons, be declared as <= 0. This potentially confusing
// size declaration should be fixed as another CR.
return unextended_sp() + size;
}
}
// else rely on fp()
assert(! is_compiled_frame(), "unknown compiled frame size");
return fp();
}
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -188,6 +188,7 @@
frame(intptr_t* sp, intptr_t* fp);
// accessors for the instance variables
// Note: not necessarily the real 'frame pointer' (see real_fp)
intptr_t* fp() const { return _fp; }
inline address* sender_pc_addr() const;
......
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
......@@ -72,6 +72,10 @@ inline intptr_t* frame::sender_sp() const {
return fp() + 1;
}
inline intptr_t* frame::real_fp() const {
return fp();
}
inline intptr_t* frame::link() const {
ShouldNotCallThis();
}
......
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1334,24 +1334,21 @@ void frame::interpreter_frame_verify_monitor(BasicObjectLock* value) const {
void frame::describe(FrameValues& values, int frame_no) {
intptr_t* frame_pointer = real_fp();
if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) {
// Label values common to most frames
values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no));
values.describe(-1, sp(), err_msg("sp for #%d", frame_no));
if (is_compiled_frame()) {
values.describe(-1, sp() + _cb->frame_size(), err_msg("computed fp for #%d", frame_no));
} else {
values.describe(-1, fp(), err_msg("fp for #%d", frame_no));
}
values.describe(-1, frame_pointer, err_msg("frame pointer for #%d", frame_no));
}
if (is_interpreted_frame()) {
methodOop m = interpreter_frame_method();
int bci = interpreter_frame_bci();
// Label the method and current bci
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2);
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1);
if (m->max_locals() > 0) {
intptr_t* l0 = interpreter_frame_local_at(0);
......@@ -1383,18 +1380,18 @@ void frame::describe(FrameValues& values, int frame_no) {
}
} else if (is_entry_frame()) {
// For now just label the frame
values.describe(-1, MAX2(sp(), fp()), err_msg("#%d entry frame", frame_no), 2);
values.describe(-1, MAX2(sp(), frame_pointer), err_msg("#%d entry frame", frame_no), 2);
} else if (is_compiled_frame()) {
// For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no,
nm, nm->method()->name_and_sig_as_C_string(),
is_deoptimized_frame() ? " (deoptimized" : ""), 2);
} else if (is_native_frame()) {
// For now just label the frame
nmethod* nm = cb()->as_nmethod_or_null();
values.describe(-1, MAX2(sp(), fp()),
values.describe(-1, MAX2(sp(), frame_pointer),
FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
nm, nm->method()->name_and_sig_as_C_string()), 2);
}
......
/*
* 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -221,6 +221,15 @@ class frame VALUE_OBJ_CLASS_SPEC {
// returns the stack pointer of the calling frame
intptr_t* sender_sp() const;
// Returns the real 'frame pointer' for the current frame.
// This is the value expected by the platform ABI when it defines a
// frame pointer register. It may differ from the effective value of
// the FP register when that register is used in the JVM for other
// purposes (like compiled frames on some platforms).
// On other platforms, it is defined so that the stack area used by
// this frame goes from real_fp() to sp().
intptr_t* real_fp() const;
// Deoptimization info, if needed (platform dependent).
// Stored in the initial_info field of the unroll info, to be used by
// the platform dependent deoptimization blobs.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册