hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 33602 16053580a684
parent 33593 60764a78fa5c
child 33604 ad1cd9269bd4
child 33611 9abd65805e19
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri Oct 23 14:33:19 2015 +0300
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Mon Oct 26 13:11:36 2015 -0400
@@ -88,10 +88,10 @@
 
 oop         SystemDictionary::_system_loader_lock_obj     =  NULL;
 
-Klass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
+InstanceKlass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
                                                           =  { NULL /*, NULL...*/ };
 
-Klass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
+InstanceKlass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
 
 oop         SystemDictionary::_java_system_loader         =  NULL;
 
@@ -99,7 +99,7 @@
 bool        SystemDictionary::_has_checkPackageAccess     =  false;
 
 // lazily initialized klass variables
-Klass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
+InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
 
 
 // ----------------------------------------------------------------------------
@@ -357,7 +357,7 @@
     // so we don't throw an exception here.
     // see: nsk redefclass014 & java.lang.instrument Instrument032
     if ((childk != NULL ) && (is_superclass) &&
-       ((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) &&
+       ((quicksuperk = childk->super()) != NULL) &&
 
          ((quicksuperk->name() == class_name) &&
             (quicksuperk->class_loader()  == class_loader()))) {
@@ -1257,8 +1257,7 @@
     }
 
     // notify a class loaded from shared object
-    ClassLoadingService::notify_class_loaded(InstanceKlass::cast(ik()),
-                                             true /* shared class */);
+    ClassLoadingService::notify_class_loaded(ik(), true /* shared class */);
   }
   return ik;
 }
@@ -1805,7 +1804,7 @@
     Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
     // Force a fence to prevent any read before the write completes
     OrderAccess::fence();
-    _abstract_ownable_synchronizer_klass = k;
+    _abstract_ownable_synchronizer_klass = InstanceKlass::cast(k);
   }
 }
 
@@ -1846,14 +1845,16 @@
   int  info = wk_init_info[id - FIRST_WKID];
   int  sid  = (info >> CEIL_LG_OPTION_LIMIT);
   Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid);
-  Klass**    klassp = &_well_known_klasses[id];
+  InstanceKlass** klassp = &_well_known_klasses[id];
   bool must_load = (init_opt < SystemDictionary::Opt);
   if ((*klassp) == NULL) {
+    Klass* k;
     if (must_load) {
-      (*klassp) = resolve_or_fail(symbol, true, CHECK_0); // load required class
+      k = resolve_or_fail(symbol, true, CHECK_0); // load required class
     } else {
-      (*klassp) = resolve_or_null(symbol,       CHECK_0); // load optional klass
+      k = resolve_or_null(symbol,       CHECK_0); // load optional klass
     }
+    (*klassp) = (k == NULL) ? NULL : InstanceKlass::cast(k);
   }
   return ((*klassp) != NULL);
 }