--- old/src/share/vm/classfile/dictionary.cpp 2017-07-19 11:07:37.131454600 -0400 +++ new/src/share/vm/classfile/dictionary.cpp 2017-07-19 11:07:36.880450020 -0400 @@ -95,7 +95,7 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const { #ifdef ASSERT - if (protection_domain == klass()->protection_domain()) { + if (protection_domain == instance_klass()->protection_domain()) { // Ensure this doesn't show up in the pd_set (invariant) bool in_pd_set = false; for (ProtectionDomainEntry* current = _pd_set; @@ -113,7 +113,7 @@ } #endif /* ASSERT */ - if (protection_domain == klass()->protection_domain()) { + if (protection_domain == instance_klass()->protection_domain()) { // Succeeds trivially return true; } @@ -160,7 +160,7 @@ for (int index = 0; index < table_size(); index++) { for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) { probe = *p; - InstanceKlass* ik = probe->klass(); + InstanceKlass* ik = probe->instance_klass(); ClassLoaderData* k_def_class_loader_data = ik->class_loader_data(); // If the klass that this loader initiated is dead, @@ -169,10 +169,10 @@ if (k_def_class_loader_data->is_unloading()) { assert(k_def_class_loader_data != loader_data(), "cannot have live defining loader and unreachable klass"); - *p = probe->next(); - free_entry(probe); - continue; - } + *p = probe->next(); + free_entry(probe); + continue; + } p = probe->next_addr(); } } @@ -184,7 +184,7 @@ for (int index = 0; index < table_size(); index++) { for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) { probe = *p; - InstanceKlass* ik = probe->klass(); + InstanceKlass* ik = probe->instance_klass(); if (ik->is_in_error_state()) { // purge this entry *p = probe->next(); free_entry(probe); @@ -204,7 +204,7 @@ for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { - InstanceKlass* k = probe->klass(); + InstanceKlass* k = probe->instance_klass(); if (loader_data() == k->class_loader_data()) { f(k); } @@ -219,7 +219,7 @@ for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { - InstanceKlass* k = probe->klass(); + InstanceKlass* k = probe->instance_klass(); if (loader_data() == k->class_loader_data()) { f(k, CHECK); } @@ -233,14 +233,14 @@ for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { - InstanceKlass* k = probe->klass(); + InstanceKlass* k = probe->instance_klass(); f(k, loader_data()); } } } -// Add a loaded class to the system dictionary. +// Add a loaded class to the dictionary. // Readers of the SystemDictionary aren't always locked, so _buckets // is volatile. The store of the next field in the constructor is // also cast to volatile; we do this to ensure store order is maintained @@ -257,7 +257,7 @@ } -// This routine does not lock the system dictionary. +// This routine does not lock the dictionary. // // Since readers don't hold a lock, we must make sure that system // dictionary entries are only removed at a safepoint (when only one @@ -285,7 +285,7 @@ Handle protection_domain) { DictionaryEntry* entry = get_entry(index, hash, name); if (entry != NULL && entry->is_valid_protection_domain(protection_domain)) { - return entry->klass(); + return entry->instance_klass(); } else { return NULL; } @@ -298,7 +298,7 @@ assert (index == index_for(name), "incorrect index?"); DictionaryEntry* entry = get_entry(index, hash, name); - return (entry != NULL) ? entry->klass() : NULL; + return (entry != NULL) ? entry->instance_klass() : NULL; } @@ -310,7 +310,7 @@ assert (index == index_for(name), "incorrect index?"); DictionaryEntry* entry = get_entry(index, hash, name); - return (entry != NULL) ? entry->klass() : NULL; + return (entry != NULL) ? entry->instance_klass() : NULL; } @@ -362,7 +362,7 @@ DictionaryEntry* p = master_list; master_list = master_list->next(); p->set_next(NULL); - Symbol* class_name = p->klass()->name(); + Symbol* class_name = p->instance_klass()->name(); // Since the null class loader data isn't copied to the CDS archive, // compute the hash with NULL for loader data. unsigned int hash = compute_hash(class_name); @@ -436,8 +436,9 @@ void Dictionary::print(bool details) { ResourceMark rm; + assert(loader_data() != NULL, "loader data should not be null"); if (details) { - tty->print_cr("Java system dictionary (table_size=%d, classes=%d)", + tty->print_cr("Java dictionary (table_size=%d, classes=%d)", table_size(), number_of_entries()); tty->print_cr("^ indicates that initiating loader is different from " "defining loader"); @@ -447,7 +448,7 @@ for (DictionaryEntry* probe = bucket(index); probe != NULL; probe = probe->next()) { - Klass* e = probe->klass(); + Klass* e = probe->instance_klass(); bool is_defining_class = (loader_data() == e->class_loader_data()); if (details) { @@ -467,15 +468,14 @@ } void DictionaryEntry::verify() { - Klass* e = klass(); - guarantee(e->is_instance_klass(), - "Verify of system dictionary failed"); + Klass* e = instance_klass(); + guarantee(e->is_instance_klass(), "Verify of dictionary failed"); e->verify(); verify_protection_domain_set(); } void Dictionary::verify() { - guarantee(number_of_entries() >= 0, "Verify of system dictionary failed"); + guarantee(number_of_entries() >= 0, "Verify of dictionary failed"); ClassLoaderData* cld = loader_data(); // class loader must be present; a null class loader is the