hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 33602 16053580a684
parent 33593 60764a78fa5c
child 33604 ad1cd9269bd4
child 33611 9abd65805e19
equal deleted inserted replaced
33597:5d42601232b1 33602:16053580a684
    86 const int   SystemDictionary::_primelist[_prime_array_size] = {1009,2017,4049,5051,10103,
    86 const int   SystemDictionary::_primelist[_prime_array_size] = {1009,2017,4049,5051,10103,
    87               20201,40423,99991};
    87               20201,40423,99991};
    88 
    88 
    89 oop         SystemDictionary::_system_loader_lock_obj     =  NULL;
    89 oop         SystemDictionary::_system_loader_lock_obj     =  NULL;
    90 
    90 
    91 Klass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
    91 InstanceKlass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
    92                                                           =  { NULL /*, NULL...*/ };
    92                                                           =  { NULL /*, NULL...*/ };
    93 
    93 
    94 Klass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
    94 InstanceKlass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
    95 
    95 
    96 oop         SystemDictionary::_java_system_loader         =  NULL;
    96 oop         SystemDictionary::_java_system_loader         =  NULL;
    97 
    97 
    98 bool        SystemDictionary::_has_loadClassInternal      =  false;
    98 bool        SystemDictionary::_has_loadClassInternal      =  false;
    99 bool        SystemDictionary::_has_checkPackageAccess     =  false;
    99 bool        SystemDictionary::_has_checkPackageAccess     =  false;
   100 
   100 
   101 // lazily initialized klass variables
   101 // lazily initialized klass variables
   102 Klass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
   102 InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
   103 
   103 
   104 
   104 
   105 // ----------------------------------------------------------------------------
   105 // ----------------------------------------------------------------------------
   106 // Java-level SystemLoader
   106 // Java-level SystemLoader
   107 
   107 
   355     // if initial define, SD update will give LinkageError
   355     // if initial define, SD update will give LinkageError
   356     // if redefine: compare_class_versions will give HIERARCHY_CHANGED
   356     // if redefine: compare_class_versions will give HIERARCHY_CHANGED
   357     // so we don't throw an exception here.
   357     // so we don't throw an exception here.
   358     // see: nsk redefclass014 & java.lang.instrument Instrument032
   358     // see: nsk redefclass014 & java.lang.instrument Instrument032
   359     if ((childk != NULL ) && (is_superclass) &&
   359     if ((childk != NULL ) && (is_superclass) &&
   360        ((quicksuperk = InstanceKlass::cast(childk)->super()) != NULL) &&
   360        ((quicksuperk = childk->super()) != NULL) &&
   361 
   361 
   362          ((quicksuperk->name() == class_name) &&
   362          ((quicksuperk->name() == class_name) &&
   363             (quicksuperk->class_loader()  == class_loader()))) {
   363             (quicksuperk->class_loader()  == class_loader()))) {
   364            return quicksuperk;
   364            return quicksuperk;
   365     } else {
   365     } else {
  1255         classlist_file->flush();
  1255         classlist_file->flush();
  1256       }
  1256       }
  1257     }
  1257     }
  1258 
  1258 
  1259     // notify a class loaded from shared object
  1259     // notify a class loaded from shared object
  1260     ClassLoadingService::notify_class_loaded(InstanceKlass::cast(ik()),
  1260     ClassLoadingService::notify_class_loaded(ik(), true /* shared class */);
  1261                                              true /* shared class */);
       
  1262   }
  1261   }
  1263   return ik;
  1262   return ik;
  1264 }
  1263 }
  1265 #endif // INCLUDE_CDS
  1264 #endif // INCLUDE_CDS
  1266 
  1265 
  1803   Klass* aos = _abstract_ownable_synchronizer_klass;
  1802   Klass* aos = _abstract_ownable_synchronizer_klass;
  1804   if (aos == NULL) {
  1803   if (aos == NULL) {
  1805     Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
  1804     Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
  1806     // Force a fence to prevent any read before the write completes
  1805     // Force a fence to prevent any read before the write completes
  1807     OrderAccess::fence();
  1806     OrderAccess::fence();
  1808     _abstract_ownable_synchronizer_klass = k;
  1807     _abstract_ownable_synchronizer_klass = InstanceKlass::cast(k);
  1809   }
  1808   }
  1810 }
  1809 }
  1811 
  1810 
  1812 // ----------------------------------------------------------------------------
  1811 // ----------------------------------------------------------------------------
  1813 // Initialization
  1812 // Initialization
  1844 bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
  1843 bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
  1845   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
  1844   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");
  1846   int  info = wk_init_info[id - FIRST_WKID];
  1845   int  info = wk_init_info[id - FIRST_WKID];
  1847   int  sid  = (info >> CEIL_LG_OPTION_LIMIT);
  1846   int  sid  = (info >> CEIL_LG_OPTION_LIMIT);
  1848   Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid);
  1847   Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid);
  1849   Klass**    klassp = &_well_known_klasses[id];
  1848   InstanceKlass** klassp = &_well_known_klasses[id];
  1850   bool must_load = (init_opt < SystemDictionary::Opt);
  1849   bool must_load = (init_opt < SystemDictionary::Opt);
  1851   if ((*klassp) == NULL) {
  1850   if ((*klassp) == NULL) {
       
  1851     Klass* k;
  1852     if (must_load) {
  1852     if (must_load) {
  1853       (*klassp) = resolve_or_fail(symbol, true, CHECK_0); // load required class
  1853       k = resolve_or_fail(symbol, true, CHECK_0); // load required class
  1854     } else {
  1854     } else {
  1855       (*klassp) = resolve_or_null(symbol,       CHECK_0); // load optional klass
  1855       k = resolve_or_null(symbol,       CHECK_0); // load optional klass
  1856     }
  1856     }
       
  1857     (*klassp) = (k == NULL) ? NULL : InstanceKlass::cast(k);
  1857   }
  1858   }
  1858   return ((*klassp) != NULL);
  1859   return ((*klassp) != NULL);
  1859 }
  1860 }
  1860 
  1861 
  1861 void SystemDictionary::initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS) {
  1862 void SystemDictionary::initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS) {