Mon, 11 Oct 2010 04:18:58 -0700
6829194: JSR 292 needs to support compressed oops
Reviewed-by: kvn, jrose
duke@435 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | #include "incls/_precompiled.incl" |
duke@435 | 26 | #include "incls/_debug_sparc.cpp.incl" |
duke@435 | 27 | |
duke@435 | 28 | #ifndef PRODUCT |
duke@435 | 29 | |
duke@435 | 30 | extern "C" void findpc(int x); |
duke@435 | 31 | |
duke@435 | 32 | |
duke@435 | 33 | void pd_ps(frame f) { |
duke@435 | 34 | intptr_t* sp = f.sp(); |
duke@435 | 35 | intptr_t* prev_sp = sp - 1; |
duke@435 | 36 | intptr_t *pc = NULL; |
duke@435 | 37 | intptr_t *next_pc = NULL; |
duke@435 | 38 | int count = 0; |
duke@435 | 39 | tty->print("register window backtrace from %#x:\n", sp); |
duke@435 | 40 | while (sp != NULL && ((intptr_t)sp & 7) == 0 && sp > prev_sp && sp < prev_sp+1000) { |
duke@435 | 41 | pc = next_pc; |
duke@435 | 42 | next_pc = (intptr_t*) sp[I7->sp_offset_in_saved_window()]; |
duke@435 | 43 | tty->print("[%d] sp=%#x pc=", count, sp); |
duke@435 | 44 | findpc((intptr_t)pc); |
duke@435 | 45 | if (WizardMode && Verbose) { |
duke@435 | 46 | // print register window contents also |
duke@435 | 47 | tty->print_cr(" L0..L7: {%#x %#x %#x %#x %#x %#x %#x %#x}", |
duke@435 | 48 | sp[0+0],sp[0+1],sp[0+2],sp[0+3], |
duke@435 | 49 | sp[0+4],sp[0+5],sp[0+6],sp[0+7]); |
duke@435 | 50 | tty->print_cr(" I0..I7: {%#x %#x %#x %#x %#x %#x %#x %#x}", |
duke@435 | 51 | sp[8+0],sp[8+1],sp[8+2],sp[8+3], |
duke@435 | 52 | sp[8+4],sp[8+5],sp[8+6],sp[8+7]); |
duke@435 | 53 | // (and print stack frame contents too??) |
duke@435 | 54 | |
duke@435 | 55 | CodeBlob *b = CodeCache::find_blob((address) pc); |
duke@435 | 56 | if (b != NULL) { |
duke@435 | 57 | if (b->is_nmethod()) { |
duke@435 | 58 | methodOop m = ((nmethod*)b)->method(); |
duke@435 | 59 | int nlocals = m->max_locals(); |
duke@435 | 60 | int nparams = m->size_of_parameters(); |
duke@435 | 61 | tty->print_cr("compiled java method (locals = %d, params = %d)", nlocals, nparams); |
duke@435 | 62 | } |
duke@435 | 63 | } |
duke@435 | 64 | } |
duke@435 | 65 | prev_sp = sp; |
duke@435 | 66 | sp = (intptr_t *)sp[FP->sp_offset_in_saved_window()]; |
duke@435 | 67 | sp = (intptr_t *)((intptr_t)sp + STACK_BIAS); |
duke@435 | 68 | count += 1; |
duke@435 | 69 | } |
duke@435 | 70 | if (sp != NULL) |
duke@435 | 71 | tty->print("[%d] sp=%#x [bogus sp!]", count, sp); |
duke@435 | 72 | } |
duke@435 | 73 | |
duke@435 | 74 | #endif // PRODUCT |