77 TRAPS) { 78 #if INCLUDE_CDS 79 ClassLoaderExt::record_result(this, class_name, classpath_index, result, THREAD); 80 #endif 81 } 82 83 ~Context() { 84 #if INCLUDE_CDS 85 if (!DumpSharedSpaces && !UseSharedSpaces) { 86 // Must not modify app_class_paths_start_index if we're not using CDS. 87 assert(_app_class_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); 88 } 89 #endif 90 } 91 }; // end ClassLoaderExt::Context 92 93 private: 94 #if INCLUDE_CDS 95 static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size); 96 static void setup_app_search_path(); // Only when -Xshare:dump 97 static void process_module_table(ModuleEntryTable* met); 98 static void setup_module_search_path(); 99 static SharedPathsMiscInfoExt* shared_paths_misc_info() { 100 return (SharedPathsMiscInfoExt*)_shared_paths_misc_info; 101 } 102 // index of first app JAR in shared classpath entry table 103 static jshort _app_class_paths_start_index; 104 // index of first modular JAR in shared modulepath entry table 105 static jshort _app_module_paths_start_index; 106 107 static bool _has_app_classes; 108 static bool _has_platform_classes; 109 #endif 110 111 public: 112 CDS_ONLY(static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates);) 113 114 // Called by JVMTI code to add boot classpath 115 static void append_boot_classpath(ClassPathEntry* new_entry) { 116 #if INCLUDE_CDS 117 if (UseAppCDS) { 118 warning("UseAppCDS is disabled because bootstrap classpath has been appended"); 119 UseAppCDS = false; 120 } 121 #endif 122 ClassLoader::add_to_boot_append_entries(new_entry); 123 } 124 125 static void setup_search_paths() NOT_CDS_RETURN; 126 static void setup_module_paths() NOT_CDS_RETURN; 127 128 #if INCLUDE_CDS 129 private: 130 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS); 131 static ClassPathEntry* find_classpath_entry_from_cache(const char* path, TRAPS); 132 133 public: 134 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 135 // Remove all the new-line continuations (which wrap long lines at 72 characters, see 136 // http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), so 137 // that the manifest is easier to parse. 138 return read_manifest(entry, manifest_size, true, THREAD); 139 } 140 static char* read_raw_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 141 // Do not remove new-line continuations, so we can easily pass it as an argument to 142 // java.util.jar.Manifest.getManifest() at run-time. 143 return read_manifest(entry, manifest_size, false, THREAD); 144 } 145 146 static void finalize_shared_paths_misc_info(); | 77 TRAPS) { 78 #if INCLUDE_CDS 79 ClassLoaderExt::record_result(this, class_name, classpath_index, result, THREAD); 80 #endif 81 } 82 83 ~Context() { 84 #if INCLUDE_CDS 85 if (!DumpSharedSpaces && !UseSharedSpaces) { 86 // Must not modify app_class_paths_start_index if we're not using CDS. 87 assert(_app_class_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); 88 } 89 #endif 90 } 91 }; // end ClassLoaderExt::Context 92 93 private: 94 #if INCLUDE_CDS 95 static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size); 96 static void setup_app_search_path(); // Only when -Xshare:dump 97 static void process_module_table(ModuleEntryTable* met, TRAPS); 98 static void setup_module_search_path(TRAPS); 99 static SharedPathsMiscInfoExt* shared_paths_misc_info() { 100 return (SharedPathsMiscInfoExt*)_shared_paths_misc_info; 101 } 102 // index of first app JAR in shared classpath entry table 103 static jshort _app_class_paths_start_index; 104 // index of first modular JAR in shared modulepath entry table 105 static jshort _app_module_paths_start_index; 106 107 static bool _has_app_classes; 108 static bool _has_platform_classes; 109 #endif 110 111 public: 112 CDS_ONLY(static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates);) 113 114 // Called by JVMTI code to add boot classpath 115 static void append_boot_classpath(ClassPathEntry* new_entry) { 116 #if INCLUDE_CDS 117 if (UseAppCDS) { 118 warning("UseAppCDS is disabled because bootstrap classpath has been appended"); 119 UseAppCDS = false; 120 } 121 #endif 122 ClassLoader::add_to_boot_append_entries(new_entry); 123 } 124 125 static void setup_search_paths() NOT_CDS_RETURN; 126 static void setup_module_paths(TRAPS) NOT_CDS_RETURN; 127 128 #if INCLUDE_CDS 129 private: 130 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS); 131 static ClassPathEntry* find_classpath_entry_from_cache(const char* path, TRAPS); 132 133 public: 134 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 135 // Remove all the new-line continuations (which wrap long lines at 72 characters, see 136 // http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), so 137 // that the manifest is easier to parse. 138 return read_manifest(entry, manifest_size, true, THREAD); 139 } 140 static char* read_raw_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 141 // Do not remove new-line continuations, so we can easily pass it as an argument to 142 // java.util.jar.Manifest.getManifest() at run-time. 143 return read_manifest(entry, manifest_size, false, THREAD); 144 } 145 146 static void finalize_shared_paths_misc_info(); |