< prev index next >

src/hotspot/share/classfile/dictionary.cpp

Print this page




 304   NoSafepointVerifier nsv;
 305 
 306   int index = hash_to_index(hash);
 307   DictionaryEntry* entry = get_entry(index, hash, name);
 308   if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) {
 309     return entry->instance_klass();
 310   } else {
 311     return NULL;
 312   }
 313 }
 314 
 315 InstanceKlass* Dictionary::find_class(int index, unsigned int hash,
 316                                       Symbol* name) {
 317   assert_locked_or_safepoint(SystemDictionary_lock);
 318   assert (index == index_for(name), "incorrect index?");
 319 
 320   DictionaryEntry* entry = get_entry(index, hash, name);
 321   return (entry != NULL) ? entry->instance_klass() : NULL;
 322 }
 323 










 324 
 325 void Dictionary::add_protection_domain(int index, unsigned int hash,
 326                                        InstanceKlass* klass,
 327                                        Handle protection_domain,
 328                                        TRAPS) {
 329   Symbol*  klass_name = klass->name();
 330   DictionaryEntry* entry = get_entry(index, hash, klass_name);
 331 
 332   assert(entry != NULL,"entry must be present, we just created it");
 333   assert(protection_domain() != NULL,
 334          "real protection domain should be present");
 335 
 336   entry->add_protection_domain(this, protection_domain);
 337 
 338 #ifdef ASSERT
 339   assert(loader_data() != ClassLoaderData::the_null_class_loader_data(), "doesn't make sense");
 340 #endif
 341 
 342   assert(entry->contains_protection_domain(protection_domain()),
 343          "now protection domain should be present");




 304   NoSafepointVerifier nsv;
 305 
 306   int index = hash_to_index(hash);
 307   DictionaryEntry* entry = get_entry(index, hash, name);
 308   if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) {
 309     return entry->instance_klass();
 310   } else {
 311     return NULL;
 312   }
 313 }
 314 
 315 InstanceKlass* Dictionary::find_class(int index, unsigned int hash,
 316                                       Symbol* name) {
 317   assert_locked_or_safepoint(SystemDictionary_lock);
 318   assert (index == index_for(name), "incorrect index?");
 319 
 320   DictionaryEntry* entry = get_entry(index, hash, name);
 321   return (entry != NULL) ? entry->instance_klass() : NULL;
 322 }
 323 
 324 InstanceKlass* Dictionary::replace_class(int index, unsigned hash,
 325                                Symbol* name, InstanceKlass* k) {
 326   DictionaryEntry* entry = get_entry(index, hash, name);
 327   assert(entry != NULL, "InstanceKlass k should exist in dictionary");
 328    
 329   InstanceKlass** addr = entry->klass_addr();
 330   InstanceKlass*  old  = *addr; 
 331   *addr = k;
 332   return old;
 333 }
 334 
 335 void Dictionary::add_protection_domain(int index, unsigned int hash,
 336                                        InstanceKlass* klass,
 337                                        Handle protection_domain,
 338                                        TRAPS) {
 339   Symbol*  klass_name = klass->name();
 340   DictionaryEntry* entry = get_entry(index, hash, klass_name);
 341 
 342   assert(entry != NULL,"entry must be present, we just created it");
 343   assert(protection_domain() != NULL,
 344          "real protection domain should be present");
 345 
 346   entry->add_protection_domain(this, protection_domain);
 347 
 348 #ifdef ASSERT
 349   assert(loader_data() != ClassLoaderData::the_null_class_loader_data(), "doesn't make sense");
 350 #endif
 351 
 352   assert(entry->contains_protection_domain(protection_domain()),
 353          "now protection domain should be present");


< prev index next >