< prev index next >

src/hotspot/share/classfile/dictionary.cpp

Print this page




 313     }
 314   }
 315 }
 316 
 317 // Added for initialize_itable_for_klass to handle exceptions
 318 //   Just the classes from defining class loaders
 319 void Dictionary::classes_do(void f(InstanceKlass*, TRAPS), TRAPS) {
 320   for (int index = 0; index < table_size(); index++) {
 321     for (DictionaryEntry* probe = bucket(index);
 322                           probe != NULL;
 323                           probe = probe->next()) {
 324       InstanceKlass* k = probe->instance_klass();
 325       if (loader_data() == k->class_loader_data()) {
 326         f(k, CHECK);
 327       }
 328     }
 329   }
 330 }
 331 
 332 // All classes, and their class loaders, including initiating class loaders
 333 void Dictionary::all_entries_do(void f(InstanceKlass*, ClassLoaderData*)) {
 334   for (int index = 0; index < table_size(); index++) {
 335     for (DictionaryEntry* probe = bucket(index);
 336                           probe != NULL;
 337                           probe = probe->next()) {
 338       InstanceKlass* k = probe->instance_klass();
 339       f(k, loader_data());
 340     }
 341   }
 342 }
 343 
 344 // Used to scan and relocate the classes during CDS archive dump.
 345 void Dictionary::classes_do(MetaspaceClosure* it) {
 346   assert(DumpSharedSpaces, "dump-time only");
 347   for (int index = 0; index < table_size(); index++) {
 348     for (DictionaryEntry* probe = bucket(index);
 349                           probe != NULL;
 350                           probe = probe->next()) {
 351       it->push(probe->klass_addr());
 352       ((SharedDictionaryEntry*)probe)->metaspace_pointers_do(it);
 353     }
 354   }
 355 }
 356 
 357 
 358 
 359 // Add a loaded class to the dictionary.




 313     }
 314   }
 315 }
 316 
 317 // Added for initialize_itable_for_klass to handle exceptions
 318 //   Just the classes from defining class loaders
 319 void Dictionary::classes_do(void f(InstanceKlass*, TRAPS), TRAPS) {
 320   for (int index = 0; index < table_size(); index++) {
 321     for (DictionaryEntry* probe = bucket(index);
 322                           probe != NULL;
 323                           probe = probe->next()) {
 324       InstanceKlass* k = probe->instance_klass();
 325       if (loader_data() == k->class_loader_data()) {
 326         f(k, CHECK);
 327       }
 328     }
 329   }
 330 }
 331 
 332 // All classes, and their class loaders, including initiating class loaders
 333 void Dictionary::all_entries_do(KlassClosure* closure) {
 334   for (int index = 0; index < table_size(); index++) {
 335     for (DictionaryEntry* probe = bucket(index);
 336                           probe != NULL;
 337                           probe = probe->next()) {
 338       InstanceKlass* k = probe->instance_klass();
 339       closure->do_klass(k);
 340     }
 341   }
 342 }
 343 
 344 // Used to scan and relocate the classes during CDS archive dump.
 345 void Dictionary::classes_do(MetaspaceClosure* it) {
 346   assert(DumpSharedSpaces, "dump-time only");
 347   for (int index = 0; index < table_size(); index++) {
 348     for (DictionaryEntry* probe = bucket(index);
 349                           probe != NULL;
 350                           probe = probe->next()) {
 351       it->push(probe->klass_addr());
 352       ((SharedDictionaryEntry*)probe)->metaspace_pointers_do(it);
 353     }
 354   }
 355 }
 356 
 357 
 358 
 359 // Add a loaded class to the dictionary.


< prev index next >