hotspot/src/share/vm/classfile/classLoader.cpp
changeset 42636 aafc434ba580
parent 42634 7459867ebf98
child 42876 ff8ff9dcccec
equal deleted inserted replaced
42635:da364e57250c 42636:aafc434ba580
   502     ResourceMark rm;
   502     ResourceMark rm;
   503     const char* pkg_name = ClassLoader::package_from_name(name);
   503     const char* pkg_name = ClassLoader::package_from_name(name);
   504 
   504 
   505     if (pkg_name != NULL) {
   505     if (pkg_name != NULL) {
   506       if (!Universe::is_module_initialized()) {
   506       if (!Universe::is_module_initialized()) {
   507         location = (*JImageFindResource)(_jimage, "java.base", get_jimage_version_string(), name, &size);
   507         location = (*JImageFindResource)(_jimage, JAVA_BASE_NAME, get_jimage_version_string(), name, &size);
   508 #if INCLUDE_CDS
   508 #if INCLUDE_CDS
   509         // CDS uses the boot class loader to load classes whose packages are in
   509         // CDS uses the boot class loader to load classes whose packages are in
   510         // modules defined for other class loaders.  So, for now, get their module
   510         // modules defined for other class loaders.  So, for now, get their module
   511         // names from the "modules" jimage file.
   511         // names from the "modules" jimage file.
   512         if (DumpSharedSpaces && location == 0) {
   512         if (DumpSharedSpaces && location == 0) {
   784 
   784 
   785     // The first time through the bootstrap_search setup, it must be determined
   785     // The first time through the bootstrap_search setup, it must be determined
   786     // what the base or core piece of the boot loader search is.  Either a java runtime
   786     // what the base or core piece of the boot loader search is.  Either a java runtime
   787     // image is present or this is an exploded module build situation.
   787     // image is present or this is an exploded module build situation.
   788     if (set_base_piece) {
   788     if (set_base_piece) {
   789       assert(string_ends_with(path, MODULES_IMAGE_NAME) || string_ends_with(path, "java.base"),
   789       assert(string_ends_with(path, MODULES_IMAGE_NAME) || string_ends_with(path, JAVA_BASE_NAME),
   790              "Incorrect boot loader search path, no java runtime image or java.base exploded build");
   790              "Incorrect boot loader search path, no java runtime image or " JAVA_BASE_NAME " exploded build");
   791       struct stat st;
   791       struct stat st;
   792       if (os::stat(path, &st) == 0) {
   792       if (os::stat(path, &st) == 0) {
   793         // Directory found
   793         // Directory found
   794         Thread* THREAD = Thread::current();
   794         Thread* THREAD = Thread::current();
   795         ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
   795         ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
  1154     return; // only needed for CDS dump time
  1154     return; // only needed for CDS dump time
  1155   }
  1155   }
  1156 
  1156 
  1157   ResourceMark rm;
  1157   ResourceMark rm;
  1158   jlong size;
  1158   jlong size;
  1159   JImageLocationRef location = (*JImageFindResource)(jimage, "java.base", get_jimage_version_string(), MODULE_LOADER_MAP, &size);
  1159   JImageLocationRef location = (*JImageFindResource)(jimage, JAVA_BASE_NAME, get_jimage_version_string(), MODULE_LOADER_MAP, &size);
  1160   if (location == 0) {
  1160   if (location == 0) {
  1161     vm_exit_during_initialization(
  1161     vm_exit_during_initialization(
  1162       "Cannot find ModuleLoaderMap location from modules jimage.", NULL);
  1162       "Cannot find ModuleLoaderMap location from modules jimage.", NULL);
  1163   }
  1163   }
  1164   char* buffer = NEW_RESOURCE_ARRAY(char, size + 1);
  1164   char* buffer = NEW_RESOURCE_ARRAY(char, size + 1);
  1837 
  1837 
  1838   {
  1838   {
  1839     MutexLocker ml(Module_lock, THREAD);
  1839     MutexLocker ml(Module_lock, THREAD);
  1840     ModuleEntry* jb_module = null_cld_modules->locked_create_entry_or_null(Handle(NULL), vmSymbols::java_base(), NULL, NULL, null_cld);
  1840     ModuleEntry* jb_module = null_cld_modules->locked_create_entry_or_null(Handle(NULL), vmSymbols::java_base(), NULL, NULL, null_cld);
  1841     if (jb_module == NULL) {
  1841     if (jb_module == NULL) {
  1842       vm_exit_during_initialization("Unable to create ModuleEntry for java.base");
  1842       vm_exit_during_initialization("Unable to create ModuleEntry for " JAVA_BASE_NAME);
  1843     }
  1843     }
  1844     ModuleEntryTable::set_javabase_moduleEntry(jb_module);
  1844     ModuleEntryTable::set_javabase_moduleEntry(jb_module);
  1845   }
  1845   }
  1846 }
  1846 }
  1847 
  1847