30 #include "utilities/macros.hpp" 31 32 class ClassListParser; 33 34 class ClassLoaderExt: public ClassLoader { // AllStatic 35 public: 36 static bool should_verify(int classpath_index) { 37 CDS_ONLY(return (classpath_index >= _app_class_paths_start_index);) 38 NOT_CDS(return false;) 39 } 40 41 #if INCLUDE_CDS 42 private: 43 enum SomeConstants { 44 max_classpath_index = 0x7fff 45 }; 46 47 static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size); 48 static void setup_app_search_path(); // Only when -Xshare:dump 49 static void process_module_table(ModuleEntryTable* met, TRAPS); 50 static SharedPathsMiscInfo* shared_paths_misc_info() { 51 return (SharedPathsMiscInfo*)_shared_paths_misc_info; 52 } 53 // index of first app JAR in shared classpath entry table 54 static jshort _app_class_paths_start_index; 55 // index of first modular JAR in shared modulepath entry table 56 static jshort _app_module_paths_start_index; 57 // the largest path index being used during CDS dump time 58 static jshort _max_used_path_index; 59 60 static bool _has_app_classes; 61 static bool _has_platform_classes; 62 63 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS); 64 static ClassPathEntry* find_classpath_entry_from_cache(const char* path, TRAPS); 65 66 public: 67 static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates); 68 69 // Called by JVMTI code to add boot classpath 70 static void append_boot_classpath(ClassPathEntry* new_entry); 71 72 static void setup_search_paths(); 73 static void setup_module_paths(TRAPS); 74 75 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 76 // Remove all the new-line continuations (which wrap long lines at 72 characters, see 77 // http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), so 78 // that the manifest is easier to parse. 79 return read_manifest(entry, manifest_size, true, THREAD); 80 } 81 static char* read_raw_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 82 // Do not remove new-line continuations, so we can easily pass it as an argument to 83 // java.util.jar.Manifest.getManifest() at run-time. 84 return read_manifest(entry, manifest_size, false, THREAD); 85 } 86 87 static void finalize_shared_paths_misc_info(); 88 89 static jshort app_class_paths_start_index() { return _app_class_paths_start_index; } 90 91 static jshort app_module_paths_start_index() { return _app_module_paths_start_index; } 92 93 static jshort max_used_path_index() { return _max_used_path_index; } 94 95 static void set_max_used_path_index(jshort used_index) { 96 _max_used_path_index = used_index; 97 } 98 99 static void init_paths_start_index(jshort app_start) { 100 _app_class_paths_start_index = app_start; 101 } 102 103 static void init_app_module_paths_start_index(jshort module_start) { 104 _app_module_paths_start_index = module_start; 105 } 106 107 static bool is_boot_classpath(int classpath_index) { | 30 #include "utilities/macros.hpp" 31 32 class ClassListParser; 33 34 class ClassLoaderExt: public ClassLoader { // AllStatic 35 public: 36 static bool should_verify(int classpath_index) { 37 CDS_ONLY(return (classpath_index >= _app_class_paths_start_index);) 38 NOT_CDS(return false;) 39 } 40 41 #if INCLUDE_CDS 42 private: 43 enum SomeConstants { 44 max_classpath_index = 0x7fff 45 }; 46 47 static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size); 48 static void setup_app_search_path(); // Only when -Xshare:dump 49 static void process_module_table(ModuleEntryTable* met, TRAPS); 50 // index of first app JAR in shared classpath entry table 51 static jshort _app_class_paths_start_index; 52 // index of first modular JAR in shared modulepath entry table 53 static jshort _app_module_paths_start_index; 54 // the largest path index being used during CDS dump time 55 static jshort _max_used_path_index; 56 57 static bool _has_app_classes; 58 static bool _has_platform_classes; 59 60 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS); 61 static ClassPathEntry* find_classpath_entry_from_cache(const char* path, TRAPS); 62 63 public: 64 static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates); 65 66 // Called by JVMTI code to add boot classpath 67 static void append_boot_classpath(ClassPathEntry* new_entry); 68 69 static void setup_search_paths(); 70 static void setup_module_paths(TRAPS); 71 72 static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 73 // Remove all the new-line continuations (which wrap long lines at 72 characters, see 74 // http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), so 75 // that the manifest is easier to parse. 76 return read_manifest(entry, manifest_size, true, THREAD); 77 } 78 static char* read_raw_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) { 79 // Do not remove new-line continuations, so we can easily pass it as an argument to 80 // java.util.jar.Manifest.getManifest() at run-time. 81 return read_manifest(entry, manifest_size, false, THREAD); 82 } 83 84 static jshort app_class_paths_start_index() { return _app_class_paths_start_index; } 85 86 static jshort app_module_paths_start_index() { return _app_module_paths_start_index; } 87 88 static jshort max_used_path_index() { return _max_used_path_index; } 89 90 static void set_max_used_path_index(jshort used_index) { 91 _max_used_path_index = used_index; 92 } 93 94 static void init_paths_start_index(jshort app_start) { 95 _app_class_paths_start_index = app_start; 96 } 97 98 static void init_app_module_paths_start_index(jshort module_start) { 99 _app_module_paths_start_index = module_start; 100 } 101 102 static bool is_boot_classpath(int classpath_index) { |