src/share/vm/memory/dump.cpp

Print this page




 285     if (obj->is_method()) {
 286       methodOop m = methodOop(obj);
 287       constantPoolOop constants = m->constants();
 288       _closure->do_symbol(constants->symbol_at_addr(m->name_index()));
 289       _closure->do_symbol(constants->symbol_at_addr(m->signature_index()));
 290     }
 291 
 292     // Traverse symbols referenced by klass objects which are read-only.
 293 
 294     else if (obj->is_klass()) {
 295       Klass* k = Klass::cast((klassOop)obj);
 296       k->shared_symbols_iterate(_closure);
 297 
 298       if (obj->blueprint()->oop_is_instanceKlass()) {
 299         instanceKlass* ik = instanceKlass::cast((klassOop)obj);
 300         typeArrayOop inner_classes = ik->inner_classes();
 301         if (inner_classes != NULL) {
 302           constantPoolOop constants = ik->constants();
 303           int n = inner_classes->length();
 304           for (int i = 0; i < n; i += instanceKlass::inner_class_next_offset) {



 305             int ioff = i + instanceKlass::inner_class_inner_name_offset;
 306             int index = inner_classes->ushort_at(ioff);
 307             if (index != 0) {
 308               _closure->do_symbol(constants->symbol_at_addr(index));
 309             }
 310           }
 311         }
 312       }
 313     }
 314 
 315     // Traverse symbols referenced by other constantpool entries.
 316 
 317     else if (obj->is_constantPool()) {
 318       constantPoolOop(obj)->shared_symbols_iterate(_closure);
 319     }
 320   }
 321 };
 322 
 323 
 324 // Closure:  mark char arrays used by strings




 285     if (obj->is_method()) {
 286       methodOop m = methodOop(obj);
 287       constantPoolOop constants = m->constants();
 288       _closure->do_symbol(constants->symbol_at_addr(m->name_index()));
 289       _closure->do_symbol(constants->symbol_at_addr(m->signature_index()));
 290     }
 291 
 292     // Traverse symbols referenced by klass objects which are read-only.
 293 
 294     else if (obj->is_klass()) {
 295       Klass* k = Klass::cast((klassOop)obj);
 296       k->shared_symbols_iterate(_closure);
 297 
 298       if (obj->blueprint()->oop_is_instanceKlass()) {
 299         instanceKlass* ik = instanceKlass::cast((klassOop)obj);
 300         typeArrayOop inner_classes = ik->inner_classes();
 301         if (inner_classes != NULL) {
 302           constantPoolOop constants = ik->constants();
 303           int n = inner_classes->length();
 304           for (int i = 0; i < n; i += instanceKlass::inner_class_next_offset) {
 305             if (i == n - instanceKlass::enclosing_method_attribute_size) {
 306               break;
 307             }
 308             int ioff = i + instanceKlass::inner_class_inner_name_offset;
 309             int index = inner_classes->ushort_at(ioff);
 310             if (index != 0) {
 311               _closure->do_symbol(constants->symbol_at_addr(index));
 312             }
 313           }
 314         }
 315       }
 316     }
 317 
 318     // Traverse symbols referenced by other constantpool entries.
 319 
 320     else if (obj->is_constantPool()) {
 321       constantPoolOop(obj)->shared_symbols_iterate(_closure);
 322     }
 323   }
 324 };
 325 
 326 
 327 // Closure:  mark char arrays used by strings