src/hotspot/share/classfile/classLoaderExt.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/classLoaderExt.cpp

Print this page




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




  64 }
  65 
  66 void ClassLoaderExt::setup_app_search_path() {
  67   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
  68   _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries();
  69   char* app_class_path = os::strdup(Arguments::get_appclasspath());
  70 
  71   if (strcmp(app_class_path, ".") == 0) {
  72     // This doesn't make any sense, even for AppCDS, so let's skip it. We
  73     // don't want to throw an error here because -cp "." is usually assigned
  74     // by the launcher when classpath is not specified.
  75     trace_class_path("app loader class path (skipped)=", app_class_path);
  76   } else {
  77     trace_class_path("app loader class path=", app_class_path);
  78     shared_paths_misc_info()->add_app_classpath(app_class_path);
  79     ClassLoader::setup_app_search_path(app_class_path);
  80   }
  81 }
  82 
  83 void ClassLoaderExt::process_module_table(ModuleEntryTable* met, TRAPS) {
  84   ResourceMark rm(THREAD);
  85   for (int i = 0; i < met->table_size(); i++) {
  86     for (ModuleEntry* m = met->bucket(i); m != NULL;) {
  87       char* path = m->location()->as_C_string();
  88       if (strncmp(path, "file:", 5) == 0) {

  89         path = ClassLoader::skip_uri_protocol(path);
  90         ClassLoader::setup_module_search_path(path, THREAD);
  91       }
  92       m = m->next();
  93     }
  94   }
  95 }
  96 void ClassLoaderExt::setup_module_paths(TRAPS) {
  97   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
  98   _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() +
  99                               ClassLoader::num_app_classpath_entries();
 100   Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
 101   ModuleEntryTable* met = Modules::get_module_entry_table(system_class_loader);
 102   process_module_table(met, THREAD);
 103 }
 104 
 105 char* ClassLoaderExt::read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS) {
 106   const char* name = "META-INF/MANIFEST.MF";
 107   char* manifest;
 108   jint size;


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