Mercurial > hg > truffle
comparison src/share/vm/runtime/frame.cpp @ 4668:3dbcd1013cc8
added flag PrintDeoptimizationDetails
changes so that TraceDeoptimization only prints basic information
added nicer formatting for printing interpreter stack frames
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Tue, 21 Feb 2012 16:05:46 -0800 |
parents | b20d64f83668 |
children | 84e7d6690293 |
comparison
equal
deleted
inserted
replaced
4667:35b2cae45dc5 | 4668:3dbcd1013cc8 |
---|---|
603 | 603 |
604 void frame::interpreter_frame_print_on(outputStream* st) const { | 604 void frame::interpreter_frame_print_on(outputStream* st) const { |
605 #ifndef PRODUCT | 605 #ifndef PRODUCT |
606 assert(is_interpreted_frame(), "Not an interpreted frame"); | 606 assert(is_interpreted_frame(), "Not an interpreted frame"); |
607 jint i; | 607 jint i; |
608 for (i = 0; i < interpreter_frame_method()->max_locals(); i++ ) { | 608 st->print_cr(" - sp = " INTPTR_FORMAT, sp()); |
609 intptr_t x = *interpreter_frame_local_at(i); | 609 // expressions |
610 st->print(" - local [" INTPTR_FORMAT "]", x); | 610 for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) { |
611 st->fill_to(23); | 611 intptr_t* x = interpreter_frame_expression_stack_at(i); |
612 st->print(" - stack at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x); | |
613 st->fill_to(70); | |
612 st->print_cr("; #%d", i); | 614 st->print_cr("; #%d", i); |
613 } | 615 } |
614 for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) { | |
615 intptr_t x = *interpreter_frame_expression_stack_at(i); | |
616 st->print(" - stack [" INTPTR_FORMAT "]", x); | |
617 st->fill_to(23); | |
618 st->print_cr("; #%d", i); | |
619 } | |
620 // locks for synchronization | 616 // locks for synchronization |
617 st->print_cr(" - monitorend = " INTPTR_FORMAT, interpreter_frame_monitor_end()); | |
621 for (BasicObjectLock* current = interpreter_frame_monitor_end(); | 618 for (BasicObjectLock* current = interpreter_frame_monitor_end(); |
622 current < interpreter_frame_monitor_begin(); | 619 current < interpreter_frame_monitor_begin(); |
623 current = next_monitor_in_interpreter_frame(current)) { | 620 current = next_monitor_in_interpreter_frame(current)) { |
624 st->print(" - obj ["); | 621 st->print (" - lock at " INTPTR_FORMAT " = ", current->lock()); |
622 current->lock()->print_on(st); | |
623 st->cr(); | |
624 st->print (" - obj at " INTPTR_FORMAT " = " INTPTR_FORMAT " ", current->obj_addr(), *current->obj_addr()); | |
625 current->obj()->print_value_on(st); | 625 current->obj()->print_value_on(st); |
626 st->print_cr("]"); | 626 st->cr(); |
627 st->print(" - lock ["); | 627 } |
628 current->lock()->print_on(st); | 628 st->print_cr(" - monitorbegin = " INTPTR_FORMAT, interpreter_frame_monitor_begin()); |
629 st->print_cr("]"); | 629 |
630 } | 630 // bcp/bcx |
631 // monitor | 631 st->print (" - bcp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_bcx_addr(), interpreter_frame_bcp()); |
632 st->print_cr(" - monitor[" INTPTR_FORMAT "]", interpreter_frame_monitor_begin()); | 632 st->fill_to(70); |
633 // bcp | |
634 st->print(" - bcp [" INTPTR_FORMAT "]", interpreter_frame_bcp()); | |
635 st->fill_to(23); | |
636 st->print_cr("; @%d", interpreter_frame_bci()); | 633 st->print_cr("; @%d", interpreter_frame_bci()); |
637 // locals | 634 // locals |
638 st->print_cr(" - locals [" INTPTR_FORMAT "]", interpreter_frame_local_at(0)); | 635 st->print_cr(" - locals at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_locals_addr(), *interpreter_frame_locals_addr()); |
636 // constant pool cache | |
637 st->print_cr(" - constant pool at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_cache_addr(), *interpreter_frame_cache_addr()); | |
638 // method data | |
639 st->print_cr(" - method data at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_mdx_addr(), *interpreter_frame_mdx_addr()); | |
639 // method | 640 // method |
640 st->print(" - method [" INTPTR_FORMAT "]", (address)interpreter_frame_method()); | 641 st->print (" - method at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_method_addr(), *interpreter_frame_method_addr()); |
641 st->fill_to(23); | 642 st->fill_to(70); |
642 st->print("; "); | 643 st->print("; "); |
643 interpreter_frame_method()->print_name(st); | 644 interpreter_frame_method()->print_name(st); |
644 st->cr(); | 645 st->cr(); |
646 // last sp | |
647 st->print_cr(" - last sp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_last_sp_addr(), *interpreter_frame_last_sp_addr()); | |
648 // sender sp | |
649 st->print_cr(" - sender sp at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_sender_sp_addr(), *interpreter_frame_sender_sp_addr()); | |
650 // old fp | |
651 st->print_cr(" - old fp at " INTPTR_FORMAT " = " INTPTR_FORMAT, link_addr(), *link_addr()); | |
652 // return address | |
653 st->print_cr(" - return pc at " INTPTR_FORMAT " = " INTPTR_FORMAT, sender_pc_addr(), *sender_pc_addr()); | |
654 | |
655 // locals | |
656 for (i = interpreter_frame_method()->max_locals() - 1; i >= 0; i--) { | |
657 intptr_t* x = interpreter_frame_local_at(i); | |
658 st->print (" - local at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x); | |
659 st->fill_to(70); | |
660 st->print_cr("; #%d", i); | |
661 } | |
662 | |
663 // fp | |
664 st->print_cr(" - fp = " INTPTR_FORMAT, fp()); | |
645 #endif | 665 #endif |
646 } | 666 } |
647 | 667 |
648 // Return whether the frame is in the VM or os indicating a Hotspot problem. | 668 // Return whether the frame is in the VM or os indicating a Hotspot problem. |
649 // Otherwise, it's likely a bug in the native library that the Java code calls, | 669 // Otherwise, it's likely a bug in the native library that the Java code calls, |