< prev index next >

src/share/vm/classfile/dictionary.cpp

Print this page

        

@@ -93,11 +93,11 @@
 }
 
 
 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;
                                 current != NULL;
                                 current = current->next()) {

@@ -111,11 +111,11 @@
                     "in its sys. dict. PD set");
     }
   }
 #endif /* ASSERT */
 
-  if (protection_domain == klass()->protection_domain()) {
+  if (protection_domain == instance_klass()->protection_domain()) {
     // Succeeds trivially
     return true;
   }
 
   for (ProtectionDomainEntry* current = _pd_set;

@@ -158,11 +158,11 @@
   // Remove unloaded entries and classes from this dictionary
   DictionaryEntry* probe = NULL;
   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,
       // (determined by checking the defining class loader)
       // remove this entry.

@@ -182,11 +182,11 @@
   assert(DumpSharedSpaces, "supported only when dumping");
   DictionaryEntry* probe = NULL;
   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);
         ResourceMark rm;
         tty->print_cr("Preload Warning: Removed error class: %s", ik->external_name());

@@ -202,11 +202,11 @@
 void Dictionary::classes_do(void f(InstanceKlass*)) {
   for (int index = 0; index < table_size(); index++) {
     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);
       }
     }
   }

@@ -217,11 +217,11 @@
 void Dictionary::classes_do(void f(InstanceKlass*, TRAPS), TRAPS) {
   for (int index = 0; index < table_size(); index++) {
     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);
       }
     }
   }

@@ -231,18 +231,18 @@
 void Dictionary::all_entries_do(void f(InstanceKlass*, ClassLoaderData*)) {
   for (int index = 0; index < table_size(); index++) {
     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
 // by the compilers.
 

@@ -255,11 +255,11 @@
   DictionaryEntry* entry = new_entry(hash, obj);
   add_entry(index, entry);
 }
 
 
-// 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
 // thread is running), and are added to in a safe way (all links must
 // be updated in an MT-safe manner).

@@ -283,11 +283,11 @@
 
 InstanceKlass* Dictionary::find(int index, unsigned int hash, Symbol* name,
                                 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;
   }
 }
 

@@ -296,11 +296,11 @@
                                       Symbol* name) {
   assert_locked_or_safepoint(SystemDictionary_lock);
   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;
 }
 
 
 // Variant of find_class for shared classes.  No locking required, as
 // that table is static.

@@ -308,11 +308,11 @@
 InstanceKlass* Dictionary::find_shared_class(int index, unsigned int hash,
                                              Symbol* name) {
   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;
 }
 
 
 void Dictionary::add_protection_domain(int index, unsigned int hash,
                                        InstanceKlass* klass,

@@ -360,11 +360,11 @@
   // Add the dictionary entries back to the list in the correct buckets.
   while (master_list != NULL) {
     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);
     int index = hash_to_index(hash);
     p->set_hash(hash);

@@ -434,22 +434,23 @@
 // ----------------------------------------------------------------------------
 
 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");
   }
 
   for (int index = 0; index < table_size(); index++) {
     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) {
         tty->print("%4d: ", index);
       }

@@ -465,19 +466,18 @@
   }
   tty->cr();
 }
 
 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
   // boostrap loader
   guarantee(cld != NULL || DumpSharedSpaces ||
< prev index next >