1.1 --- a/src/share/vm/oops/instanceKlassKlass.cpp Thu Mar 19 09:13:24 2009 -0700 1.2 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Fri Mar 20 23:19:36 2009 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -487,6 +487,8 @@ 1.11 1.12 // Printing 1.13 1.14 +#define BULLET " - " 1.15 + 1.16 static const char* state_names[] = { 1.17 "unparseable_by_gc", "allocated", "loaded", "linked", "being_initialized", "fully_initialized", "initialization_error" 1.18 }; 1.19 @@ -497,13 +499,13 @@ 1.20 instanceKlass* ik = instanceKlass::cast(klassOop(obj)); 1.21 klassKlass::oop_print_on(obj, st); 1.22 1.23 - st->print(" - instance size: %d", ik->size_helper()); st->cr(); 1.24 - st->print(" - klass size: %d", ik->object_size()); st->cr(); 1.25 - st->print(" - access: "); ik->access_flags().print_on(st); st->cr(); 1.26 - st->print(" - state: "); st->print_cr(state_names[ik->_init_state]); 1.27 - st->print(" - name: "); ik->name()->print_value_on(st); st->cr(); 1.28 - st->print(" - super: "); ik->super()->print_value_on(st); st->cr(); 1.29 - st->print(" - sub: "); 1.30 + st->print(BULLET"instance size: %d", ik->size_helper()); st->cr(); 1.31 + st->print(BULLET"klass size: %d", ik->object_size()); st->cr(); 1.32 + st->print(BULLET"access: "); ik->access_flags().print_on(st); st->cr(); 1.33 + st->print(BULLET"state: "); st->print_cr(state_names[ik->_init_state]); 1.34 + st->print(BULLET"name: "); ik->name()->print_value_on(st); st->cr(); 1.35 + st->print(BULLET"super: "); ik->super()->print_value_on(st); st->cr(); 1.36 + st->print(BULLET"sub: "); 1.37 Klass* sub = ik->subklass(); 1.38 int n; 1.39 for (n = 0; sub != NULL; n++, sub = sub->next_sibling()) { 1.40 @@ -516,12 +518,12 @@ 1.41 st->cr(); 1.42 1.43 if (ik->is_interface()) { 1.44 - st->print_cr(" - nof implementors: %d", ik->nof_implementors()); 1.45 + st->print_cr(BULLET"nof implementors: %d", ik->nof_implementors()); 1.46 int print_impl = 0; 1.47 for (int i = 0; i < instanceKlass::implementors_limit; i++) { 1.48 if (ik->implementor(i) != NULL) { 1.49 if (++print_impl == 1) 1.50 - st->print_cr(" - implementor: "); 1.51 + st->print_cr(BULLET"implementor: "); 1.52 st->print(" "); 1.53 ik->implementor(i)->print_value_on(st); 1.54 } 1.55 @@ -529,34 +531,33 @@ 1.56 if (print_impl > 0) st->cr(); 1.57 } 1.58 1.59 - st->print(" - arrays: "); ik->array_klasses()->print_value_on(st); st->cr(); 1.60 - st->print(" - methods: "); ik->methods()->print_value_on(st); st->cr(); 1.61 + st->print(BULLET"arrays: "); ik->array_klasses()->print_value_on(st); st->cr(); 1.62 + st->print(BULLET"methods: "); ik->methods()->print_value_on(st); st->cr(); 1.63 if (Verbose) { 1.64 objArrayOop methods = ik->methods(); 1.65 for(int i = 0; i < methods->length(); i++) { 1.66 tty->print("%d : ", i); methods->obj_at(i)->print_value(); tty->cr(); 1.67 } 1.68 } 1.69 - st->print(" - method ordering: "); ik->method_ordering()->print_value_on(st); st->cr(); 1.70 - st->print(" - local interfaces: "); ik->local_interfaces()->print_value_on(st); st->cr(); 1.71 - st->print(" - trans. interfaces: "); ik->transitive_interfaces()->print_value_on(st); st->cr(); 1.72 - st->print(" - constants: "); ik->constants()->print_value_on(st); st->cr(); 1.73 - st->print(" - class loader: "); ik->class_loader()->print_value_on(st); st->cr(); 1.74 - st->print(" - protection domain: "); ik->protection_domain()->print_value_on(st); st->cr(); 1.75 - st->print(" - host class: "); ik->host_klass()->print_value_on(st); st->cr(); 1.76 - st->print(" - signers: "); ik->signers()->print_value_on(st); st->cr(); 1.77 + st->print(BULLET"method ordering: "); ik->method_ordering()->print_value_on(st); st->cr(); 1.78 + st->print(BULLET"local interfaces: "); ik->local_interfaces()->print_value_on(st); st->cr(); 1.79 + st->print(BULLET"trans. interfaces: "); ik->transitive_interfaces()->print_value_on(st); st->cr(); 1.80 + st->print(BULLET"constants: "); ik->constants()->print_value_on(st); st->cr(); 1.81 + st->print(BULLET"class loader: "); ik->class_loader()->print_value_on(st); st->cr(); 1.82 + st->print(BULLET"protection domain: "); ik->protection_domain()->print_value_on(st); st->cr(); 1.83 + st->print(BULLET"host class: "); ik->host_klass()->print_value_on(st); st->cr(); 1.84 + st->print(BULLET"signers: "); ik->signers()->print_value_on(st); st->cr(); 1.85 if (ik->source_file_name() != NULL) { 1.86 - st->print(" - source file: "); 1.87 + st->print(BULLET"source file: "); 1.88 ik->source_file_name()->print_value_on(st); 1.89 st->cr(); 1.90 } 1.91 if (ik->source_debug_extension() != NULL) { 1.92 - st->print(" - source debug extension: "); 1.93 + st->print(BULLET"source debug extension: "); 1.94 ik->source_debug_extension()->print_value_on(st); 1.95 st->cr(); 1.96 } 1.97 1.98 - st->print_cr(" - previous version: "); 1.99 { 1.100 ResourceMark rm; 1.101 // PreviousVersionInfo objects returned via PreviousVersionWalker 1.102 @@ -564,38 +565,43 @@ 1.103 // GrowableArray _after_ the PreviousVersionWalker destructor 1.104 // has destroyed the handles. 1.105 { 1.106 + bool have_pv = false; 1.107 PreviousVersionWalker pvw(ik); 1.108 for (PreviousVersionInfo * pv_info = pvw.next_previous_version(); 1.109 pv_info != NULL; pv_info = pvw.next_previous_version()) { 1.110 + if (!have_pv) 1.111 + st->print(BULLET"previous version: "); 1.112 + have_pv = true; 1.113 pv_info->prev_constant_pool_handle()()->print_value_on(st); 1.114 } 1.115 - st->cr(); 1.116 + if (have_pv) st->cr(); 1.117 } // pvw is cleaned up 1.118 } // rm is cleaned up 1.119 1.120 if (ik->generic_signature() != NULL) { 1.121 - st->print(" - generic signature: "); 1.122 + st->print(BULLET"generic signature: "); 1.123 ik->generic_signature()->print_value_on(st); 1.124 + st->cr(); 1.125 } 1.126 - st->print(" - inner classes: "); ik->inner_classes()->print_value_on(st); st->cr(); 1.127 - st->print(" - java mirror: "); ik->java_mirror()->print_value_on(st); st->cr(); 1.128 - st->print(" - vtable length %d (start addr: " INTPTR_FORMAT ")", ik->vtable_length(), ik->start_of_vtable()); st->cr(); 1.129 - st->print(" - itable length %d (start addr: " INTPTR_FORMAT ")", ik->itable_length(), ik->start_of_itable()); st->cr(); 1.130 - st->print_cr(" - static fields:"); 1.131 + st->print(BULLET"inner classes: "); ik->inner_classes()->print_value_on(st); st->cr(); 1.132 + st->print(BULLET"java mirror: "); ik->java_mirror()->print_value_on(st); st->cr(); 1.133 + st->print(BULLET"vtable length %d (start addr: " INTPTR_FORMAT ")", ik->vtable_length(), ik->start_of_vtable()); st->cr(); 1.134 + st->print(BULLET"itable length %d (start addr: " INTPTR_FORMAT ")", ik->itable_length(), ik->start_of_itable()); st->cr(); 1.135 + st->print_cr(BULLET"---- static fields (%d words):", ik->static_field_size()); 1.136 FieldPrinter print_static_field(st); 1.137 ik->do_local_static_fields(&print_static_field); 1.138 - st->print_cr(" - non-static fields:"); 1.139 - FieldPrinter print_nonstatic_field(st, obj); 1.140 + st->print_cr(BULLET"---- non-static fields (%d words):", ik->nonstatic_field_size()); 1.141 + FieldPrinter print_nonstatic_field(st); 1.142 ik->do_nonstatic_fields(&print_nonstatic_field); 1.143 1.144 - st->print(" - static oop maps: "); 1.145 + st->print(BULLET"static oop maps: "); 1.146 if (ik->static_oop_field_size() > 0) { 1.147 int first_offset = ik->offset_of_static_fields(); 1.148 st->print("%d-%d", first_offset, first_offset + ik->static_oop_field_size() - 1); 1.149 } 1.150 st->cr(); 1.151 1.152 - st->print(" - non-static oop maps: "); 1.153 + st->print(BULLET"non-static oop maps: "); 1.154 OopMapBlock* map = ik->start_of_nonstatic_oop_maps(); 1.155 OopMapBlock* end_map = map + ik->nonstatic_oop_map_size(); 1.156 while (map < end_map) {