comparison src/share/vm/classfile/dictionary.cpp @ 6983:070d523b96a7

8001471: Klass::cast() does nothing Summary: Remove function Klass::cast() and calls to it. Reviewed-by: dholmes, coleenp
author hseigel
date Mon, 12 Nov 2012 16:15:05 -0500
parents da91efe96a93
children 90273fc0a981
comparison
equal deleted inserted replaced
6981:8c413497f434 6983:070d523b96a7
344 344
345 void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data, 345 void Dictionary::add_klass(Symbol* class_name, ClassLoaderData* loader_data,
346 KlassHandle obj) { 346 KlassHandle obj) {
347 assert_locked_or_safepoint(SystemDictionary_lock); 347 assert_locked_or_safepoint(SystemDictionary_lock);
348 assert(obj() != NULL, "adding NULL obj"); 348 assert(obj() != NULL, "adding NULL obj");
349 assert(Klass::cast(obj())->name() == class_name, "sanity check on name"); 349 assert(obj()->name() == class_name, "sanity check on name");
350 350
351 unsigned int hash = compute_hash(class_name, loader_data); 351 unsigned int hash = compute_hash(class_name, loader_data);
352 int index = hash_to_index(hash); 352 int index = hash_to_index(hash);
353 DictionaryEntry* entry = new_entry(hash, obj(), loader_data); 353 DictionaryEntry* entry = new_entry(hash, obj(), loader_data);
354 add_entry(index, entry); 354 add_entry(index, entry);
551 Klass* e = probe->klass(); 551 Klass* e = probe->klass();
552 ClassLoaderData* loader_data = probe->loader_data(); 552 ClassLoaderData* loader_data = probe->loader_data();
553 bool is_defining_class = 553 bool is_defining_class =
554 (loader_data == InstanceKlass::cast(e)->class_loader_data()); 554 (loader_data == InstanceKlass::cast(e)->class_loader_data());
555 tty->print("%s%s", is_defining_class ? " " : "^", 555 tty->print("%s%s", is_defining_class ? " " : "^",
556 Klass::cast(e)->external_name()); 556 e->external_name());
557 557
558 tty->print(", loader "); 558 tty->print(", loader ");
559 loader_data->print_value(); 559 loader_data->print_value();
560 tty->cr(); 560 tty->cr();
561 } 561 }
573 for (DictionaryEntry* probe = bucket(index); 573 for (DictionaryEntry* probe = bucket(index);
574 probe != NULL; 574 probe != NULL;
575 probe = probe->next()) { 575 probe = probe->next()) {
576 Klass* e = probe->klass(); 576 Klass* e = probe->klass();
577 ClassLoaderData* loader_data = probe->loader_data(); 577 ClassLoaderData* loader_data = probe->loader_data();
578 guarantee(Klass::cast(e)->oop_is_instance(), 578 guarantee(e->oop_is_instance(),
579 "Verify of system dictionary failed"); 579 "Verify of system dictionary failed");
580 // class loader must be present; a null class loader is the 580 // class loader must be present; a null class loader is the
581 // boostrap loader 581 // boostrap loader
582 guarantee(loader_data != NULL || DumpSharedSpaces || 582 guarantee(loader_data != NULL || DumpSharedSpaces ||
583 loader_data->is_the_null_class_loader_data() || 583 loader_data->is_the_null_class_loader_data() ||