src/hotspot/share/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/share/classfile

src/hotspot/share/classfile/systemDictionary.cpp

Print this page
rev 49650 : [mq]: module_path


1193 //   - Class from -Xbootclasspath/a. The class has no defined PackageEntry, or must
1194 //     be defined in an unnamed module.
1195 bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
1196                                                InstanceKlass* ik,
1197                                                Handle class_loader, TRAPS) {
1198   assert(!ModuleEntryTable::javabase_moduleEntry()->is_patched(),
1199          "Cannot use sharing if java.base is patched");
1200   ResourceMark rm;
1201   int path_index = ik->shared_classpath_index();
1202   ClassLoaderData* loader_data = class_loader_data(class_loader);
1203   if (path_index < 0) {
1204     // path_index < 0 indicates that the class is intended for a custom loader
1205     // and should not be loaded by boot/platform/app loaders
1206     if (loader_data->is_builtin_class_loader_data()) {
1207       return false;
1208     } else {
1209       return true;
1210     }
1211   }
1212   SharedClassPathEntry* ent =
1213             (SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index);
1214   if (!Universe::is_module_initialized()) {
1215     assert(ent != NULL && ent->is_modules_image(),
1216            "Loading non-bootstrap classes before the module system is initialized");
1217     assert(class_loader.is_null(), "sanity");
1218     return true;
1219   }
1220   // Get the pkg_entry from the classloader
1221   TempNewSymbol pkg_name = NULL;
1222   PackageEntry* pkg_entry = NULL;
1223   ModuleEntry* mod_entry = NULL;
1224   const char* pkg_string = NULL;
1225   pkg_name = InstanceKlass::package_from_name(class_name, CHECK_false);
1226   if (pkg_name != NULL) {
1227     pkg_string = pkg_name->as_C_string();
1228     if (loader_data != NULL) {
1229       pkg_entry = loader_data->packages()->lookup_only(pkg_name);
1230     }
1231     if (pkg_entry != NULL) {
1232       mod_entry = pkg_entry->module();
1233     }




1193 //   - Class from -Xbootclasspath/a. The class has no defined PackageEntry, or must
1194 //     be defined in an unnamed module.
1195 bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
1196                                                InstanceKlass* ik,
1197                                                Handle class_loader, TRAPS) {
1198   assert(!ModuleEntryTable::javabase_moduleEntry()->is_patched(),
1199          "Cannot use sharing if java.base is patched");
1200   ResourceMark rm;
1201   int path_index = ik->shared_classpath_index();
1202   ClassLoaderData* loader_data = class_loader_data(class_loader);
1203   if (path_index < 0) {
1204     // path_index < 0 indicates that the class is intended for a custom loader
1205     // and should not be loaded by boot/platform/app loaders
1206     if (loader_data->is_builtin_class_loader_data()) {
1207       return false;
1208     } else {
1209       return true;
1210     }
1211   }
1212   SharedClassPathEntry* ent =
1213             (SharedClassPathEntry*)FileMapInfo::shared_path(path_index);
1214   if (!Universe::is_module_initialized()) {
1215     assert(ent != NULL && ent->is_modules_image(),
1216            "Loading non-bootstrap classes before the module system is initialized");
1217     assert(class_loader.is_null(), "sanity");
1218     return true;
1219   }
1220   // Get the pkg_entry from the classloader
1221   TempNewSymbol pkg_name = NULL;
1222   PackageEntry* pkg_entry = NULL;
1223   ModuleEntry* mod_entry = NULL;
1224   const char* pkg_string = NULL;
1225   pkg_name = InstanceKlass::package_from_name(class_name, CHECK_false);
1226   if (pkg_name != NULL) {
1227     pkg_string = pkg_name->as_C_string();
1228     if (loader_data != NULL) {
1229       pkg_entry = loader_data->packages()->lookup_only(pkg_name);
1230     }
1231     if (pkg_entry != NULL) {
1232       mod_entry = pkg_entry->module();
1233     }


src/hotspot/share/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File