Mercurial > hg > truffle
comparison src/share/vm/classfile/classLoader.hpp @ 20376:bb239308be67
8056971: Minor class loading clean-up
Summary: Misplacement of #if INCLUE_CDS, typos, unnecessary C string duplication
Reviewed-by: dholmes, ccheung
author | iklam |
---|---|
date | Tue, 02 Sep 2014 14:02:57 -0700 |
parents | 6e0cb14ce59b |
children | 8cb56c8cb30d |
comparison
equal
deleted
inserted
replaced
20375:6e0cb14ce59b | 20376:bb239308be67 |
---|---|
70 }; | 70 }; |
71 | 71 |
72 | 72 |
73 class ClassPathDirEntry: public ClassPathEntry { | 73 class ClassPathDirEntry: public ClassPathEntry { |
74 private: | 74 private: |
75 char* _dir; // Name of directory | 75 const char* _dir; // Name of directory |
76 public: | 76 public: |
77 bool is_jar_file() { return false; } | 77 bool is_jar_file() { return false; } |
78 const char* name() { return _dir; } | 78 const char* name() { return _dir; } |
79 ClassPathDirEntry(char* dir); | 79 ClassPathDirEntry(const char* dir); |
80 ClassFileStream* open_stream(const char* name, TRAPS); | 80 ClassFileStream* open_stream(const char* name, TRAPS); |
81 // Debugging | 81 // Debugging |
82 NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);) | 82 NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);) |
83 NOT_PRODUCT(bool is_rt_jar();) | 83 NOT_PRODUCT(bool is_rt_jar();) |
84 }; | 84 }; |
98 } jzentry; | 98 } jzentry; |
99 | 99 |
100 | 100 |
101 class ClassPathZipEntry: public ClassPathEntry { | 101 class ClassPathZipEntry: public ClassPathEntry { |
102 private: | 102 private: |
103 jzfile* _zip; // The zip archive | 103 jzfile* _zip; // The zip archive |
104 char* _zip_name; // Name of zip archive | 104 const char* _zip_name; // Name of zip archive |
105 public: | 105 public: |
106 bool is_jar_file() { return true; } | 106 bool is_jar_file() { return true; } |
107 const char* name() { return _zip_name; } | 107 const char* name() { return _zip_name; } |
108 ClassPathZipEntry(jzfile* zip, const char* zip_name); | 108 ClassPathZipEntry(jzfile* zip, const char* zip_name); |
109 ~ClassPathZipEntry(); | 109 ~ClassPathZipEntry(); |
121 | 121 |
122 | 122 |
123 // For lazier loading of boot class path entries | 123 // For lazier loading of boot class path entries |
124 class LazyClassPathEntry: public ClassPathEntry { | 124 class LazyClassPathEntry: public ClassPathEntry { |
125 private: | 125 private: |
126 char* _path; // dir or file | 126 const char* _path; // dir or file |
127 struct stat _st; | 127 struct stat _st; |
128 MetaIndex* _meta_index; | 128 MetaIndex* _meta_index; |
129 bool _has_error; | 129 bool _has_error; |
130 bool _throw_exception; | 130 bool _throw_exception; |
131 volatile ClassPathEntry* _resolved_entry; | 131 volatile ClassPathEntry* _resolved_entry; |
132 ClassPathEntry* resolve_entry(TRAPS); | 132 ClassPathEntry* resolve_entry(TRAPS); |
133 public: | 133 public: |
134 bool is_jar_file(); | 134 bool is_jar_file(); |
135 const char* name() { return _path; } | 135 const char* name() { return _path; } |
136 LazyClassPathEntry(char* path, const struct stat* st, bool throw_exception); | 136 LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception); |
137 u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); | 137 u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); |
138 ClassFileStream* open_stream(const char* name, TRAPS); | 138 ClassFileStream* open_stream(const char* name, TRAPS); |
139 void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; } | 139 void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; } |
140 virtual bool is_lazy(); | 140 virtual bool is_lazy(); |
141 // Debugging | 141 // Debugging |
216 // Initialization | 216 // Initialization |
217 static void setup_bootstrap_meta_index(); | 217 static void setup_bootstrap_meta_index(); |
218 static void setup_meta_index(const char* meta_index_path, const char* meta_index_dir, | 218 static void setup_meta_index(const char* meta_index_path, const char* meta_index_dir, |
219 int start_index); | 219 int start_index); |
220 static void setup_bootstrap_search_path(); | 220 static void setup_bootstrap_search_path(); |
221 static void setup_search_path(char *class_path); | 221 static void setup_search_path(const char *class_path); |
222 | 222 |
223 static void load_zip_library(); | 223 static void load_zip_library(); |
224 static ClassPathEntry* create_class_path_entry(char *path, const struct stat* st, | 224 static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st, |
225 bool lazy, bool throw_exception, TRAPS); | 225 bool lazy, bool throw_exception, TRAPS); |
226 | 226 |
227 // Canonicalizes path names, so strcmp will work properly. This is mainly | 227 // Canonicalizes path names, so strcmp will work properly. This is mainly |
228 // to avoid confusing the zip library | 228 // to avoid confusing the zip library |
229 static bool get_canonical_path(char* orig, char* out, int len); | 229 static bool get_canonical_path(const char* orig, char* out, int len); |
230 public: | 230 public: |
231 static bool update_class_path_entry_list(char *path, | 231 static bool update_class_path_entry_list(const char *path, |
232 bool check_for_duplicates, | 232 bool check_for_duplicates, |
233 bool throw_exception=true); | 233 bool throw_exception=true); |
234 static void print_bootclasspath(); | 234 static void print_bootclasspath(); |
235 | 235 |
236 // Timing | 236 // Timing |