src/share/vm/classfile/classLoader.hpp

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 6868
ca6d25be853b
parent 0
f90c822e73f8
child 7535
7ae4e26cb1e0
permissions
-rw-r--r--

merge

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

mercurial