< prev index next >

src/hotspot/share/classfile/dictionary.cpp

Print this page




 229         f(k, CHECK);
 230       }
 231     }
 232   }
 233 }
 234 
 235 // All classes, and their class loaders, including initiating class loaders
 236 void Dictionary::all_entries_do(KlassClosure* closure) {
 237   for (int index = 0; index < table_size(); index++) {
 238     for (DictionaryEntry* probe = bucket(index);
 239                           probe != NULL;
 240                           probe = probe->next()) {
 241       InstanceKlass* k = probe->instance_klass();
 242       closure->do_klass(k);
 243     }
 244   }
 245 }
 246 
 247 // Used to scan and relocate the classes during CDS archive dump.
 248 void Dictionary::classes_do(MetaspaceClosure* it) {
 249   assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump-time only");
 250   for (int index = 0; index < table_size(); index++) {
 251     for (DictionaryEntry* probe = bucket(index);
 252                           probe != NULL;
 253                           probe = probe->next()) {
 254       it->push(probe->klass_addr());
 255     }
 256   }
 257 }
 258 
 259 
 260 
 261 // Add a loaded class to the dictionary.
 262 // Readers of the SystemDictionary aren't always locked, so _buckets
 263 // is volatile. The store of the next field in the constructor is
 264 // also cast to volatile;  we do this to ensure store order is maintained
 265 // by the compilers.
 266 
 267 void Dictionary::add_klass(unsigned int hash, Symbol* class_name,
 268                            InstanceKlass* obj) {
 269   assert_locked_or_safepoint(SystemDictionary_lock);




 229         f(k, CHECK);
 230       }
 231     }
 232   }
 233 }
 234 
 235 // All classes, and their class loaders, including initiating class loaders
 236 void Dictionary::all_entries_do(KlassClosure* closure) {
 237   for (int index = 0; index < table_size(); index++) {
 238     for (DictionaryEntry* probe = bucket(index);
 239                           probe != NULL;
 240                           probe = probe->next()) {
 241       InstanceKlass* k = probe->instance_klass();
 242       closure->do_klass(k);
 243     }
 244   }
 245 }
 246 
 247 // Used to scan and relocate the classes during CDS archive dump.
 248 void Dictionary::classes_do(MetaspaceClosure* it) {
 249   assert(Arguments::is_dumping_archive(), "dump-time only");
 250   for (int index = 0; index < table_size(); index++) {
 251     for (DictionaryEntry* probe = bucket(index);
 252                           probe != NULL;
 253                           probe = probe->next()) {
 254       it->push(probe->klass_addr());
 255     }
 256   }
 257 }
 258 
 259 
 260 
 261 // Add a loaded class to the dictionary.
 262 // Readers of the SystemDictionary aren't always locked, so _buckets
 263 // is volatile. The store of the next field in the constructor is
 264 // also cast to volatile;  we do this to ensure store order is maintained
 265 // by the compilers.
 266 
 267 void Dictionary::add_klass(unsigned int hash, Symbol* class_name,
 268                            InstanceKlass* obj) {
 269   assert_locked_or_safepoint(SystemDictionary_lock);


< prev index next >