annotate src/share/vm/classfile/classLoader.hpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents 4aa80ca3dbec
children 723df37192d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2426
1d1603768966 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 2177
diff changeset
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 948
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 948
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 948
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_CLASSFILE_CLASSLOADER_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "classfile/classFileParser.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "runtime/perfData.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // The VM class loader.
a61af66fc99e Initial load
duke
parents:
diff changeset
32 #include <sys/stat.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Meta-index (optional, to be able to skip opening boot classpath jar files)
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class MetaIndex: public CHeapObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
38 char** _meta_package_names;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 int _num_meta_package_names;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
41 MetaIndex(char** meta_package_names, int num_meta_package_names);
a61af66fc99e Initial load
duke
parents:
diff changeset
42 ~MetaIndex();
a61af66fc99e Initial load
duke
parents:
diff changeset
43 bool may_contain(const char* class_name);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 };
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // Class path entry (directory or zip file)
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 class ClassPathEntry: public CHeapObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
50 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
51 ClassPathEntry* _next;
3546
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
52 bool _compiler_thread_only;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // Next entry in class path
a61af66fc99e Initial load
duke
parents:
diff changeset
55 ClassPathEntry* next() { return _next; }
a61af66fc99e Initial load
duke
parents:
diff changeset
56 void set_next(ClassPathEntry* next) {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // may have unlocked readers, so write atomically.
a61af66fc99e Initial load
duke
parents:
diff changeset
58 OrderAccess::release_store_ptr(&_next, next);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60 virtual bool is_jar_file() = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 virtual const char* name() = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 virtual bool is_lazy();
3546
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
63 bool compiler_thread_only() const { return _compiler_thread_only; }
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
64 void set_compiler_thread_only(bool b) { _compiler_thread_only = b; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // Constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ClassPathEntry();
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // Attempt to locate file_name through this class path entry.
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // Returns a class file parsing stream if successfull.
a61af66fc99e Initial load
duke
parents:
diff changeset
69 virtual ClassFileStream* open_stream(const char* name) = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
71 NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
a61af66fc99e Initial load
duke
parents:
diff changeset
72 NOT_PRODUCT(virtual bool is_rt_jar() = 0;)
a61af66fc99e Initial load
duke
parents:
diff changeset
73 };
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 class ClassPathDirEntry: public ClassPathEntry {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
78 char* _dir; // Name of directory
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
80 bool is_jar_file() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 const char* name() { return _dir; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 ClassPathDirEntry(char* dir);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 ClassFileStream* open_stream(const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
85 NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
a61af66fc99e Initial load
duke
parents:
diff changeset
86 NOT_PRODUCT(bool is_rt_jar();)
a61af66fc99e Initial load
duke
parents:
diff changeset
87 };
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // Type definitions for zip file and zip file entry
a61af66fc99e Initial load
duke
parents:
diff changeset
91 typedef void* jzfile;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 char *name; /* entry name */
a61af66fc99e Initial load
duke
parents:
diff changeset
94 jlong time; /* modification time */
a61af66fc99e Initial load
duke
parents:
diff changeset
95 jlong size; /* size of uncompressed data */
a61af66fc99e Initial load
duke
parents:
diff changeset
96 jlong csize; /* size of compressed data (zero if uncompressed) */
a61af66fc99e Initial load
duke
parents:
diff changeset
97 jint crc; /* crc of uncompressed data */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 char *comment; /* optional zip file comment */
a61af66fc99e Initial load
duke
parents:
diff changeset
99 jbyte *extra; /* optional extra data */
a61af66fc99e Initial load
duke
parents:
diff changeset
100 jlong pos; /* position of LOC header (if negative) or data */
a61af66fc99e Initial load
duke
parents:
diff changeset
101 } jzentry;
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 class ClassPathZipEntry: public ClassPathEntry {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
106 jzfile* _zip; // The zip archive
a61af66fc99e Initial load
duke
parents:
diff changeset
107 char* _zip_name; // Name of zip archive
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
109 bool is_jar_file() { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
110 const char* name() { return _zip_name; }
a61af66fc99e Initial load
duke
parents:
diff changeset
111 ClassPathZipEntry(jzfile* zip, const char* zip_name);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 ~ClassPathZipEntry();
a61af66fc99e Initial load
duke
parents:
diff changeset
113 ClassFileStream* open_stream(const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 void contents_do(void f(const char* name, void* context), void* context);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
116 NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
a61af66fc99e Initial load
duke
parents:
diff changeset
117 NOT_PRODUCT(void compile_the_world12(Handle loader, TRAPS);) // JDK 1.2 version
a61af66fc99e Initial load
duke
parents:
diff changeset
118 NOT_PRODUCT(void compile_the_world13(Handle loader, TRAPS);) // JDK 1.3 version
a61af66fc99e Initial load
duke
parents:
diff changeset
119 NOT_PRODUCT(bool is_rt_jar();)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 NOT_PRODUCT(bool is_rt_jar12();)
a61af66fc99e Initial load
duke
parents:
diff changeset
121 NOT_PRODUCT(bool is_rt_jar13();)
a61af66fc99e Initial load
duke
parents:
diff changeset
122 };
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // For lazier loading of boot class path entries
a61af66fc99e Initial load
duke
parents:
diff changeset
126 class LazyClassPathEntry: public ClassPathEntry {
a61af66fc99e Initial load
duke
parents:
diff changeset
127 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
128 char* _path; // dir or file
a61af66fc99e Initial load
duke
parents:
diff changeset
129 struct stat _st;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 MetaIndex* _meta_index;
a61af66fc99e Initial load
duke
parents:
diff changeset
131 volatile ClassPathEntry* _resolved_entry;
a61af66fc99e Initial load
duke
parents:
diff changeset
132 ClassPathEntry* resolve_entry();
a61af66fc99e Initial load
duke
parents:
diff changeset
133 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
134 bool is_jar_file();
a61af66fc99e Initial load
duke
parents:
diff changeset
135 const char* name() { return _path; }
a61af66fc99e Initial load
duke
parents:
diff changeset
136 LazyClassPathEntry(char* path, struct stat st);
a61af66fc99e Initial load
duke
parents:
diff changeset
137 ClassFileStream* open_stream(const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
138 void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
a61af66fc99e Initial load
duke
parents:
diff changeset
139 virtual bool is_lazy();
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
141 NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
a61af66fc99e Initial load
duke
parents:
diff changeset
142 NOT_PRODUCT(bool is_rt_jar();)
a61af66fc99e Initial load
duke
parents:
diff changeset
143 };
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 class PackageHashtable;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 class PackageInfo;
a61af66fc99e Initial load
duke
parents:
diff changeset
147 class HashtableBucket;
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 class ClassLoader: AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
151 enum SomeConstants {
a61af66fc99e Initial load
duke
parents:
diff changeset
152 package_hash_table_size = 31 // Number of buckets
a61af66fc99e Initial load
duke
parents:
diff changeset
153 };
a61af66fc99e Initial load
duke
parents:
diff changeset
154 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
155 friend class LazyClassPathEntry;
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // Performance counters
a61af66fc99e Initial load
duke
parents:
diff changeset
158 static PerfCounter* _perf_accumulated_time;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 static PerfCounter* _perf_classes_inited;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 static PerfCounter* _perf_class_init_time;
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
161 static PerfCounter* _perf_class_init_selftime;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
162 static PerfCounter* _perf_classes_verified;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
163 static PerfCounter* _perf_class_verify_time;
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
164 static PerfCounter* _perf_class_verify_selftime;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
165 static PerfCounter* _perf_classes_linked;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 static PerfCounter* _perf_class_link_time;
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
167 static PerfCounter* _perf_class_link_selftime;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
168 static PerfCounter* _perf_class_parse_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
169 static PerfCounter* _perf_class_parse_selftime;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
170 static PerfCounter* _perf_sys_class_lookup_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
171 static PerfCounter* _perf_shared_classload_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
172 static PerfCounter* _perf_sys_classload_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
173 static PerfCounter* _perf_app_classload_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
174 static PerfCounter* _perf_app_classload_selftime;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
175 static PerfCounter* _perf_app_classload_count;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
176 static PerfCounter* _perf_define_appclasses;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
177 static PerfCounter* _perf_define_appclass_time;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
178 static PerfCounter* _perf_define_appclass_selftime;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
179 static PerfCounter* _perf_app_classfile_bytes_read;
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
180 static PerfCounter* _perf_sys_classfile_bytes_read;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 static PerfCounter* _sync_systemLoaderLockContentionRate;
a61af66fc99e Initial load
duke
parents:
diff changeset
183 static PerfCounter* _sync_nonSystemLoaderLockContentionRate;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 static PerfCounter* _sync_JVMFindLoadedClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
185 static PerfCounter* _sync_JVMDefineClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
186 static PerfCounter* _sync_JNIDefineClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 static PerfCounter* _unsafe_defineClassCallCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
189 static PerfCounter* _isUnsyncloadClass;
a61af66fc99e Initial load
duke
parents:
diff changeset
190 static PerfCounter* _load_instance_class_failCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 // First entry in linked list of ClassPathEntry instances
a61af66fc99e Initial load
duke
parents:
diff changeset
193 static ClassPathEntry* _first_entry;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 // Last entry in linked list of ClassPathEntry instances
a61af66fc99e Initial load
duke
parents:
diff changeset
195 static ClassPathEntry* _last_entry;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // Hash table used to keep track of loaded packages
a61af66fc99e Initial load
duke
parents:
diff changeset
197 static PackageHashtable* _package_hash_table;
a61af66fc99e Initial load
duke
parents:
diff changeset
198 static const char* _shared_archive;
a61af66fc99e Initial load
duke
parents:
diff changeset
199
a61af66fc99e Initial load
duke
parents:
diff changeset
200 // Hash function
a61af66fc99e Initial load
duke
parents:
diff changeset
201 static unsigned int hash(const char *s, int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
202 // Returns the package file name corresponding to the specified package
a61af66fc99e Initial load
duke
parents:
diff changeset
203 // or class name, or null if not found.
a61af66fc99e Initial load
duke
parents:
diff changeset
204 static PackageInfo* lookup_package(const char *pkgname);
a61af66fc99e Initial load
duke
parents:
diff changeset
205 // Adds a new package entry for the specified class or package name and
a61af66fc99e Initial load
duke
parents:
diff changeset
206 // corresponding directory or jar file name.
a61af66fc99e Initial load
duke
parents:
diff changeset
207 static bool add_package(const char *pkgname, int classpath_index, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 // Initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
210 static void setup_meta_index();
a61af66fc99e Initial load
duke
parents:
diff changeset
211 static void setup_bootstrap_search_path();
3546
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
212 static void setup_bootstrap_search_path(char* sys_class_path, bool compiler_cp);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
213 static void load_zip_library();
a61af66fc99e Initial load
duke
parents:
diff changeset
214 static void create_class_path_entry(char *path, struct stat st, ClassPathEntry **new_entry, bool lazy);
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // Canonicalizes path names, so strcmp will work properly. This is mainly
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // to avoid confusing the zip library
a61af66fc99e Initial load
duke
parents:
diff changeset
218 static bool get_canonical_path(char* orig, char* out, int len);
a61af66fc99e Initial load
duke
parents:
diff changeset
219 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
220 // Used by the kernel jvm.
a61af66fc99e Initial load
duke
parents:
diff changeset
221 static void update_class_path_entry_list(const char *path,
3546
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
222 bool check_for_duplicates,
4aa80ca3dbec Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2426
diff changeset
223 bool compiler_cp);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
224 static void print_bootclasspath();
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // Timing
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
227 static PerfCounter* perf_accumulated_time() { return _perf_accumulated_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
228 static PerfCounter* perf_classes_inited() { return _perf_classes_inited; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
229 static PerfCounter* perf_class_init_time() { return _perf_class_init_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
230 static PerfCounter* perf_class_init_selftime() { return _perf_class_init_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
231 static PerfCounter* perf_classes_verified() { return _perf_classes_verified; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
232 static PerfCounter* perf_class_verify_time() { return _perf_class_verify_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
233 static PerfCounter* perf_class_verify_selftime() { return _perf_class_verify_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
234 static PerfCounter* perf_classes_linked() { return _perf_classes_linked; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
235 static PerfCounter* perf_class_link_time() { return _perf_class_link_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
236 static PerfCounter* perf_class_link_selftime() { return _perf_class_link_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
237 static PerfCounter* perf_class_parse_time() { return _perf_class_parse_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
238 static PerfCounter* perf_class_parse_selftime() { return _perf_class_parse_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
239 static PerfCounter* perf_sys_class_lookup_time() { return _perf_sys_class_lookup_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
240 static PerfCounter* perf_shared_classload_time() { return _perf_shared_classload_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
241 static PerfCounter* perf_sys_classload_time() { return _perf_sys_classload_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
242 static PerfCounter* perf_app_classload_time() { return _perf_app_classload_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
243 static PerfCounter* perf_app_classload_selftime() { return _perf_app_classload_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
244 static PerfCounter* perf_app_classload_count() { return _perf_app_classload_count; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
245 static PerfCounter* perf_define_appclasses() { return _perf_define_appclasses; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
246 static PerfCounter* perf_define_appclass_time() { return _perf_define_appclass_time; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
247 static PerfCounter* perf_define_appclass_selftime() { return _perf_define_appclass_selftime; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
248 static PerfCounter* perf_app_classfile_bytes_read() { return _perf_app_classfile_bytes_read; }
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
249 static PerfCounter* perf_sys_classfile_bytes_read() { return _perf_sys_classfile_bytes_read; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
250
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // Record how often system loader lock object is contended
a61af66fc99e Initial load
duke
parents:
diff changeset
252 static PerfCounter* sync_systemLoaderLockContentionRate() {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 return _sync_systemLoaderLockContentionRate;
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 // Record how often non system loader lock object is contended
a61af66fc99e Initial load
duke
parents:
diff changeset
257 static PerfCounter* sync_nonSystemLoaderLockContentionRate() {
a61af66fc99e Initial load
duke
parents:
diff changeset
258 return _sync_nonSystemLoaderLockContentionRate;
a61af66fc99e Initial load
duke
parents:
diff changeset
259 }
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 // Record how many calls to JVM_FindLoadedClass w/o holding a lock
a61af66fc99e Initial load
duke
parents:
diff changeset
262 static PerfCounter* sync_JVMFindLoadedClassLockFreeCounter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 return _sync_JVMFindLoadedClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 // Record how many calls to JVM_DefineClass w/o holding a lock
a61af66fc99e Initial load
duke
parents:
diff changeset
267 static PerfCounter* sync_JVMDefineClassLockFreeCounter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
268 return _sync_JVMDefineClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
269 }
a61af66fc99e Initial load
duke
parents:
diff changeset
270
a61af66fc99e Initial load
duke
parents:
diff changeset
271 // Record how many calls to jni_DefineClass w/o holding a lock
a61af66fc99e Initial load
duke
parents:
diff changeset
272 static PerfCounter* sync_JNIDefineClassLockFreeCounter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
273 return _sync_JNIDefineClassLockFreeCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
274 }
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 // Record how many calls to Unsafe_DefineClass
a61af66fc99e Initial load
duke
parents:
diff changeset
277 static PerfCounter* unsafe_defineClassCallCounter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
278 return _unsafe_defineClassCallCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
279 }
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 // Record how many times SystemDictionary::load_instance_class call
a61af66fc99e Initial load
duke
parents:
diff changeset
282 // fails with linkageError when Unsyncloadclass flag is set.
a61af66fc99e Initial load
duke
parents:
diff changeset
283 static PerfCounter* load_instance_class_failCounter() {
a61af66fc99e Initial load
duke
parents:
diff changeset
284 return _load_instance_class_failCounter;
a61af66fc99e Initial load
duke
parents:
diff changeset
285 }
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // Load individual .class file
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 2139
diff changeset
288 static instanceKlassHandle load_classfile(Symbol* h_name, TRAPS);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289
a61af66fc99e Initial load
duke
parents:
diff changeset
290 // If the specified package has been loaded by the system, then returns
a61af66fc99e Initial load
duke
parents:
diff changeset
291 // the name of the directory or ZIP file that the package was loaded from.
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // Returns null if the package was not loaded.
a61af66fc99e Initial load
duke
parents:
diff changeset
293 // Note: The specified name can either be the name of a class or package.
a61af66fc99e Initial load
duke
parents:
diff changeset
294 // If a package name is specified, then it must be "/"-separator and also
a61af66fc99e Initial load
duke
parents:
diff changeset
295 // end with a trailing "/".
a61af66fc99e Initial load
duke
parents:
diff changeset
296 static oop get_system_package(const char* name, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
297
a61af66fc99e Initial load
duke
parents:
diff changeset
298 // Returns an array of Java strings representing all of the currently
a61af66fc99e Initial load
duke
parents:
diff changeset
299 // loaded system packages.
a61af66fc99e Initial load
duke
parents:
diff changeset
300 // Note: The package names returned are "/"-separated and end with a
a61af66fc99e Initial load
duke
parents:
diff changeset
301 // trailing "/".
a61af66fc99e Initial load
duke
parents:
diff changeset
302 static objArrayOop get_system_packages(TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
303
a61af66fc99e Initial load
duke
parents:
diff changeset
304 // Initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
305 static void initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
306 static void create_package_info_table();
a61af66fc99e Initial load
duke
parents:
diff changeset
307 static void create_package_info_table(HashtableBucket *t, int length,
a61af66fc99e Initial load
duke
parents:
diff changeset
308 int number_of_entries);
a61af66fc99e Initial load
duke
parents:
diff changeset
309 static int compute_Object_vtable();
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 static ClassPathEntry* classpath_entry(int n) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 ClassPathEntry* e = ClassLoader::_first_entry;
a61af66fc99e Initial load
duke
parents:
diff changeset
313 while (--n >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
314 assert(e != NULL, "Not that many classpath entries.");
a61af66fc99e Initial load
duke
parents:
diff changeset
315 e = e->next();
a61af66fc99e Initial load
duke
parents:
diff changeset
316 }
a61af66fc99e Initial load
duke
parents:
diff changeset
317 return e;
a61af66fc99e Initial load
duke
parents:
diff changeset
318 }
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320 // Sharing dump and restore
a61af66fc99e Initial load
duke
parents:
diff changeset
321 static void copy_package_info_buckets(char** top, char* end);
a61af66fc99e Initial load
duke
parents:
diff changeset
322 static void copy_package_info_table(char** top, char* end);
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 // VM monitoring and management support
a61af66fc99e Initial load
duke
parents:
diff changeset
325 static jlong classloader_time_ms();
a61af66fc99e Initial load
duke
parents:
diff changeset
326 static jlong class_method_total_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
327 static jlong class_init_count();
a61af66fc99e Initial load
duke
parents:
diff changeset
328 static jlong class_init_time_ms();
a61af66fc99e Initial load
duke
parents:
diff changeset
329 static jlong class_verify_time_ms();
a61af66fc99e Initial load
duke
parents:
diff changeset
330 static jlong class_link_count();
a61af66fc99e Initial load
duke
parents:
diff changeset
331 static jlong class_link_time_ms();
a61af66fc99e Initial load
duke
parents:
diff changeset
332
a61af66fc99e Initial load
duke
parents:
diff changeset
333 // indicates if class path already contains a entry (exact match by name)
a61af66fc99e Initial load
duke
parents:
diff changeset
334 static bool contains_entry(ClassPathEntry* entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
335
a61af66fc99e Initial load
duke
parents:
diff changeset
336 // adds a class path list
a61af66fc99e Initial load
duke
parents:
diff changeset
337 static void add_to_list(ClassPathEntry* new_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
338
a61af66fc99e Initial load
duke
parents:
diff changeset
339 // creates a class path zip entry (returns NULL if JAR file cannot be opened)
a61af66fc99e Initial load
duke
parents:
diff changeset
340 static ClassPathZipEntry* create_class_path_zip_entry(const char *apath);
a61af66fc99e Initial load
duke
parents:
diff changeset
341
a61af66fc99e Initial load
duke
parents:
diff changeset
342 // Debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
343 static void verify() PRODUCT_RETURN;
a61af66fc99e Initial load
duke
parents:
diff changeset
344
a61af66fc99e Initial load
duke
parents:
diff changeset
345 // Force compilation of all methods in all classes in bootstrap class path (stress test)
a61af66fc99e Initial load
duke
parents:
diff changeset
346 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
347 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
348 static int _compile_the_world_counter;
a61af66fc99e Initial load
duke
parents:
diff changeset
349 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
350 static void compile_the_world();
a61af66fc99e Initial load
duke
parents:
diff changeset
351 static void compile_the_world_in(char* name, Handle loader, TRAPS);
a61af66fc99e Initial load
duke
parents:
diff changeset
352 static int compile_the_world_counter() { return _compile_the_world_counter; }
a61af66fc99e Initial load
duke
parents:
diff changeset
353 #endif //PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
354 };
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
355
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
356 // PerfClassTraceTime is used to measure time for class loading related events.
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
357 // This class tracks cumulative time and exclusive time for specific event types.
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
358 // During the execution of one event, other event types (e.g. class loading and
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
359 // resolution) as well as recursive calls of the same event type could happen.
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
360 // Only one elapsed timer (cumulative) and one thread-local self timer (exclusive)
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
361 // (i.e. only one event type) are active at a time even multiple PerfClassTraceTime
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
362 // instances have been created as multiple events are happening.
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
363 class PerfClassTraceTime {
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
364 public:
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
365 enum {
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
366 CLASS_LOAD = 0,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
367 PARSE_CLASS = 1,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
368 CLASS_LINK = 2,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
369 CLASS_VERIFY = 3,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
370 CLASS_CLINIT = 4,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
371 DEFINE_CLASS = 5,
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
372 EVENT_TYPE_COUNT = 6
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
373 };
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
374 protected:
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
375 // _t tracks time from initialization to destruction of this timer instance
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
376 // including time for all other event types, and recursive calls of this type.
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
377 // When a timer is called recursively, the elapsedTimer _t would not be used.
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
378 elapsedTimer _t;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
379 PerfLongCounter* _timep;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
380 PerfLongCounter* _selftimep;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
381 PerfLongCounter* _eventp;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
382 // pointer to thread-local recursion counter and timer array
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
383 // The thread_local timers track cumulative time for specific event types
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
384 // exclusive of time for other event types, but including recursive calls
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
385 // of the same type.
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
386 int* _recursion_counters;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
387 elapsedTimer* _timers;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
388 int _event_type;
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
389 int _prev_active_event;
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
390
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
391 public:
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
392
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
393 inline PerfClassTraceTime(PerfLongCounter* timep, /* counter incremented with inclusive time */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
394 PerfLongCounter* selftimep, /* counter incremented with exclusive time */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
395 PerfLongCounter* eventp, /* event counter */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
396 int* recursion_counters, /* thread-local recursion counter array */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
397 elapsedTimer* timers, /* thread-local timer array */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
398 int type /* event type */ ) :
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
399 _timep(timep), _selftimep(selftimep), _eventp(eventp), _recursion_counters(recursion_counters), _timers(timers), _event_type(type) {
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
400 initialize();
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
401 }
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
402
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
403 inline PerfClassTraceTime(PerfLongCounter* timep, /* counter incremented with inclusive time */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
404 elapsedTimer* timers, /* thread-local timer array */
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
405 int type /* event type */ ) :
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
406 _timep(timep), _selftimep(NULL), _eventp(NULL), _recursion_counters(NULL), _timers(timers), _event_type(type) {
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
407 initialize();
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
408 }
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
409
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
410 inline void suspend() { _t.stop(); _timers[_event_type].stop(); }
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
411 inline void resume() { _t.start(); _timers[_event_type].start(); }
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
412
2139
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
413 ~PerfClassTraceTime();
75efcee5ac47 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 1972
diff changeset
414 void initialize();
875
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
415 };
6a93908f268f 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 0
diff changeset
416
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
417 #endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP