hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 39986 416a95f29c6a
parent 39616 f82b1f888578
child 40002 156b2dbb0b54
equal deleted inserted replaced
39980:dcef6760667c 39986:416a95f29c6a
  1244 // subclasses (yet).  [Classes in the shared space are not part of the
  1244 // subclasses (yet).  [Classes in the shared space are not part of the
  1245 // object hierarchy until loaded.]
  1245 // object hierarchy until loaded.]
  1246 
  1246 
  1247 instanceKlassHandle SystemDictionary::load_shared_class(
  1247 instanceKlassHandle SystemDictionary::load_shared_class(
  1248                  Symbol* class_name, Handle class_loader, TRAPS) {
  1248                  Symbol* class_name, Handle class_loader, TRAPS) {
  1249   instanceKlassHandle ik (THREAD, find_shared_class(class_name));
  1249   // Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
  1250   // Make sure we only return the boot class for the NULL classloader.
  1250   // is enabled since posting CFLH is not supported when loading shared class.
  1251   if (ik.not_null() &&
  1251   if (!JvmtiExport::should_post_class_file_load_hook()) {
  1252       ik->is_shared_boot_class() && class_loader.is_null()) {
  1252     instanceKlassHandle ik (THREAD, find_shared_class(class_name));
  1253     Handle protection_domain;
  1253     // Make sure we only return the boot class for the NULL classloader.
  1254     return load_shared_class(ik, class_loader, protection_domain, THREAD);
  1254     if (ik.not_null() &&
       
  1255         ik->is_shared_boot_class() && class_loader.is_null()) {
       
  1256       Handle protection_domain;
       
  1257       return load_shared_class(ik, class_loader, protection_domain, THREAD);
       
  1258     }
  1255   }
  1259   }
  1256   return instanceKlassHandle();
  1260   return instanceKlassHandle();
  1257 }
  1261 }
  1258 
  1262 
  1259 // Check if a shared class can be loaded by the specific classloader:
  1263 // Check if a shared class can be loaded by the specific classloader:
  1332 }
  1336 }
  1333 
  1337 
  1334 instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
  1338 instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
  1335                                                         Handle class_loader,
  1339                                                         Handle class_loader,
  1336                                                         Handle protection_domain, TRAPS) {
  1340                                                         Handle protection_domain, TRAPS) {
       
  1341   instanceKlassHandle nh = instanceKlassHandle(); // null Handle
       
  1342   if (JvmtiExport::should_post_class_file_load_hook()) {
       
  1343     // Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
       
  1344     // is enabled since posting CFLH is not supported when loading shared class.
       
  1345     return nh;
       
  1346   }
       
  1347 
  1337   if (ik.not_null()) {
  1348   if (ik.not_null()) {
  1338     instanceKlassHandle nh = instanceKlassHandle(); // null Handle
       
  1339     Symbol* class_name = ik->name();
  1349     Symbol* class_name = ik->name();
  1340 
  1350 
  1341     bool visible = is_shared_class_visible(
  1351     bool visible = is_shared_class_visible(
  1342                             class_name, ik, class_loader, CHECK_(nh));
  1352                             class_name, ik, class_loader, CHECK_(nh));
  1343     if (!visible) {
  1353     if (!visible) {