author | lfoltan |
Mon, 21 Oct 2019 13:13:16 -0400 | |
changeset 58722 | cba8afa5cfed |
parent 58486 | dcb418f5aabd |
child 58679 | 9c3209ff7550 |
child 58842 | 6c255334120d |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52960
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3795
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3795
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3795
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52960
diff
changeset
|
25 |
#ifndef SHARE_CLASSFILE_CLASSLOADER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52960
diff
changeset
|
26 |
#define SHARE_CLASSFILE_CLASSLOADER_HPP |
7397 | 27 |
|
48011 | 28 |
#include "jimage.hpp" |
58447
319173c62caa
8231606: _method_ordering is not set during CDS dynamic dump time
ccheung
parents:
57898
diff
changeset
|
29 |
#include "runtime/arguments.hpp" |
48115 | 30 |
#include "runtime/handles.hpp" |
7397 | 31 |
#include "runtime/perfData.hpp" |
34666 | 32 |
#include "utilities/exceptions.hpp" |
27683
1d5707553fff
8064580: Move INCLUDE_CDS include section to the end of the include list
stefank
parents:
27025
diff
changeset
|
33 |
#include "utilities/macros.hpp" |
7397 | 34 |
|
1 | 35 |
// The VM class loader. |
36 |
#include <sys/stat.h> |
|
37 |
||
36508 | 38 |
// Name of boot "modules" image |
39 |
#define MODULES_IMAGE_NAME "modules" |
|
40 |
||
41 |
// Class path entry (directory or zip file) |
|
1 | 42 |
|
32619
47acec81dcca
8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents:
31612
diff
changeset
|
43 |
class JImageFile; |
34666 | 44 |
class ClassFileStream; |
47103
a993ec29ec75
8186842: Use Java class loaders for creating the CDS archive
ccheung
parents:
46746
diff
changeset
|
45 |
class PackageEntry; |
48115 | 46 |
template <typename T> class GrowableArray; |
31608 | 47 |
|
34666 | 48 |
class ClassPathEntry : public CHeapObj<mtClass> { |
49 |
private: |
|
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
40244
diff
changeset
|
50 |
ClassPathEntry* volatile _next; |
57898 | 51 |
protected: |
52 |
const char* copy_path(const char*path); |
|
34666 | 53 |
public: |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
54 |
ClassPathEntry* next() const; |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
55 |
virtual ~ClassPathEntry() {} |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
56 |
void set_next(ClassPathEntry* next); |
57898 | 57 |
virtual bool is_modules_image() const { return false; } |
58 |
virtual bool is_jar_file() const { return false; } |
|
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
59 |
// Is this entry created from the "Class-path" attribute from a JAR Manifest? |
57898 | 60 |
virtual bool from_class_path_attr() const { return false; } |
34666 | 61 |
virtual const char* name() const = 0; |
57898 | 62 |
virtual JImageFile* jimage() const { return NULL; } |
63 |
virtual void close_jimage() {} |
|
1 | 64 |
// Constructor |
34666 | 65 |
ClassPathEntry() : _next(NULL) {} |
1 | 66 |
// Attempt to locate file_name through this class path entry. |
67 |
// Returns a class file parsing stream if successfull. |
|
19685
3df9b00b5d5f
8020675: invalid jar file in the bootclasspath could lead to jvm fatal error
ccheung
parents:
17004
diff
changeset
|
68 |
virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0; |
54340
2221f042556d
8221351: Crash in KlassFactory::check_shared_class_file_load_hook
iklam
parents:
54257
diff
changeset
|
69 |
// Open the stream for a specific class loader |
2221f042556d
8221351: Crash in KlassFactory::check_shared_class_file_load_hook
iklam
parents:
54257
diff
changeset
|
70 |
virtual ClassFileStream* open_stream_for_loader(const char* name, ClassLoaderData* loader_data, TRAPS) { |
2221f042556d
8221351: Crash in KlassFactory::check_shared_class_file_load_hook
iklam
parents:
54257
diff
changeset
|
71 |
return open_stream(name, THREAD); |
2221f042556d
8221351: Crash in KlassFactory::check_shared_class_file_load_hook
iklam
parents:
54257
diff
changeset
|
72 |
} |
1 | 73 |
}; |
74 |
||
75 |
class ClassPathDirEntry: public ClassPathEntry { |
|
76 |
private: |
|
26419 | 77 |
const char* _dir; // Name of directory |
1 | 78 |
public: |
34666 | 79 |
const char* name() const { return _dir; } |
57898 | 80 |
ClassPathDirEntry(const char* dir) { |
81 |
_dir = copy_path(dir); |
|
82 |
} |
|
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
83 |
virtual ~ClassPathDirEntry() {} |
19685
3df9b00b5d5f
8020675: invalid jar file in the bootclasspath could lead to jvm fatal error
ccheung
parents:
17004
diff
changeset
|
84 |
ClassFileStream* open_stream(const char* name, TRAPS); |
1 | 85 |
}; |
86 |
||
87 |
// Type definitions for zip file and zip file entry |
|
88 |
typedef void* jzfile; |
|
89 |
typedef struct { |
|
90 |
char *name; /* entry name */ |
|
91 |
jlong time; /* modification time */ |
|
92 |
jlong size; /* size of uncompressed data */ |
|
93 |
jlong csize; /* size of compressed data (zero if uncompressed) */ |
|
94 |
jint crc; /* crc of uncompressed data */ |
|
95 |
char *comment; /* optional zip file comment */ |
|
96 |
jbyte *extra; /* optional extra data */ |
|
97 |
jlong pos; /* position of LOC header (if negative) or data */ |
|
98 |
} jzentry; |
|
99 |
||
100 |
class ClassPathZipEntry: public ClassPathEntry { |
|
101 |
private: |
|
26419 | 102 |
jzfile* _zip; // The zip archive |
103 |
const char* _zip_name; // Name of zip archive |
|
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
104 |
bool _from_class_path_attr; // From the "Class-path" attribute of a jar file |
1 | 105 |
public: |
34666 | 106 |
bool is_jar_file() const { return true; } |
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
107 |
bool from_class_path_attr() const { return _from_class_path_attr; } |
34666 | 108 |
const char* name() const { return _zip_name; } |
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
109 |
ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append, bool from_class_path_attr); |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
110 |
virtual ~ClassPathZipEntry(); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
111 |
u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS); |
19685
3df9b00b5d5f
8020675: invalid jar file in the bootclasspath could lead to jvm fatal error
ccheung
parents:
17004
diff
changeset
|
112 |
ClassFileStream* open_stream(const char* name, TRAPS); |
1 | 113 |
void contents_do(void f(const char* name, void* context), void* context); |
114 |
}; |
|
115 |
||
116 |
||
27562 | 117 |
// For java image files |
118 |
class ClassPathImageEntry: public ClassPathEntry { |
|
119 |
private: |
|
32619
47acec81dcca
8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents:
31612
diff
changeset
|
120 |
JImageFile* _jimage; |
47acec81dcca
8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents:
31612
diff
changeset
|
121 |
const char* _name; |
54257
21702e87efdf
8220095: Assertion failure when symlink (with different name) is used for lib/modules file
iklam
parents:
53884
diff
changeset
|
122 |
DEBUG_ONLY(static ClassPathImageEntry* _singleton;) |
27562 | 123 |
public: |
47673
6126617b8508
8185160: -XX:DumpLoadedClassList omits graal classes
iklam
parents:
47634
diff
changeset
|
124 |
bool is_modules_image() const; |
34666 | 125 |
bool is_open() const { return _jimage != NULL; } |
126 |
const char* name() const { return _name == NULL ? "" : _name; } |
|
127 |
JImageFile* jimage() const { return _jimage; } |
|
52960
a6182c464b31
8200613: SA: jstack throws UnmappedAddressException with a CDS core file
jgeorge
parents:
52934
diff
changeset
|
128 |
void close_jimage(); |
32619
47acec81dcca
8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents:
31612
diff
changeset
|
129 |
ClassPathImageEntry(JImageFile* jimage, const char* name); |
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
130 |
virtual ~ClassPathImageEntry(); |
27562 | 131 |
ClassFileStream* open_stream(const char* name, TRAPS); |
54340
2221f042556d
8221351: Crash in KlassFactory::check_shared_class_file_load_hook
iklam
parents:
54257
diff
changeset
|
132 |
ClassFileStream* open_stream_for_loader(const char* name, ClassLoaderData* loader_data, TRAPS); |
1 | 133 |
}; |
134 |
||
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
135 |
// ModuleClassPathList contains a linked list of ClassPathEntry's |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
136 |
// that have been specified for a specific module. Currently, |
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
137 |
// the only way to specify a module/path pair is via the --patch-module |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
138 |
// command line option. |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
139 |
class ModuleClassPathList : public CHeapObj<mtClass> { |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
140 |
private: |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
141 |
Symbol* _module_name; |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
142 |
// First and last entries of class path entries for a specific module |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
143 |
ClassPathEntry* _module_first_entry; |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
144 |
ClassPathEntry* _module_last_entry; |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
145 |
public: |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
146 |
Symbol* module_name() const { return _module_name; } |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
147 |
ClassPathEntry* module_first_entry() const { return _module_first_entry; } |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
148 |
ModuleClassPathList(Symbol* module_name); |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
149 |
~ModuleClassPathList(); |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
150 |
void add_to_list(ClassPathEntry* new_entry); |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
151 |
}; |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
152 |
|
1 | 153 |
class ClassLoader: AllStatic { |
154 |
public: |
|
36508 | 155 |
enum ClassLoaderType { |
156 |
BOOT_LOADER = 1, /* boot loader */ |
|
157 |
PLATFORM_LOADER = 2, /* PlatformClassLoader */ |
|
158 |
APP_LOADER = 3 /* AppClassLoader */ |
|
1 | 159 |
}; |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
160 |
protected: |
1 | 161 |
|
162 |
// Performance counters |
|
163 |
static PerfCounter* _perf_accumulated_time; |
|
164 |
static PerfCounter* _perf_classes_inited; |
|
165 |
static PerfCounter* _perf_class_init_time; |
|
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
166 |
static PerfCounter* _perf_class_init_selftime; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
167 |
static PerfCounter* _perf_classes_verified; |
1 | 168 |
static PerfCounter* _perf_class_verify_time; |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
169 |
static PerfCounter* _perf_class_verify_selftime; |
1 | 170 |
static PerfCounter* _perf_classes_linked; |
171 |
static PerfCounter* _perf_class_link_time; |
|
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
172 |
static PerfCounter* _perf_class_link_selftime; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
173 |
static PerfCounter* _perf_class_parse_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
174 |
static PerfCounter* _perf_class_parse_selftime; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
175 |
static PerfCounter* _perf_sys_class_lookup_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
176 |
static PerfCounter* _perf_shared_classload_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
177 |
static PerfCounter* _perf_sys_classload_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
178 |
static PerfCounter* _perf_app_classload_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
179 |
static PerfCounter* _perf_app_classload_selftime; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
180 |
static PerfCounter* _perf_app_classload_count; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
181 |
static PerfCounter* _perf_define_appclasses; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
182 |
static PerfCounter* _perf_define_appclass_time; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
183 |
static PerfCounter* _perf_define_appclass_selftime; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
184 |
static PerfCounter* _perf_app_classfile_bytes_read; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
185 |
static PerfCounter* _perf_sys_classfile_bytes_read; |
1 | 186 |
|
187 |
static PerfCounter* _sync_systemLoaderLockContentionRate; |
|
188 |
static PerfCounter* _sync_nonSystemLoaderLockContentionRate; |
|
189 |
static PerfCounter* _sync_JVMFindLoadedClassLockFreeCounter; |
|
190 |
static PerfCounter* _sync_JVMDefineClassLockFreeCounter; |
|
191 |
static PerfCounter* _sync_JNIDefineClassLockFreeCounter; |
|
192 |
||
193 |
static PerfCounter* _unsafe_defineClassCallCounter; |
|
194 |
||
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
195 |
// The boot class path consists of 3 ordered pieces: |
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
196 |
// 1. the module/path pairs specified to --patch-module |
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
197 |
// --patch-module=<module>=<file>(<pathsep><file>)* |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
198 |
// 2. the base piece |
40013 | 199 |
// [jimage | build with exploded modules] |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
200 |
// 3. boot loader append path |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
201 |
// [-Xbootclasspath/a]; [jvmti appended entries] |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
202 |
// |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
203 |
// The boot loader must obey this order when attempting |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
204 |
// to load a class. |
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
205 |
|
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
206 |
// 1. Contains the module/path pairs specified to --patch-module |
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
207 |
static GrowableArray<ModuleClassPathList*>* _patch_mod_entries; |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
208 |
|
40013 | 209 |
// 2. the base piece |
210 |
// Contains the ClassPathEntry of the modular java runtime image. |
|
211 |
// If no java runtime image is present, this indicates a |
|
212 |
// build with exploded modules is being used instead. |
|
213 |
static ClassPathEntry* _jrt_entry; |
|
214 |
static GrowableArray<ModuleClassPathList*>* _exploded_entries; |
|
215 |
enum { EXPLODED_ENTRY_SIZE = 80 }; // Initial number of exploded modules |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
216 |
|
40013 | 217 |
// 3. the boot loader's append path |
218 |
// [-Xbootclasspath/a]; [jvmti appended entries] |
|
219 |
// Note: boot loader append path does not support named modules. |
|
36508 | 220 |
static ClassPathEntry* _first_append_entry; |
40013 | 221 |
// Last entry in linked list of appended ClassPathEntry instances |
222 |
static ClassPathEntry* _last_append_entry; |
|
1 | 223 |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
224 |
// Info used by CDS |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
225 |
CDS_ONLY(static ClassPathEntry* _app_classpath_entries;) |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
226 |
CDS_ONLY(static ClassPathEntry* _last_app_classpath_entry;) |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
227 |
CDS_ONLY(static ClassPathEntry* _module_path_entries;) |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
228 |
CDS_ONLY(static ClassPathEntry* _last_module_path_entry;) |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
229 |
CDS_ONLY(static void setup_app_search_path(const char* class_path);) |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
230 |
CDS_ONLY(static void setup_module_search_path(const char* path, TRAPS);) |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
231 |
static void add_to_app_classpath_entries(const char* path, |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
232 |
ClassPathEntry* entry, |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
233 |
bool check_for_duplicates); |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
234 |
CDS_ONLY(static void add_to_module_path_entries(const char* path, |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
235 |
ClassPathEntry* entry);) |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
236 |
public: |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
237 |
CDS_ONLY(static ClassPathEntry* app_classpath_entries() {return _app_classpath_entries;}) |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
238 |
CDS_ONLY(static ClassPathEntry* module_path_entries() {return _module_path_entries;}) |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
239 |
|
58486
dcb418f5aabd
8231630: Optimize boot loader with no bootclasspath append entry.
jiangli
parents:
58447
diff
changeset
|
240 |
static bool has_bootclasspath_append() { return _first_append_entry != NULL; } |
dcb418f5aabd
8231630: Optimize boot loader with no bootclasspath append entry.
jiangli
parents:
58447
diff
changeset
|
241 |
|
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
242 |
protected: |
40013 | 243 |
// Initialization: |
244 |
// - setup the boot loader's system class path |
|
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
245 |
// - setup the boot loader's patch mod entries, if present |
40013 | 246 |
// - create the ModuleEntry for java.base |
1 | 247 |
static void setup_bootstrap_search_path(); |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
248 |
static void setup_boot_search_path(const char *class_path); |
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
249 |
static void setup_patch_mod_entries(); |
40013 | 250 |
static void create_javabase(); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
251 |
|
1 | 252 |
static void load_zip_library(); |
32619
47acec81dcca
8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents:
31612
diff
changeset
|
253 |
static void load_jimage_library(); |
53884
1a7b57d02107
8218751: Do not store original classfiles inside the CDS archive
iklam
parents:
53244
diff
changeset
|
254 |
|
1a7b57d02107
8218751: Do not store original classfiles inside the CDS archive
iklam
parents:
53244
diff
changeset
|
255 |
public: |
26419 | 256 |
static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st, |
37220
ec74292c0c9c
8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents:
36508
diff
changeset
|
257 |
bool throw_exception, |
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
258 |
bool is_boot_append, |
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
259 |
bool from_class_path_attr, TRAPS); |
1 | 260 |
|
36508 | 261 |
// If the package for the fully qualified class name is in the boot |
262 |
// loader's package entry table then add_package() sets the classpath_index |
|
263 |
// field so that get_system_package() will know to return a non-null value |
|
264 |
// for the package's location. And, so that the package will be added to |
|
265 |
// the list of packages returned by get_system_packages(). |
|
266 |
// For packages whose classes are loaded from the boot loader class path, the |
|
267 |
// classpath_index indicates which entry on the boot loader class path. |
|
268 |
static bool add_package(const char *fullq_class_name, s2 classpath_index, TRAPS); |
|
269 |
||
1 | 270 |
// Canonicalizes path names, so strcmp will work properly. This is mainly |
271 |
// to avoid confusing the zip library |
|
26419 | 272 |
static bool get_canonical_path(const char* orig, char* out, int len); |
34666 | 273 |
static const char* file_name_for_class_name(const char* class_name, |
274 |
int class_name_len); |
|
47103
a993ec29ec75
8186842: Use Java class loaders for creating the CDS archive
ccheung
parents:
46746
diff
changeset
|
275 |
static PackageEntry* get_package_entry(const char* class_name, ClassLoaderData* loader_data, TRAPS); |
34666 | 276 |
|
1 | 277 |
public: |
27562 | 278 |
static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg); |
27025 | 279 |
static int crc32(int crc, const char* buf, int len); |
26419 | 280 |
static bool update_class_path_entry_list(const char *path, |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
281 |
bool check_for_duplicates, |
37220
ec74292c0c9c
8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents:
36508
diff
changeset
|
282 |
bool is_boot_append, |
55524
b279ae9843b8
8211723: AppCDS: referring to a jar file in any way other than exactly how it was done during dumping doesn't work
ccheung
parents:
54927
diff
changeset
|
283 |
bool from_class_path_attr, |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
284 |
bool throw_exception=true); |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
285 |
CDS_ONLY(static void update_module_path_entry_list(const char *path, TRAPS);) |
1 | 286 |
static void print_bootclasspath(); |
287 |
||
288 |
// Timing |
|
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
289 |
static PerfCounter* perf_accumulated_time() { return _perf_accumulated_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
290 |
static PerfCounter* perf_classes_inited() { return _perf_classes_inited; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
291 |
static PerfCounter* perf_class_init_time() { return _perf_class_init_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
292 |
static PerfCounter* perf_class_init_selftime() { return _perf_class_init_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
293 |
static PerfCounter* perf_classes_verified() { return _perf_classes_verified; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
294 |
static PerfCounter* perf_class_verify_time() { return _perf_class_verify_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
295 |
static PerfCounter* perf_class_verify_selftime() { return _perf_class_verify_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
296 |
static PerfCounter* perf_classes_linked() { return _perf_classes_linked; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
297 |
static PerfCounter* perf_class_link_time() { return _perf_class_link_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
298 |
static PerfCounter* perf_class_link_selftime() { return _perf_class_link_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
299 |
static PerfCounter* perf_class_parse_time() { return _perf_class_parse_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
300 |
static PerfCounter* perf_class_parse_selftime() { return _perf_class_parse_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
301 |
static PerfCounter* perf_sys_class_lookup_time() { return _perf_sys_class_lookup_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
302 |
static PerfCounter* perf_shared_classload_time() { return _perf_shared_classload_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
303 |
static PerfCounter* perf_sys_classload_time() { return _perf_sys_classload_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
304 |
static PerfCounter* perf_app_classload_time() { return _perf_app_classload_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
305 |
static PerfCounter* perf_app_classload_selftime() { return _perf_app_classload_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
306 |
static PerfCounter* perf_app_classload_count() { return _perf_app_classload_count; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
307 |
static PerfCounter* perf_define_appclasses() { return _perf_define_appclasses; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
308 |
static PerfCounter* perf_define_appclass_time() { return _perf_define_appclass_time; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
309 |
static PerfCounter* perf_define_appclass_selftime() { return _perf_define_appclass_selftime; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
310 |
static PerfCounter* perf_app_classfile_bytes_read() { return _perf_app_classfile_bytes_read; } |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
311 |
static PerfCounter* perf_sys_classfile_bytes_read() { return _perf_sys_classfile_bytes_read; } |
1 | 312 |
|
313 |
// Record how often system loader lock object is contended |
|
314 |
static PerfCounter* sync_systemLoaderLockContentionRate() { |
|
315 |
return _sync_systemLoaderLockContentionRate; |
|
316 |
} |
|
317 |
||
318 |
// Record how often non system loader lock object is contended |
|
319 |
static PerfCounter* sync_nonSystemLoaderLockContentionRate() { |
|
320 |
return _sync_nonSystemLoaderLockContentionRate; |
|
321 |
} |
|
322 |
||
323 |
// Record how many calls to JVM_FindLoadedClass w/o holding a lock |
|
324 |
static PerfCounter* sync_JVMFindLoadedClassLockFreeCounter() { |
|
325 |
return _sync_JVMFindLoadedClassLockFreeCounter; |
|
326 |
} |
|
327 |
||
328 |
// Record how many calls to JVM_DefineClass w/o holding a lock |
|
329 |
static PerfCounter* sync_JVMDefineClassLockFreeCounter() { |
|
330 |
return _sync_JVMDefineClassLockFreeCounter; |
|
331 |
} |
|
332 |
||
333 |
// Record how many calls to jni_DefineClass w/o holding a lock |
|
334 |
static PerfCounter* sync_JNIDefineClassLockFreeCounter() { |
|
335 |
return _sync_JNIDefineClassLockFreeCounter; |
|
336 |
} |
|
337 |
||
338 |
// Record how many calls to Unsafe_DefineClass |
|
339 |
static PerfCounter* unsafe_defineClassCallCounter() { |
|
340 |
return _unsafe_defineClassCallCounter; |
|
341 |
} |
|
342 |
||
40013 | 343 |
// Modular java runtime image is present vs. a build with exploded modules |
344 |
static bool has_jrt_entry() { return (_jrt_entry != NULL); } |
|
345 |
static ClassPathEntry* get_jrt_entry() { return _jrt_entry; } |
|
52960
a6182c464b31
8200613: SA: jstack throws UnmappedAddressException with a CDS core file
jgeorge
parents:
52934
diff
changeset
|
346 |
static void close_jrt_image(); |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
347 |
|
40013 | 348 |
// Add a module's exploded directory to the boot loader's exploded module build list |
349 |
static void add_to_exploded_build_list(Symbol* module_name, TRAPS); |
|
36508 | 350 |
|
40244
b3055c216762
8136930: Simplify use of module-system options by custom launchers
hseigel
parents:
40013
diff
changeset
|
351 |
// Attempt load of individual class from either the patched or exploded modules build lists |
40013 | 352 |
static ClassFileStream* search_module_entries(const GrowableArray<ModuleClassPathList*>* const module_list, |
353 |
const char* const class_name, |
|
354 |
const char* const file_name, TRAPS); |
|
36508 | 355 |
|
1 | 356 |
// Load individual .class file |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
42876
diff
changeset
|
357 |
static InstanceKlass* load_class(Symbol* class_name, bool search_append_only, TRAPS); |
1 | 358 |
|
359 |
// If the specified package has been loaded by the system, then returns |
|
360 |
// the name of the directory or ZIP file that the package was loaded from. |
|
361 |
// Returns null if the package was not loaded. |
|
362 |
// Note: The specified name can either be the name of a class or package. |
|
363 |
// If a package name is specified, then it must be "/"-separator and also |
|
364 |
// end with a trailing "/". |
|
365 |
static oop get_system_package(const char* name, TRAPS); |
|
366 |
||
367 |
// Returns an array of Java strings representing all of the currently |
|
368 |
// loaded system packages. |
|
369 |
// Note: The package names returned are "/"-separated and end with a |
|
370 |
// trailing "/". |
|
371 |
static objArrayOop get_system_packages(TRAPS); |
|
372 |
||
373 |
// Initialization |
|
374 |
static void initialize(); |
|
40013 | 375 |
static void classLoader_init2(TRAPS); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
376 |
CDS_ONLY(static void initialize_shared_path();) |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
377 |
CDS_ONLY(static void initialize_module_path(TRAPS);) |
36508 | 378 |
|
1 | 379 |
static int compute_Object_vtable(); |
380 |
||
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
381 |
static ClassPathEntry* classpath_entry(int n); |
1 | 382 |
|
42634
7459867ebf98
8168850: Mark module entries that have been specified by --patch-module
rprotacio
parents:
41741
diff
changeset
|
383 |
static bool is_in_patch_mod_entries(Symbol* module_name); |
7459867ebf98
8168850: Mark module entries that have been specified by --patch-module
rprotacio
parents:
41741
diff
changeset
|
384 |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
385 |
#if INCLUDE_CDS |
1 | 386 |
// Sharing dump and restore |
387 |
||
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
388 |
// Helper function used by CDS code to get the number of boot classpath |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
389 |
// entries during shared classpath setup time. |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
390 |
static int num_boot_classpath_entries(); |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
391 |
|
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
392 |
static ClassPathEntry* get_next_boot_classpath_entry(ClassPathEntry* e); |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
393 |
|
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
394 |
// Helper function used by CDS code to get the number of app classpath |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
395 |
// entries during shared classpath setup time. |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
49037
diff
changeset
|
396 |
static int num_app_classpath_entries(); |
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
397 |
|
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
398 |
// Helper function used by CDS code to get the number of module path |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
399 |
// entries during shared classpath setup time. |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
400 |
static int num_module_path_entries() { |
58447
319173c62caa
8231606: _method_ordering is not set during CDS dynamic dump time
ccheung
parents:
57898
diff
changeset
|
401 |
Arguments::assert_is_dumping_archive(); |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
402 |
int num_entries = 0; |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
403 |
ClassPathEntry* e= ClassLoader::_module_path_entries; |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
404 |
while (e != NULL) { |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
405 |
num_entries ++; |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
406 |
e = e->next(); |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
407 |
} |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
408 |
return num_entries; |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
409 |
} |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
410 |
static void exit_with_path_failure(const char* error, const char* message); |
49739
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
411 |
static char* skip_uri_protocol(char* source); |
00805b129186
8194812: Extend class-data sharing to support the module path
ccheung
parents:
49612
diff
changeset
|
412 |
static void record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
413 |
#endif |
47103
a993ec29ec75
8186842: Use Java class loaders for creating the CDS archive
ccheung
parents:
46746
diff
changeset
|
414 |
static JImageLocationRef jimage_find_resource(JImageFile* jf, const char* module_name, |
a993ec29ec75
8186842: Use Java class loaders for creating the CDS archive
ccheung
parents:
46746
diff
changeset
|
415 |
const char* file_name, jlong &size); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
416 |
|
36364
5971776598e5
8150103: Convert TraceClassPaths to Unified Logging
mockner
parents:
34666
diff
changeset
|
417 |
static void trace_class_path(const char* msg, const char* name = NULL); |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25949
diff
changeset
|
418 |
|
1 | 419 |
// VM monitoring and management support |
420 |
static jlong classloader_time_ms(); |
|
421 |
static jlong class_method_total_size(); |
|
422 |
static jlong class_init_count(); |
|
423 |
static jlong class_init_time_ms(); |
|
424 |
static jlong class_verify_time_ms(); |
|
425 |
static jlong class_link_count(); |
|
426 |
static jlong class_link_time_ms(); |
|
427 |
||
428 |
// indicates if class path already contains a entry (exact match by name) |
|
41741
2f5b8bbcb18c
8166931: Do not include classes which are unusable during run time in the classlist file
ccheung
parents:
41281
diff
changeset
|
429 |
static bool contains_append_entry(const char* name); |
1 | 430 |
|
47991
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
431 |
// adds a class path to the boot append entries |
a474466c4fdb
8187118: Remove appending -cp path to the boot class path at AppCDS dump time
jiangli
parents:
47673
diff
changeset
|
432 |
static void add_to_boot_append_entries(ClassPathEntry* new_entry); |
1 | 433 |
|
434 |
// creates a class path zip entry (returns NULL if JAR file cannot be opened) |
|
37220
ec74292c0c9c
8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents:
36508
diff
changeset
|
435 |
static ClassPathZipEntry* create_class_path_zip_entry(const char *apath, bool is_boot_append); |
1 | 436 |
|
36508 | 437 |
static bool string_ends_with(const char* str, const char* str_to_find); |
438 |
||
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
439 |
// obtain package name from a fully qualified class name |
39216
40c3d66352ae
8153858: Clean up needed when obtaining the package name from a fully qualified class name
rprotacio
parents:
38207
diff
changeset
|
440 |
// *bad_class_name is set to true if there's a problem with parsing class_name, to |
40c3d66352ae
8153858: Clean up needed when obtaining the package name from a fully qualified class name
rprotacio
parents:
38207
diff
changeset
|
441 |
// distinguish from a class_name with no package name, as both cases have a NULL return value |
40c3d66352ae
8153858: Clean up needed when obtaining the package name from a fully qualified class name
rprotacio
parents:
38207
diff
changeset
|
442 |
static const char* package_from_name(const char* const class_name, bool* bad_class_name = NULL); |
37773
e5b3e9732c3c
8154956: Module system implementation refresh (4/2016)
alanb
parents:
37418
diff
changeset
|
443 |
|
1 | 444 |
// Debugging |
445 |
static void verify() PRODUCT_RETURN; |
|
446 |
}; |
|
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
447 |
|
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
448 |
// PerfClassTraceTime is used to measure time for class loading related events. |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
449 |
// This class tracks cumulative time and exclusive time for specific event types. |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
450 |
// During the execution of one event, other event types (e.g. class loading and |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
451 |
// resolution) as well as recursive calls of the same event type could happen. |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
452 |
// Only one elapsed timer (cumulative) and one thread-local self timer (exclusive) |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
453 |
// (i.e. only one event type) are active at a time even multiple PerfClassTraceTime |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
454 |
// instances have been created as multiple events are happening. |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
455 |
class PerfClassTraceTime { |
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
456 |
public: |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
457 |
enum { |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
458 |
CLASS_LOAD = 0, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
459 |
PARSE_CLASS = 1, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
460 |
CLASS_LINK = 2, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
461 |
CLASS_VERIFY = 3, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
462 |
CLASS_CLINIT = 4, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
463 |
DEFINE_CLASS = 5, |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
464 |
EVENT_TYPE_COUNT = 6 |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
465 |
}; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
466 |
protected: |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
467 |
// _t tracks time from initialization to destruction of this timer instance |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
468 |
// including time for all other event types, and recursive calls of this type. |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
469 |
// When a timer is called recursively, the elapsedTimer _t would not be used. |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
470 |
elapsedTimer _t; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
471 |
PerfLongCounter* _timep; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
472 |
PerfLongCounter* _selftimep; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
473 |
PerfLongCounter* _eventp; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
474 |
// pointer to thread-local recursion counter and timer array |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
475 |
// The thread_local timers track cumulative time for specific event types |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
476 |
// exclusive of time for other event types, but including recursive calls |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
477 |
// of the same type. |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
478 |
int* _recursion_counters; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
479 |
elapsedTimer* _timers; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
480 |
int _event_type; |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
481 |
int _prev_active_event; |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
482 |
|
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
483 |
public: |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
484 |
|
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
485 |
inline PerfClassTraceTime(PerfLongCounter* timep, /* counter incremented with inclusive time */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
486 |
PerfLongCounter* selftimep, /* counter incremented with exclusive time */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
487 |
PerfLongCounter* eventp, /* event counter */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
488 |
int* recursion_counters, /* thread-local recursion counter array */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
489 |
elapsedTimer* timers, /* thread-local timer array */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
490 |
int type /* event type */ ) : |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
491 |
_timep(timep), _selftimep(selftimep), _eventp(eventp), _recursion_counters(recursion_counters), _timers(timers), _event_type(type) { |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
492 |
initialize(); |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
493 |
} |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
494 |
|
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
495 |
inline PerfClassTraceTime(PerfLongCounter* timep, /* counter incremented with inclusive time */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
496 |
elapsedTimer* timers, /* thread-local timer array */ |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
497 |
int type /* event type */ ) : |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
498 |
_timep(timep), _selftimep(NULL), _eventp(NULL), _recursion_counters(NULL), _timers(timers), _event_type(type) { |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
499 |
initialize(); |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
500 |
} |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
501 |
|
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
502 |
inline void suspend() { _t.stop(); _timers[_event_type].stop(); } |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
503 |
inline void resume() { _t.start(); _timers[_event_type].start(); } |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
504 |
|
7910
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
505 |
~PerfClassTraceTime(); |
135031ddb2bb
6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents:
7397
diff
changeset
|
506 |
void initialize(); |
3575
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
507 |
}; |
224791e7ecab
6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents:
1
diff
changeset
|
508 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52960
diff
changeset
|
509 |
#endif // SHARE_CLASSFILE_CLASSLOADER_HPP |