equal
deleted
inserted
replaced
1229 // - Class from -Xbootclasspath/a. The class has no defined PackageEntry, or must |
1229 // - Class from -Xbootclasspath/a. The class has no defined PackageEntry, or must |
1230 // be defined in an unnamed module. |
1230 // be defined in an unnamed module. |
1231 bool SystemDictionary::is_shared_class_visible(Symbol* class_name, |
1231 bool SystemDictionary::is_shared_class_visible(Symbol* class_name, |
1232 instanceKlassHandle ik, |
1232 instanceKlassHandle ik, |
1233 Handle class_loader, TRAPS) { |
1233 Handle class_loader, TRAPS) { |
|
1234 assert(!ModuleEntryTable::javabase_moduleEntry()->is_patched(), |
|
1235 "Cannot use sharing if java.base is patched"); |
1234 ResourceMark rm; |
1236 ResourceMark rm; |
1235 int path_index = ik->shared_classpath_index(); |
1237 int path_index = ik->shared_classpath_index(); |
1236 SharedClassPathEntry* ent = |
1238 SharedClassPathEntry* ent = |
1237 (SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index); |
1239 (SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index); |
1238 if (!Universe::is_module_initialized()) { |
1240 if (!Universe::is_module_initialized()) { |
1254 pkg_entry = loader_data->packages()->lookup_only(pkg_name); |
1256 pkg_entry = loader_data->packages()->lookup_only(pkg_name); |
1255 } |
1257 } |
1256 if (pkg_entry != NULL) { |
1258 if (pkg_entry != NULL) { |
1257 mod_entry = pkg_entry->module(); |
1259 mod_entry = pkg_entry->module(); |
1258 } |
1260 } |
|
1261 } |
|
1262 |
|
1263 // If the archived class is from a module that has been patched at runtime, |
|
1264 // the class cannot be loaded from the archive. |
|
1265 if (mod_entry != NULL && mod_entry->is_patched()) { |
|
1266 return false; |
1259 } |
1267 } |
1260 |
1268 |
1261 if (class_loader.is_null()) { |
1269 if (class_loader.is_null()) { |
1262 assert(ent != NULL, "Shared class for NULL classloader must have valid SharedClassPathEntry"); |
1270 assert(ent != NULL, "Shared class for NULL classloader must have valid SharedClassPathEntry"); |
1263 // The NULL classloader can load archived class originated from the |
1271 // The NULL classloader can load archived class originated from the |