comparison src/share/vm/runtime/frame.cpp @ 8151:b8f261ba79c6

Minimize diff to plain HotSpot version.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Mar 2013 21:00:29 +0100
parents a7a93887b4c4
children b9a918201d47
comparison
equal deleted inserted replaced
8150:b66f831ac5ab 8151:b8f261ba79c6
595 595
596 596
597 void frame::interpreter_frame_print_on(outputStream* st) const { 597 void frame::interpreter_frame_print_on(outputStream* st) const {
598 #ifndef PRODUCT 598 #ifndef PRODUCT
599 assert(is_interpreted_frame(), "Not an interpreted frame"); 599 assert(is_interpreted_frame(), "Not an interpreted frame");
600 assert(interpreter_frame_method() != NULL && interpreter_frame_method()->contains(interpreter_frame_bcp()), "must be");
601 jint i; 600 jint i;
602 st->print_cr(" - sp = " INTPTR_FORMAT, sp()); 601 for (i = 0; i < interpreter_frame_method()->max_locals(); i++ ) {
603 // expressions 602 intptr_t x = *interpreter_frame_local_at(i);
603 st->print(" - local [" INTPTR_FORMAT "]", x);
604 st->fill_to(23);
605 st->print_cr("; #%d", i);
606 }
604 for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) { 607 for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) {
605 intptr_t* x = interpreter_frame_expression_stack_at(i); 608 intptr_t x = *interpreter_frame_expression_stack_at(i);
606 st->print(" - stack at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x); 609 st->print(" - stack [" INTPTR_FORMAT "]", x);
607 st->fill_to(70); 610 st->fill_to(23);
608 st->print_cr("; #%d", i); 611 st->print_cr("; #%d", i);
609 } 612 }
610 // locks for synchronization 613 // locks for synchronization
611 st->print_cr(" - monitorend = " INTPTR_FORMAT, interpreter_frame_monitor_end());
612 for (BasicObjectLock* current = interpreter_frame_monitor_end(); 614 for (BasicObjectLock* current = interpreter_frame_monitor_end();
613 current < interpreter_frame_monitor_begin(); 615 current < interpreter_frame_monitor_begin();
614 current = next_monitor_in_interpreter_frame(current)) { 616 current = next_monitor_in_interpreter_frame(current)) {
615 st->print (" - lock at " INTPTR_FORMAT " = ", current->lock()); 617 st->print(" - obj [");
618 current->obj()->print_value_on(st);
619 st->print_cr("]");
620 st->print(" - lock [");
616 current->lock()->print_on(st); 621 current->lock()->print_on(st);
617 st->cr(); 622 st->print_cr("]");
618 st->print (" - obj at " INTPTR_FORMAT " = " INTPTR_FORMAT " ", current->obj_addr(), *current->obj_addr()); 623 }
619 current->obj()->print_value_on(st); 624 // monitor
620 st->cr(); 625 st->print_cr(" - monitor[" INTPTR_FORMAT "]", interpreter_frame_monitor_begin());
621 } 626 // bcp
622 st->print_cr(" - monitorbegin = " INTPTR_FORMAT, interpreter_frame_monitor_begin()); 627 st->print(" - bcp [" INTPTR_FORMAT "]", interpreter_frame_bcp());
623 628 st->fill_to(23);
624 // bcp/bcx 629 st->print_cr("; @%d", interpreter_frame_bci());
625 st->print (" - bcp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_bcx_addr(), interpreter_frame_bcp());
626 st->fill_to(70);
627 st->print_cr("; @%d - %s", interpreter_frame_bci(), Bytecodes::name(interpreter_frame_method()->code_at(interpreter_frame_bci())));
628 // locals 630 // locals
629 st->print_cr(" - locals at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_locals_addr(), *interpreter_frame_locals_addr()); 631 st->print_cr(" - locals [" INTPTR_FORMAT "]", interpreter_frame_local_at(0));
630 // constant pool cache
631 st->print_cr(" - constant pool at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_cache_addr(), *interpreter_frame_cache_addr());
632 // method data
633 st->print_cr(" - method data at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_mdx_addr(), *interpreter_frame_mdx_addr());
634 // method 632 // method
635 st->print (" - method at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_method_addr(), *interpreter_frame_method_addr()); 633 st->print(" - method [" INTPTR_FORMAT "]", (address)interpreter_frame_method());
636 st->fill_to(70); 634 st->fill_to(23);
637 st->print("; "); 635 st->print("; ");
638 interpreter_frame_method()->print_name(st); 636 interpreter_frame_method()->print_name(st);
639 st->cr(); 637 st->cr();
640 #ifdef AMD64
641 // last sp
642 st->print_cr(" - last sp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_last_sp_addr(), *interpreter_frame_last_sp_addr());
643 #endif
644 // sender sp
645 st->print_cr(" - sender sp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_sender_sp_addr(), *interpreter_frame_sender_sp_addr());
646 // old fp
647 st->print_cr(" - old fp at " INTPTR_FORMAT " = " INTPTR_FORMAT, link_addr(), *link_addr());
648 // return address
649 st->print_cr(" - return pc at " INTPTR_FORMAT " = " INTPTR_FORMAT, sender_pc_addr(), *sender_pc_addr());
650
651 // locals
652 for (i = interpreter_frame_method()->max_locals() - 1; i >= 0; i--) {
653 intptr_t* x = interpreter_frame_local_at(i);
654 st->print (" - local at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x);
655 st->fill_to(70);
656 st->print_cr("; #%d", i);
657 }
658
659 // fp
660 st->print_cr(" - fp = " INTPTR_FORMAT, fp());
661 #endif 638 #endif
662 } 639 }
663 640
664 // Return whether the frame is in the VM or os indicating a Hotspot problem. 641 // Return whether the frame is in the VM or os indicating a Hotspot problem.
665 // Otherwise, it's likely a bug in the native library that the Java code calls, 642 // Otherwise, it's likely a bug in the native library that the Java code calls,
733 } else if (_cb->is_buffer_blob()) { 710 } else if (_cb->is_buffer_blob()) {
734 st->print("v ~BufferBlob::%s", ((BufferBlob *)_cb)->name()); 711 st->print("v ~BufferBlob::%s", ((BufferBlob *)_cb)->name());
735 } else if (_cb->is_nmethod()) { 712 } else if (_cb->is_nmethod()) {
736 Method* m = ((nmethod *)_cb)->method(); 713 Method* m = ((nmethod *)_cb)->method();
737 if (m != NULL) { 714 if (m != NULL) {
738 address code = _cb->code_begin();
739 m->name_and_sig_as_C_string(buf, buflen); 715 m->name_and_sig_as_C_string(buf, buflen);
740 st->print("J %s [" PTR_FORMAT "+%d]", buf, code, pc() - code); 716 st->print("J %s", buf);
741 } else { 717 } else {
742 st->print("J " PTR_FORMAT, pc()); 718 st->print("J " PTR_FORMAT, pc());
743 } 719 }
744 } else if (_cb->is_runtime_stub()) { 720 } else if (_cb->is_runtime_stub()) {
745 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); 721 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name());