1275 if (mod_entry != NULL) {
1276 // PackageEntry/ModuleEntry is found in the classloader. Check if the
1277 // ModuleEntry's location agrees with the archived class' origination.
1278 if (ent->is_jrt() && mod_entry->location()->starts_with("jrt:")) {
1279 return true; // Module class from the "module" jimage
1280 }
1281 }
1282
1283 // If the archived class is not from the "module" jimage, the class can be
1284 // loaded by the NULL classloader if
1285 //
1286 // 1. the class is from the unamed package
1287 // 2. or, the class is not from a module defined in the NULL classloader
1288 // 3. or, the class is from an unamed module
1289 if (!ent->is_jrt() && ik->is_shared_boot_class()) {
1290 // the class is from the -Xbootclasspath/a
1291 if (pkg_string == NULL ||
1292 pkg_entry == NULL ||
1293 pkg_entry->in_unnamed_module()) {
1294 assert(mod_entry == NULL ||
1295 mod_entry == loader_data->modules()->unnamed_module(),
1296 "the unnamed module is not defined in the classloader");
1297 return true;
1298 }
1299 }
1300 return false;
1301 } else {
1302 bool res = SystemDictionaryShared::is_shared_class_visible_for_classloader(
1303 ik, class_loader, pkg_string, pkg_name,
1304 pkg_entry, mod_entry, CHECK_(false));
1305 return res;
1306 }
1307 }
1308
1309 InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik,
1310 Handle class_loader,
1311 Handle protection_domain, TRAPS) {
1312
1313 if (ik != NULL) {
1314 Symbol* class_name = ik->name();
1315
|
1275 if (mod_entry != NULL) {
1276 // PackageEntry/ModuleEntry is found in the classloader. Check if the
1277 // ModuleEntry's location agrees with the archived class' origination.
1278 if (ent->is_jrt() && mod_entry->location()->starts_with("jrt:")) {
1279 return true; // Module class from the "module" jimage
1280 }
1281 }
1282
1283 // If the archived class is not from the "module" jimage, the class can be
1284 // loaded by the NULL classloader if
1285 //
1286 // 1. the class is from the unamed package
1287 // 2. or, the class is not from a module defined in the NULL classloader
1288 // 3. or, the class is from an unamed module
1289 if (!ent->is_jrt() && ik->is_shared_boot_class()) {
1290 // the class is from the -Xbootclasspath/a
1291 if (pkg_string == NULL ||
1292 pkg_entry == NULL ||
1293 pkg_entry->in_unnamed_module()) {
1294 assert(mod_entry == NULL ||
1295 mod_entry == loader_data->unnamed_module(),
1296 "the unnamed module is not defined in the classloader");
1297 return true;
1298 }
1299 }
1300 return false;
1301 } else {
1302 bool res = SystemDictionaryShared::is_shared_class_visible_for_classloader(
1303 ik, class_loader, pkg_string, pkg_name,
1304 pkg_entry, mod_entry, CHECK_(false));
1305 return res;
1306 }
1307 }
1308
1309 InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik,
1310 Handle class_loader,
1311 Handle protection_domain, TRAPS) {
1312
1313 if (ik != NULL) {
1314 Symbol* class_name = ik->name();
1315
|