comparison src/share/vm/runtime/frame.cpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents 6b0fd0964b87 190899198332
children d8041d695d19
comparison
equal deleted inserted replaced
12058:ccb4f2af2319 12355:cefad50507d8
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, 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.
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "compiler/abstractCompiler.hpp"
26 #include "compiler/disassembler.hpp" 27 #include "compiler/disassembler.hpp"
27 #include "gc_interface/collectedHeap.inline.hpp" 28 #include "gc_interface/collectedHeap.inline.hpp"
28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreter.hpp"
29 #include "interpreter/oopMapCache.hpp" 30 #include "interpreter/oopMapCache.hpp"
30 #include "memory/resourceArea.hpp" 31 #include "memory/resourceArea.hpp"
557 NOT_PRODUCT(address begin = pc()-40;) 558 NOT_PRODUCT(address begin = pc()-40;)
558 NOT_PRODUCT(address end = NULL;) 559 NOT_PRODUCT(address end = NULL;)
559 560
560 st->print("%s frame (sp=" INTPTR_FORMAT " unextended sp=" INTPTR_FORMAT, print_name(), sp(), unextended_sp()); 561 st->print("%s frame (sp=" INTPTR_FORMAT " unextended sp=" INTPTR_FORMAT, print_name(), sp(), unextended_sp());
561 if (sp() != NULL) 562 if (sp() != NULL)
562 st->print(", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT, fp(), pc()); 563 st->print(", fp=" INTPTR_FORMAT ", real_fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT, fp(), real_fp(), pc());
563 564
564 if (StubRoutines::contains(pc())) { 565 if (StubRoutines::contains(pc())) {
565 st->print_cr(")"); 566 st->print_cr(")");
566 st->print("("); 567 st->print("(");
567 StubCodeDesc* desc = StubCodeDesc::desc_for(pc()); 568 StubCodeDesc* desc = StubCodeDesc::desc_for(pc());
649 } 650 }
650 651
651 // Return whether the frame is in the VM or os indicating a Hotspot problem. 652 // Return whether the frame is in the VM or os indicating a Hotspot problem.
652 // Otherwise, it's likely a bug in the native library that the Java code calls, 653 // Otherwise, it's likely a bug in the native library that the Java code calls,
653 // hopefully indicating where to submit bugs. 654 // hopefully indicating where to submit bugs.
654 static void print_C_frame(outputStream* st, char* buf, int buflen, address pc) { 655 void frame::print_C_frame(outputStream* st, char* buf, int buflen, address pc) {
655 // C/C++ frame 656 // C/C++ frame
656 bool in_vm = os::address_is_in_vm(pc); 657 bool in_vm = os::address_is_in_vm(pc);
657 st->print(in_vm ? "V" : "C"); 658 st->print(in_vm ? "V" : "C");
658 659
659 int offset; 660 int offset;
718 st->print("v ~StubRoutines::" PTR_FORMAT, pc()); 719 st->print("v ~StubRoutines::" PTR_FORMAT, pc());
719 } 720 }
720 } else if (_cb->is_buffer_blob()) { 721 } else if (_cb->is_buffer_blob()) {
721 st->print("v ~BufferBlob::%s", ((BufferBlob *)_cb)->name()); 722 st->print("v ~BufferBlob::%s", ((BufferBlob *)_cb)->name());
722 } else if (_cb->is_nmethod()) { 723 } else if (_cb->is_nmethod()) {
723 Method* m = ((nmethod *)_cb)->method(); 724 nmethod* nm = (nmethod*)_cb;
725 Method* m = nm->method();
724 if (m != NULL) { 726 if (m != NULL) {
725 m->name_and_sig_as_C_string(buf, buflen); 727 m->name_and_sig_as_C_string(buf, buflen);
726 st->print("J %s @ " PTR_FORMAT " [" PTR_FORMAT "+" SIZE_FORMAT "]", 728 st->print("J %d%s %s %s (%d bytes) @ " PTR_FORMAT " [" PTR_FORMAT "+0x%x]",
727 buf, _pc, _cb->code_begin(), _pc - _cb->code_begin()); 729 nm->compile_id(), (nm->is_osr_method() ? "%" : ""),
730 ((nm->compiler() != NULL) ? nm->compiler()->name() : ""),
731 buf, m->code_size(), _pc, _cb->code_begin(), _pc - _cb->code_begin());
728 } else { 732 } else {
729 st->print("J " PTR_FORMAT, pc()); 733 st->print("J " PTR_FORMAT, pc());
730 } 734 }
731 } else if (_cb->is_runtime_stub()) { 735 } else if (_cb->is_runtime_stub()) {
732 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); 736 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name());
1091 if (oop_adr == NULL) { 1095 if (oop_adr == NULL) {
1092 guarantee(oop_adr != NULL, "bad register save location"); 1096 guarantee(oop_adr != NULL, "bad register save location");
1093 return NULL; 1097 return NULL;
1094 } 1098 }
1095 oop r = *oop_adr; 1099 oop r = *oop_adr;
1096 assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (intptr_t) r, (intptr_t) r)); 1100 assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r));
1097 return r; 1101 return r;
1098 } 1102 }
1099 1103
1100 1104
1101 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const { 1105 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const {
1222 } 1226 }
1223 1227
1224 1228
1225 void frame::ZapDeadClosure::do_oop(oop* p) { 1229 void frame::ZapDeadClosure::do_oop(oop* p) {
1226 if (TraceZapDeadLocals) tty->print_cr("zapping @ " INTPTR_FORMAT " containing " INTPTR_FORMAT, p, (address)*p); 1230 if (TraceZapDeadLocals) tty->print_cr("zapping @ " INTPTR_FORMAT " containing " INTPTR_FORMAT, p, (address)*p);
1227 // Need cast because on _LP64 the conversion to oop is ambiguous. Constant 1231 *p = cast_to_oop<intptr_t>(0xbabebabe);
1228 // can be either long or int.
1229 *p = (oop)(int)0xbabebabe;
1230 } 1232 }
1231 frame::ZapDeadClosure frame::_zap_dead; 1233 frame::ZapDeadClosure frame::_zap_dead;
1232 1234
1233 void frame::zap_dead_locals(JavaThread* thread, const RegisterMap* map) { 1235 void frame::zap_dead_locals(JavaThread* thread, const RegisterMap* map) {
1234 assert(thread == Thread::current(), "need to synchronize to do this to another thread"); 1236 assert(thread == Thread::current(), "need to synchronize to do this to another thread");