--- old/src/hotspot/share/classfile/classLoader.hpp 2019-08-22 08:26:22.933336580 -0700 +++ new/src/hotspot/share/classfile/classLoader.hpp 2019-08-22 08:26:22.697328085 -0700 @@ -47,17 +47,19 @@ class ClassPathEntry : public CHeapObj { private: ClassPathEntry* volatile _next; +protected: + const char* copy_path(const char*path); public: ClassPathEntry* next() const; virtual ~ClassPathEntry() {} void set_next(ClassPathEntry* next); - virtual bool is_modules_image() const = 0; - virtual bool is_jar_file() const = 0; + virtual bool is_modules_image() const { return false; } + virtual bool is_jar_file() const { return false; } // Is this entry created from the "Class-path" attribute from a JAR Manifest? - virtual bool from_class_path_attr() const = 0; + virtual bool from_class_path_attr() const { return false; } virtual const char* name() const = 0; - virtual JImageFile* jimage() const = 0; - virtual void close_jimage() = 0; + virtual JImageFile* jimage() const { return NULL; } + virtual void close_jimage() {} // Constructor ClassPathEntry() : _next(NULL) {} // Attempt to locate file_name through this class path entry. @@ -73,18 +75,14 @@ private: const char* _dir; // Name of directory public: - bool is_modules_image() const { return false; } - bool is_jar_file() const { return false; } - bool from_class_path_attr() const { return false; } const char* name() const { return _dir; } - JImageFile* jimage() const { return NULL; } - void close_jimage() {} - ClassPathDirEntry(const char* dir); + ClassPathDirEntry(const char* dir) { + _dir = copy_path(dir); + } virtual ~ClassPathDirEntry() {} ClassFileStream* open_stream(const char* name, TRAPS); }; - // Type definitions for zip file and zip file entry typedef void* jzfile; typedef struct { @@ -104,12 +102,9 @@ const char* _zip_name; // Name of zip archive bool _from_class_path_attr; // From the "Class-path" attribute of a jar file public: - bool is_modules_image() const { return false; } bool is_jar_file() const { return true; } bool from_class_path_attr() const { return _from_class_path_attr; } const char* name() const { return _zip_name; } - JImageFile* jimage() const { return NULL; } - void close_jimage() {} ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append, bool from_class_path_attr); virtual ~ClassPathZipEntry(); u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); @@ -126,8 +121,6 @@ DEBUG_ONLY(static ClassPathImageEntry* _singleton;) public: bool is_modules_image() const; - bool is_jar_file() const { return false; } - bool from_class_path_attr() const { return false; } bool is_open() const { return _jimage != NULL; } const char* name() const { return _name == NULL ? "" : _name; } JImageFile* jimage() const { return _jimage; } @@ -156,8 +149,6 @@ void add_to_list(ClassPathEntry* new_entry); }; -class SharedPathsMiscInfo; - class ClassLoader: AllStatic { public: enum ClassLoaderType { @@ -230,8 +221,6 @@ static ClassPathEntry* _last_append_entry; // Info used by CDS - CDS_ONLY(static SharedPathsMiscInfo * _shared_paths_misc_info;) - CDS_ONLY(static ClassPathEntry* _app_classpath_entries;) CDS_ONLY(static ClassPathEntry* _last_app_classpath_entry;) CDS_ONLY(static ClassPathEntry* _module_path_entries;) @@ -416,10 +405,6 @@ } return num_entries; } - static void finalize_shared_paths_misc_info(); - static int get_shared_paths_misc_info_size(); - static void* get_shared_paths_misc_info(); - static bool check_shared_paths_misc_info(void* info, int size, bool is_static); static void exit_with_path_failure(const char* error, const char* message); static char* skip_uri_protocol(char* source); static void record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS);