src/hotspot/share/classfile/classLoaderExt.cpp
changeset 54927 1512d88b24c6
parent 53908 45a23c64d0f6
child 55524 b279ae9843b8
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54926:d4e7ccaf1445 54927:1512d88b24c6
    60   }
    60   }
    61   ClassLoader::add_to_boot_append_entries(new_entry);
    61   ClassLoader::add_to_boot_append_entries(new_entry);
    62 }
    62 }
    63 
    63 
    64 void ClassLoaderExt::setup_app_search_path() {
    64 void ClassLoaderExt::setup_app_search_path() {
    65   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
    65   assert(DumpSharedSpaces || DynamicDumpSharedSpaces,
       
    66          "this function is only used at CDS dump time");
    66   _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries();
    67   _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries();
    67   char* app_class_path = os::strdup(Arguments::get_appclasspath());
    68   char* app_class_path = os::strdup(Arguments::get_appclasspath());
    68 
    69 
    69   if (strcmp(app_class_path, ".") == 0) {
    70   if (strcmp(app_class_path, ".") == 0) {
    70     // This doesn't make any sense, even for AppCDS, so let's skip it. We
    71     // This doesn't make any sense, even for AppCDS, so let's skip it. We
    90       m = m->next();
    91       m = m->next();
    91     }
    92     }
    92   }
    93   }
    93 }
    94 }
    94 void ClassLoaderExt::setup_module_paths(TRAPS) {
    95 void ClassLoaderExt::setup_module_paths(TRAPS) {
    95   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
    96   assert(DumpSharedSpaces || DynamicDumpSharedSpaces,
       
    97          "this function is only used with CDS dump time");
    96   _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() +
    98   _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() +
    97                               ClassLoader::num_app_classpath_entries();
    99                               ClassLoader::num_app_classpath_entries();
    98   Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
   100   Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
    99   ModuleEntryTable* met = Modules::get_module_entry_table(system_class_loader);
   101   ModuleEntryTable* met = Modules::get_module_entry_table(system_class_loader);
   100   process_module_table(met, THREAD);
   102   process_module_table(met, THREAD);
   225 }
   227 }
   226 
   228 
   227 void ClassLoaderExt::record_result(const s2 classpath_index,
   229 void ClassLoaderExt::record_result(const s2 classpath_index,
   228                                    InstanceKlass* result,
   230                                    InstanceKlass* result,
   229                                    TRAPS) {
   231                                    TRAPS) {
   230   assert(DumpSharedSpaces, "Sanity");
   232   assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "Sanity");
   231 
   233 
   232   // We need to remember where the class comes from during dumping.
   234   // We need to remember where the class comes from during dumping.
   233   oop loader = result->class_loader();
   235   oop loader = result->class_loader();
   234   s2 classloader_type = ClassLoader::BOOT_LOADER;
   236   s2 classloader_type = ClassLoader::BOOT_LOADER;
   235   if (SystemDictionary::is_system_class_loader(loader)) {
   237   if (SystemDictionary::is_system_class_loader(loader)) {
   299 
   301 
   300   if (HAS_PENDING_EXCEPTION) {
   302   if (HAS_PENDING_EXCEPTION) {
   301     tty->print_cr("Preload Error: Failed to load %s", class_name);
   303     tty->print_cr("Preload Error: Failed to load %s", class_name);
   302     return NULL;
   304     return NULL;
   303   }
   305   }
   304   result->set_shared_classpath_index(UNREGISTERED_INDEX);
       
   305   SystemDictionaryShared::set_shared_class_misc_info(result, stream);
       
   306   return result;
   306   return result;
   307 }
   307 }
   308 
   308 
   309 struct CachedClassPathEntry {
   309 struct CachedClassPathEntry {
   310   const char* _path;
   310   const char* _path;