@@ -623,31 +623,46 @@ Method* ConstantPoolCacheEntry::get_interesting_method_entry() {
623
623
void ConstantPoolCacheEntry::print (outputStream* st, int index, const ConstantPoolCache* cache) const {
624
624
// print separator
625
625
if (index == 0 ) st->print_cr (" -------------" );
626
- // print entry
627
- st->print (" %3d (" PTR_FORMAT " ) " , index , (intptr_t )this );
628
- st->print_cr (" [%02x|%02x|%5d]" , bytecode_2 (), bytecode_1 (),
629
- constant_pool_index ());
630
- st->print_cr (" [ " PTR_FORMAT " ]" , (intptr_t )_f1);
631
- st->print_cr (" [ " PTR_FORMAT " ]" , (intptr_t )_f2);
632
- st->print_cr (" [ " PTR_FORMAT " ]" , (intptr_t )_flags);
633
-
634
- if ((bytecode_1 () == Bytecodes::_invokehandle ||
635
- bytecode_1 () == Bytecodes::_invokedynamic)) {
626
+ // print universal entry info
627
+ st->print_cr (" %3d" , index );
628
+ st->print_cr (" - this: " PTR_FORMAT, p2i (this ));
629
+ st->print_cr (" - bytecode 1: %s %02x" , Bytecodes::name (bytecode_1 ()), bytecode_1 ());
630
+ st->print_cr (" - bytecode 2: %s %02x" , Bytecodes::name (bytecode_2 ()), bytecode_2 ());
631
+ st->print_cr (" - cp index: %5d" , constant_pool_index ());
632
+ if (is_method_entry ()) {
633
+ ResourceMark rm;
636
634
constantPoolHandle cph (Thread::current (), cache->constant_pool ());
637
635
Method* m = method_if_resolved (cph);
638
- oop appendix = appendix_if_resolved (cph);
639
- ResourceMark rm;
640
- if (m != NULL ) {
641
- st->print_cr (" Method%s: " INTPTR_FORMAT " %s.%s%s" ,
642
- m->is_native () ? " (native)" : " " ,
643
- p2i (m),
644
- m->method_holder ()->name ()->as_C_string (),
645
- m->name ()->as_C_string (), m->signature ()->as_C_string ());
646
- }
647
- if (appendix != NULL ) {
648
- st->print (" appendix: " );
649
- appendix->print_on (st);
636
+ st->print_cr (" - F1: [ " PTR_FORMAT " ]" , (intptr_t )_f1);
637
+ st->print_cr (" - F2: [ " PTR_FORMAT " ]" , (intptr_t )_f2);
638
+ st->print_cr (" - method: " INTPTR_FORMAT " %s" , p2i (m), m != nullptr ? m->external_name () : nullptr );
639
+ st->print_cr (" - flag values: [%02x|0|0|%01x|%01x|%01x|%01x|0|%01x|%01x|00|00|%02x]" ,
640
+ flag_state (), has_local_signature (), has_appendix (),
641
+ is_forced_virtual (), is_final (), is_vfinal (),
642
+ indy_resolution_failed (), parameter_size ());
643
+ st->print_cr (" - tos: %s\n - local signature: %01x\n "
644
+ " - has appendix: %01x\n - forced virtual: %01x\n "
645
+ " - final: %01x\n - virtual final: %01x\n - resolution failed: %01x\n "
646
+ " - num parameters: %02x" ,
647
+ type2name (as_BasicType (flag_state ())), has_local_signature (), has_appendix (),
648
+ is_forced_virtual (), is_final (), is_vfinal (),
649
+ indy_resolution_failed (), parameter_size ());
650
+ if (bytecode_1 () == Bytecodes::_invokehandle ||
651
+ bytecode_1 () == Bytecodes::_invokedynamic) {
652
+ oop appendix = appendix_if_resolved (cph);
653
+ if (appendix != nullptr ) {
654
+ st->print (" appendix: " );
655
+ appendix->print_on (st);
656
+ }
650
657
}
658
+ } else {
659
+ assert (is_field_entry (), " must be a field entry" );
660
+ st->print_cr (" - F1: [ " PTR_FORMAT " ]" , (intptr_t )_f1);
661
+ st->print_cr (" - F2: [ " PTR_FORMAT " ]" , (intptr_t )_f2);
662
+ st->print_cr (" - flag values: [%02x|0|1|0|0|0|%01x|%01x|0|0|%04x]" ,
663
+ flag_state (), is_final (), is_volatile (), field_index ());
664
+ st->print_cr (" - tos: %s\n - final: %d\n - volatile: %d\n - field index: %04x" ,
665
+ type2name (as_BasicType (flag_state ())), is_final (), is_volatile (), field_index ());
651
666
}
652
667
st->print_cr (" -------------" );
653
668
}
0 commit comments