62 } 63 64 void ClassLoaderExt::setup_app_search_path() { 65 assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); 66 _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries(); 67 char* app_class_path = os::strdup(Arguments::get_appclasspath()); 68 69 if (strcmp(app_class_path, ".") == 0) { 70 // This doesn't make any sense, even for AppCDS, so let's skip it. We 71 // don't want to throw an error here because -cp "." is usually assigned 72 // by the launcher when classpath is not specified. 73 trace_class_path("app loader class path (skipped)=", app_class_path); 74 } else { 75 trace_class_path("app loader class path=", app_class_path); 76 shared_paths_misc_info()->add_app_classpath(app_class_path); 77 ClassLoader::setup_app_search_path(app_class_path); 78 } 79 } 80 81 void ClassLoaderExt::process_module_table(ModuleEntryTable* met, TRAPS) { 82 ResourceMark rm; 83 for (int i = 0; i < met->table_size(); i++) { 84 for (ModuleEntry* m = met->bucket(i); m != NULL;) { 85 char* path = m->location()->as_C_string(); 86 if (strncmp(path, "file:", 5) == 0 && ClassLoader::string_ends_with(path, ".jar")) { 87 m->print(); 88 path = ClassLoader::skip_uri_protocol(path); 89 ClassLoader::setup_module_search_path(path, THREAD); 90 } 91 m = m->next(); 92 } 93 } 94 } 95 void ClassLoaderExt::setup_module_paths(TRAPS) { 96 assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); 97 _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() + 98 ClassLoader::num_app_classpath_entries(); 99 Handle system_class_loader (THREAD, SystemDictionary::java_system_loader()); 100 ModuleEntryTable* met = Modules::get_module_entry_table(system_class_loader); 101 process_module_table(met, THREAD); 102 } 103 104 char* ClassLoaderExt::read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS) { 105 const char* name = "META-INF/MANIFEST.MF"; 106 char* manifest; 107 jint size; | 62 } 63 64 void ClassLoaderExt::setup_app_search_path() { 65 assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); 66 _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries(); 67 char* app_class_path = os::strdup(Arguments::get_appclasspath()); 68 69 if (strcmp(app_class_path, ".") == 0) { 70 // This doesn't make any sense, even for AppCDS, so let's skip it. We 71 // don't want to throw an error here because -cp "." is usually assigned 72 // by the launcher when classpath is not specified. 73 trace_class_path("app loader class path (skipped)=", app_class_path); 74 } else { 75 trace_class_path("app loader class path=", app_class_path); 76 shared_paths_misc_info()->add_app_classpath(app_class_path); 77 ClassLoader::setup_app_search_path(app_class_path); 78 } 79 } 80 81 void ClassLoaderExt::process_module_table(ModuleEntryTable* met, TRAPS) { 82 ResourceMark rm(THREAD); 83 for (int i = 0; i < met->table_size(); i++) { 84 for (ModuleEntry* m = met->bucket(i); m != NULL;) { 85 char* path = m->location()->as_C_string(); 86 if (strncmp(path, "file:", 5) == 0) { 87 path = ClassLoader::skip_uri_protocol(path); 88 ClassLoader::setup_module_search_path(path, THREAD); 89 } 90 m = m->next(); 91 } 92 } 93 } 94 void ClassLoaderExt::setup_module_paths(TRAPS) { 95 assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); 96 _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() + 97 ClassLoader::num_app_classpath_entries(); 98 Handle system_class_loader (THREAD, SystemDictionary::java_system_loader()); 99 ModuleEntryTable* met = Modules::get_module_entry_table(system_class_loader); 100 process_module_table(met, THREAD); 101 } 102 103 char* ClassLoaderExt::read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS) { 104 const char* name = "META-INF/MANIFEST.MF"; 105 char* manifest; 106 jint size; |