23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP |
25 #ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP |
26 #define SHARE_VM_CLASSFILE_CLASSLOADER_HPP |
26 #define SHARE_VM_CLASSFILE_CLASSLOADER_HPP |
27 |
27 |
|
28 #include "classfile/jimage.hpp" |
28 #include "runtime/orderAccess.hpp" |
29 #include "runtime/orderAccess.hpp" |
29 #include "runtime/perfData.hpp" |
30 #include "runtime/perfData.hpp" |
30 #include "utilities/exceptions.hpp" |
31 #include "utilities/exceptions.hpp" |
31 #include "utilities/macros.hpp" |
32 #include "utilities/macros.hpp" |
32 |
33 |
100 jint crc; /* crc of uncompressed data */ |
102 jint crc; /* crc of uncompressed data */ |
101 char *comment; /* optional zip file comment */ |
103 char *comment; /* optional zip file comment */ |
102 jbyte *extra; /* optional extra data */ |
104 jbyte *extra; /* optional extra data */ |
103 jlong pos; /* position of LOC header (if negative) or data */ |
105 jlong pos; /* position of LOC header (if negative) or data */ |
104 } jzentry; |
106 } jzentry; |
105 |
|
106 |
107 |
107 class ClassPathZipEntry: public ClassPathEntry { |
108 class ClassPathZipEntry: public ClassPathEntry { |
108 enum { |
109 enum { |
109 _unknown = 0, |
110 _unknown = 0, |
110 _yes = 1, |
111 _yes = 1, |
247 |
248 |
248 // Note: _num_entries includes the java runtime image and all |
249 // Note: _num_entries includes the java runtime image and all |
249 // the entries on the _first_append_entry linked list. |
250 // the entries on the _first_append_entry linked list. |
250 static int _num_entries; |
251 static int _num_entries; |
251 |
252 |
|
253 // number of entries in the boot class path including the |
|
254 // java runtime image |
|
255 static int _num_boot_entries; |
|
256 |
252 // Array of module names associated with the boot class loader |
257 // Array of module names associated with the boot class loader |
253 CDS_ONLY(static GrowableArray<char*>* _boot_modules_array;) |
258 CDS_ONLY(static GrowableArray<char*>* _boot_modules_array;) |
254 |
259 |
255 // Array of module names associated with the platform class loader |
260 // Array of module names associated with the platform class loader |
256 CDS_ONLY(static GrowableArray<char*>* _platform_modules_array;) |
261 CDS_ONLY(static GrowableArray<char*>* _platform_modules_array;) |
287 // Canonicalizes path names, so strcmp will work properly. This is mainly |
292 // Canonicalizes path names, so strcmp will work properly. This is mainly |
288 // to avoid confusing the zip library |
293 // to avoid confusing the zip library |
289 static bool get_canonical_path(const char* orig, char* out, int len); |
294 static bool get_canonical_path(const char* orig, char* out, int len); |
290 static const char* file_name_for_class_name(const char* class_name, |
295 static const char* file_name_for_class_name(const char* class_name, |
291 int class_name_len); |
296 int class_name_len); |
|
297 static PackageEntry* get_package_entry(const char* class_name, ClassLoaderData* loader_data, TRAPS); |
292 |
298 |
293 public: |
299 public: |
294 static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg); |
300 static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg); |
295 static int crc32(int crc, const char* buf, int len); |
301 static int crc32(int crc, const char* buf, int len); |
296 static bool update_class_path_entry_list(const char *path, |
302 static bool update_class_path_entry_list(const char *path, |
434 |
440 |
435 static s2 module_to_classloader(const char* module_name); |
441 static s2 module_to_classloader(const char* module_name); |
436 static void initialize_module_loader_map(JImageFile* jimage); |
442 static void initialize_module_loader_map(JImageFile* jimage); |
437 static s2 classloader_type(Symbol* class_name, ClassPathEntry* e, |
443 static s2 classloader_type(Symbol* class_name, ClassPathEntry* e, |
438 int classpath_index, TRAPS); |
444 int classpath_index, TRAPS); |
|
445 static void record_shared_class_loader_type(InstanceKlass* ik, const ClassFileStream* stream); |
439 #endif |
446 #endif |
|
447 static JImageLocationRef jimage_find_resource(JImageFile* jf, const char* module_name, |
|
448 const char* file_name, jlong &size); |
440 |
449 |
441 static void trace_class_path(const char* msg, const char* name = NULL); |
450 static void trace_class_path(const char* msg, const char* name = NULL); |
442 |
451 |
443 // VM monitoring and management support |
452 // VM monitoring and management support |
444 static jlong classloader_time_ms(); |
453 static jlong classloader_time_ms(); |