comparison src/share/vm/runtime/frame.cpp @ 4806:eaa9557116a2

7120448: Fix FP values for compiled frames in frame::describe Summary: fix for debug method frame::describe Reviewed-by: never, kvn
author bdelsart
date Wed, 18 Jan 2012 16:18:31 +0100
parents b20d64f83668
children 82e5a84b7436
comparison
equal deleted inserted replaced
4792:89d0a5d40008 4806:eaa9557116a2
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1332 guarantee( current >= low_mark , "Current BasicObjectLock* below than low_mark"); 1332 guarantee( current >= low_mark , "Current BasicObjectLock* below than low_mark");
1333 } 1333 }
1334 1334
1335 1335
1336 void frame::describe(FrameValues& values, int frame_no) { 1336 void frame::describe(FrameValues& values, int frame_no) {
1337 intptr_t* frame_pointer = real_fp();
1337 if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) { 1338 if (is_entry_frame() || is_compiled_frame() || is_interpreted_frame() || is_native_frame()) {
1338 // Label values common to most frames 1339 // Label values common to most frames
1339 values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no)); 1340 values.describe(-1, unextended_sp(), err_msg("unextended_sp for #%d", frame_no));
1340 values.describe(-1, sp(), err_msg("sp for #%d", frame_no)); 1341 values.describe(-1, sp(), err_msg("sp for #%d", frame_no));
1341 if (is_compiled_frame()) { 1342 values.describe(-1, frame_pointer, err_msg("frame pointer for #%d", frame_no));
1342 values.describe(-1, sp() + _cb->frame_size(), err_msg("computed fp for #%d", frame_no));
1343 } else {
1344 values.describe(-1, fp(), err_msg("fp for #%d", frame_no));
1345 }
1346 } 1343 }
1347 if (is_interpreted_frame()) { 1344 if (is_interpreted_frame()) {
1348 methodOop m = interpreter_frame_method(); 1345 methodOop m = interpreter_frame_method();
1349 int bci = interpreter_frame_bci(); 1346 int bci = interpreter_frame_bci();
1350 1347
1351 // Label the method and current bci 1348 // Label the method and current bci
1352 values.describe(-1, MAX2(sp(), fp()), 1349 values.describe(-1, MAX2(sp(), frame_pointer),
1353 FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2); 1350 FormatBuffer<1024>("#%d method %s @ %d", frame_no, m->name_and_sig_as_C_string(), bci), 2);
1354 values.describe(-1, MAX2(sp(), fp()), 1351 values.describe(-1, MAX2(sp(), frame_pointer),
1355 err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1); 1352 err_msg("- %d locals %d max stack", m->max_locals(), m->max_stack()), 1);
1356 if (m->max_locals() > 0) { 1353 if (m->max_locals() > 0) {
1357 intptr_t* l0 = interpreter_frame_local_at(0); 1354 intptr_t* l0 = interpreter_frame_local_at(0);
1358 intptr_t* ln = interpreter_frame_local_at(m->max_locals() - 1); 1355 intptr_t* ln = interpreter_frame_local_at(m->max_locals() - 1);
1359 values.describe(-1, MAX2(l0, ln), err_msg("locals for #%d", frame_no), 1); 1356 values.describe(-1, MAX2(l0, ln), err_msg("locals for #%d", frame_no), 1);
1381 values.describe(frame_no, (intptr_t*)interpreter_frame_monitor_begin(), "monitors begin"); 1378 values.describe(frame_no, (intptr_t*)interpreter_frame_monitor_begin(), "monitors begin");
1382 values.describe(frame_no, (intptr_t*)interpreter_frame_monitor_end(), "monitors end"); 1379 values.describe(frame_no, (intptr_t*)interpreter_frame_monitor_end(), "monitors end");
1383 } 1380 }
1384 } else if (is_entry_frame()) { 1381 } else if (is_entry_frame()) {
1385 // For now just label the frame 1382 // For now just label the frame
1386 values.describe(-1, MAX2(sp(), fp()), err_msg("#%d entry frame", frame_no), 2); 1383 values.describe(-1, MAX2(sp(), frame_pointer), err_msg("#%d entry frame", frame_no), 2);
1387 } else if (is_compiled_frame()) { 1384 } else if (is_compiled_frame()) {
1388 // For now just label the frame 1385 // For now just label the frame
1389 nmethod* nm = cb()->as_nmethod_or_null(); 1386 nmethod* nm = cb()->as_nmethod_or_null();
1390 values.describe(-1, MAX2(sp(), fp()), 1387 values.describe(-1, MAX2(sp(), frame_pointer),
1391 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no, 1388 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method %s%s", frame_no,
1392 nm, nm->method()->name_and_sig_as_C_string(), 1389 nm, nm->method()->name_and_sig_as_C_string(),
1393 is_deoptimized_frame() ? " (deoptimized" : ""), 2); 1390 is_deoptimized_frame() ? " (deoptimized" : ""), 2);
1394 } else if (is_native_frame()) { 1391 } else if (is_native_frame()) {
1395 // For now just label the frame 1392 // For now just label the frame
1396 nmethod* nm = cb()->as_nmethod_or_null(); 1393 nmethod* nm = cb()->as_nmethod_or_null();
1397 values.describe(-1, MAX2(sp(), fp()), 1394 values.describe(-1, MAX2(sp(), frame_pointer),
1398 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, 1395 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
1399 nm, nm->method()->name_and_sig_as_C_string()), 2); 1396 nm, nm->method()->name_and_sig_as_C_string()), 2);
1400 } 1397 }
1401 describe_pd(values, frame_no); 1398 describe_pd(values, frame_no);
1402 } 1399 }