1.1 --- a/src/share/vm/runtime/frame.cpp Sun Oct 23 23:57:39 2011 -0700 1.2 +++ b/src/share/vm/runtime/frame.cpp Mon Oct 24 07:53:17 2011 -0700 1.3 @@ -1338,7 +1338,11 @@ 1.4 // Label values common to most frames 1.5 values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no)); 1.6 values.describe(-1, sp(), err_msg("sp for #%d", frame_no)); 1.7 - values.describe(-1, fp(), err_msg("fp for #%d", frame_no)); 1.8 + if (is_compiled_frame()) { 1.9 + values.describe(-1, sp() + _cb->frame_size(), err_msg("computed fp for #%d", frame_no)); 1.10 + } else { 1.11 + values.describe(-1, fp(), err_msg("fp for #%d", frame_no)); 1.12 + } 1.13 } 1.14 if (is_interpreted_frame()) { 1.15 methodOop m = interpreter_frame_method(); 1.16 @@ -1450,9 +1454,8 @@ 1.17 } 1.18 1.19 1.20 -void FrameValues::print() { 1.21 +void FrameValues::print(JavaThread* thread) { 1.22 _values.sort(compare); 1.23 - JavaThread* thread = JavaThread::current(); 1.24 1.25 // Sometimes values like the fp can be invalid values if the 1.26 // register map wasn't updated during the walk. Trim out values 1.27 @@ -1460,12 +1463,22 @@ 1.28 int min_index = 0; 1.29 int max_index = _values.length() - 1; 1.30 intptr_t* v0 = _values.at(min_index).location; 1.31 - while (!thread->is_in_stack((address)v0)) { 1.32 - v0 = _values.at(++min_index).location; 1.33 - } 1.34 intptr_t* v1 = _values.at(max_index).location; 1.35 - while (!thread->is_in_stack((address)v1)) { 1.36 - v1 = _values.at(--max_index).location; 1.37 + 1.38 + if (thread == Thread::current()) { 1.39 + while (!thread->is_in_stack((address)v0)) { 1.40 + v0 = _values.at(++min_index).location; 1.41 + } 1.42 + while (!thread->is_in_stack((address)v1)) { 1.43 + v1 = _values.at(--max_index).location; 1.44 + } 1.45 + } else { 1.46 + while (!thread->on_local_stack((address)v0)) { 1.47 + v0 = _values.at(++min_index).location; 1.48 + } 1.49 + while (!thread->on_local_stack((address)v1)) { 1.50 + v1 = _values.at(--max_index).location; 1.51 + } 1.52 } 1.53 intptr_t* min = MIN2(v0, v1); 1.54 intptr_t* max = MAX2(v0, v1);