hotspot/src/share/vm/classfile/classLoader.hpp
author amurillo
Fri, 06 May 2016 06:12:56 -0700
changeset 38207 2ed792c9481d
parent 37773 e5b3e9732c3c
parent 38192 05ab1ee04bf2
child 39216 40c3d66352ae
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
36364
5971776598e5 8150103: Convert TraceClassPaths to Unified Logging
mockner
parents: 34666
diff changeset
     2
 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_CLASSFILE_CLASSLOADER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_CLASSFILE_CLASSLOADER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    28
#include "runtime/orderAccess.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "runtime/perfData.hpp"
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    30
#include "utilities/exceptions.hpp"
27683
1d5707553fff 8064580: Move INCLUDE_CDS include section to the end of the include list
stefank
parents: 27025
diff changeset
    31
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// The VM class loader.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#include <sys/stat.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    36
// Name of boot "modules" image
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    37
#define  MODULES_IMAGE_NAME "modules"
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    38
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    39
// Name of the resource containing mapping from module names to defining class loader type
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    40
#define MODULE_LOADER_MAP "jdk/internal/vm/cds/resources/ModuleLoaderMap.dat"
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    41
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    42
// Initial sizes of the following arrays are based on the generated ModuleLoaderMap.dat
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    43
#define INITIAL_BOOT_MODULES_ARRAY_SIZE 30
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    44
#define INITIAL_PLATFORM_MODULES_ARRAY_SIZE  15
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    45
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    46
// Class path entry (directory or zip file)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
32619
47acec81dcca 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 31612
diff changeset
    48
class JImageFile;
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    49
class ClassFileStream;
31608
b5cb9a07591a 8080511: Refresh of jimage support
jfdenise
parents: 29076
diff changeset
    50
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    51
class ClassPathEntry : public CHeapObj<mtClass> {
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    52
private:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  ClassPathEntry* _next;
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    54
public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // Next entry in class path
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    56
  ClassPathEntry* next() const { return _next; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  void set_next(ClassPathEntry* next) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    // may have unlocked readers, so write atomically.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    OrderAccess::release_store_ptr(&_next, next);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  }
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    61
  virtual bool is_jrt() = 0;
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    62
  virtual bool is_jar_file() const = 0;
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    63
  virtual const char* name() const = 0;
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    64
  virtual JImageFile* jimage() const = 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  // Constructor
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    66
  ClassPathEntry() : _next(NULL) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  // Attempt to locate file_name through this class path entry.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  // 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
    69
  virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
class ClassPathDirEntry: public ClassPathEntry {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
 private:
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
    76
  const char* _dir;           // Name of directory
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
 public:
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
    78
  bool is_jrt()            { return false; }
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    79
  bool is_jar_file() const { return false;  }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    80
  const char* name() const { return _dir; }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
    81
  JImageFile* jimage() const { return NULL; }
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
    82
  ClassPathDirEntry(const char* dir);
19685
3df9b00b5d5f 8020675: invalid jar file in the bootclasspath could lead to jvm fatal error
ccheung
parents: 17004
diff changeset
    83
  ClassFileStream* open_stream(const char* name, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  // Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
// Type definitions for zip file and zip file entry
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
typedef void* jzfile;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
typedef struct {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  char *name;                   /* entry name */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  jlong time;                   /* modification time */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  jlong size;                   /* size of uncompressed data */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  jlong csize;                  /* size of compressed data (zero if uncompressed) */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  jint crc;                     /* crc of uncompressed data */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  char *comment;                /* optional zip file comment */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  jbyte *extra;                 /* optional extra data */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  jlong pos;                    /* position of LOC header (if negative) or data */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
} jzentry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
class ClassPathZipEntry: public ClassPathEntry {
37418
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   104
 enum {
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   105
   _unknown = 0,
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   106
   _yes     = 1,
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   107
   _no      = 2
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   108
 };
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
 private:
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
   110
  jzfile* _zip;              // The zip archive
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
   111
  const char*   _zip_name;   // Name of zip archive
37220
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   112
  bool _is_boot_append;      // entry coming from -Xbootclasspath/a
37418
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   113
  u1 _multi_versioned;       // indicates if the jar file has multi-versioned entries.
ebb041956080 8152329: jvm should treat the "Multi-Release" jar manifest attribute name as case insensitive
ccheung
parents: 37220
diff changeset
   114
                             // It can have value of "_unknown", "_yes", or "_no"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
 public:
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   116
  bool is_jrt()            { return false; }
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   117
  bool is_jar_file() const { return true;  }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   118
  const char* name() const { return _zip_name; }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   119
  JImageFile* jimage() const { return NULL; }
37220
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   120
  ClassPathZipEntry(jzfile* zip, const char* zip_name, bool is_boot_append);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  ~ClassPathZipEntry();
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   122
  u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
37220
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   123
  u1* open_versioned_entry(const char* name, jint* filesize, TRAPS) NOT_CDS_RETURN_(NULL);
19685
3df9b00b5d5f 8020675: invalid jar file in the bootclasspath could lead to jvm fatal error
ccheung
parents: 17004
diff changeset
   124
  ClassFileStream* open_stream(const char* name, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  void contents_do(void f(const char* name, void* context), void* context);
37220
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   126
  bool is_multiple_versioned(TRAPS) NOT_CDS_RETURN_(false);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  // Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
27562
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   132
// For java image files
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   133
class ClassPathImageEntry: public ClassPathEntry {
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   134
private:
32619
47acec81dcca 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 31612
diff changeset
   135
  JImageFile* _jimage;
47acec81dcca 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 31612
diff changeset
   136
  const char* _name;
27562
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   137
public:
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   138
  bool is_jrt();
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   139
  bool is_jar_file() const { return false; }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   140
  bool is_open() const { return _jimage != NULL; }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   141
  const char* name() const { return _name == NULL ? "" : _name; }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   142
  JImageFile* jimage() const { return _jimage; }
32619
47acec81dcca 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 31612
diff changeset
   143
  ClassPathImageEntry(JImageFile* jimage, const char* name);
27562
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   144
  ~ClassPathImageEntry();
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   145
  ClassFileStream* open_stream(const char* name, TRAPS);
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   146
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   147
  // Debugging
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   148
  NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   151
// ModuleClassPathList contains a linked list of ClassPathEntry's
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   152
// that have been specified for a specific module.  Currently,
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   153
// the only way to specify a module/path pair is via the -Xpatch
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   154
// command line option.
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   155
class ModuleClassPathList : public CHeapObj<mtClass> {
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   156
private:
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   157
  Symbol* _module_name;
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   158
  // 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
   159
  ClassPathEntry* _module_first_entry;
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   160
  ClassPathEntry* _module_last_entry;
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   161
public:
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   162
  Symbol* module_name() const { return _module_name; }
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   163
  ClassPathEntry* module_first_entry() const { return _module_first_entry; }
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   164
  ModuleClassPathList(Symbol* module_name);
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   165
  ~ModuleClassPathList();
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   166
  void add_to_list(ClassPathEntry* new_entry);
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   167
};
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   168
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   169
class SharedPathsMiscInfo;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
class ClassLoader: AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
 public:
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   173
  enum ClassLoaderType {
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   174
    BOOT_LOADER = 1,      /* boot loader */
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   175
    PLATFORM_LOADER  = 2, /* PlatformClassLoader */
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   176
    APP_LOADER  = 3       /* AppClassLoader */
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  };
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   178
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  // Performance counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  static PerfCounter* _perf_accumulated_time;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  static PerfCounter* _perf_classes_inited;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  static PerfCounter* _perf_class_init_time;
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   184
  static PerfCounter* _perf_class_init_selftime;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   185
  static PerfCounter* _perf_classes_verified;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  static PerfCounter* _perf_class_verify_time;
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   187
  static PerfCounter* _perf_class_verify_selftime;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  static PerfCounter* _perf_classes_linked;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  static PerfCounter* _perf_class_link_time;
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   190
  static PerfCounter* _perf_class_link_selftime;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   191
  static PerfCounter* _perf_class_parse_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   192
  static PerfCounter* _perf_class_parse_selftime;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   193
  static PerfCounter* _perf_sys_class_lookup_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   194
  static PerfCounter* _perf_shared_classload_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   195
  static PerfCounter* _perf_sys_classload_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   196
  static PerfCounter* _perf_app_classload_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   197
  static PerfCounter* _perf_app_classload_selftime;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   198
  static PerfCounter* _perf_app_classload_count;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   199
  static PerfCounter* _perf_define_appclasses;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   200
  static PerfCounter* _perf_define_appclass_time;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   201
  static PerfCounter* _perf_define_appclass_selftime;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   202
  static PerfCounter* _perf_app_classfile_bytes_read;
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   203
  static PerfCounter* _perf_sys_classfile_bytes_read;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  static PerfCounter* _sync_systemLoaderLockContentionRate;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  static PerfCounter* _sync_nonSystemLoaderLockContentionRate;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  static PerfCounter* _sync_JVMFindLoadedClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  static PerfCounter* _sync_JVMDefineClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  static PerfCounter* _sync_JNIDefineClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  static PerfCounter* _unsafe_defineClassCallCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  static PerfCounter* _isUnsyncloadClass;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  static PerfCounter* _load_instance_class_failCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   215
  // The boot class path consists of 3 ordered pieces:
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   216
  //  1. the module/path pairs specified to -Xpatch
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   217
  //    -Xpatch:<module>=<file>(<pathsep><file>)*
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   218
  //  2. the base piece
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   219
  //    [exploded build | jimage]
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   220
  //  3. boot loader append path
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   221
  //    [-Xbootclasspath/a]; [jvmti appended entries]
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   222
  //
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   223
  // The boot loader must obey this order when attempting
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   224
  // to load a class.
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   225
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   226
  // Contains the module/path pairs specified to -Xpatch
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   227
  static GrowableArray<ModuleClassPathList*>* _xpatch_entries;
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   228
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   229
  // Contains the ClassPathEntry instances that include
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   230
  // both the base piece and the boot loader append path.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  static ClassPathEntry* _first_entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  // Last entry in linked list of ClassPathEntry instances
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  static ClassPathEntry* _last_entry;
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   234
  static int _num_entries;
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   235
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   236
  // Marks the start of:
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   237
  //   - the boot loader's append path
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   238
  //     [-Xbootclasspath/a]; [jvmti appended entries]
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   239
  // within the linked list of ClassPathEntry instances.
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   240
  static ClassPathEntry* _first_append_entry;
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   241
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  static const char* _shared_archive;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   244
  // True if the boot path has a "modules" jimage
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   245
  static bool _has_jimage;
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   246
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   247
  // Array of module names associated with the boot class loader
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   248
  CDS_ONLY(static GrowableArray<char*>* _boot_modules_array;)
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   249
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   250
  // Array of module names associated with the platform class loader
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   251
  CDS_ONLY(static GrowableArray<char*>* _platform_modules_array;)
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   252
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   253
  // Info used by CDS
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   254
  CDS_ONLY(static SharedPathsMiscInfo * _shared_paths_misc_info;)
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   255
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  // Initialization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  static void setup_bootstrap_search_path();
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   258
  static void setup_search_path(const char *class_path, bool setting_bootstrap);
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   259
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  static void load_zip_library();
32619
47acec81dcca 8087181: Move native jimage code to its own library (maybe libjimage)
jlaskey
parents: 31612
diff changeset
   261
  static void load_jimage_library();
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
   262
  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
   263
                                                 bool throw_exception,
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   264
                                                 bool is_boot_append, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   266
 public:
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   267
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   268
  // If the package for the fully qualified class name is in the boot
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   269
  // loader's package entry table then add_package() sets the classpath_index
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   270
  // field so that get_system_package() will know to return a non-null value
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   271
  // for the package's location.  And, so that the package will be added to
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   272
  // the list of packages returned by get_system_packages().
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   273
  // For packages whose classes are loaded from the boot loader class path, the
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   274
  // classpath_index indicates which entry on the boot loader class path.
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   275
  static bool add_package(const char *fullq_class_name, s2 classpath_index, TRAPS);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   276
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  // Canonicalizes path names, so strcmp will work properly. This is mainly
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  // to avoid confusing the zip library
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
   279
  static bool get_canonical_path(const char* orig, char* out, int len);
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   280
  static const char* file_name_for_class_name(const char* class_name,
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   281
                                              int class_name_len);
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 34287
diff changeset
   282
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
 public:
27562
47f369e3c69c 8049367: Modular Run-Time Images
chegar
parents: 27025
diff changeset
   284
  static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
27025
f4805f778f16 8044269: Analysis of archive files.
jiangli
parents: 26419
diff changeset
   285
  static int crc32(int crc, const char* buf, int len);
26419
25abc4a3285c 8056971: Minor class loading clean-up
iklam
parents: 26135
diff changeset
   286
  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
   287
                                           bool check_for_duplicates,
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   288
                                           bool mark_append_entry,
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   289
                                           bool prepend_entry,
37220
ec74292c0c9c 8075253: Multiversion JAR feature: CDS does not support MV-JARs
ccheung
parents: 36508
diff changeset
   290
                                           bool is_boot_append,
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   291
                                           bool throw_exception=true);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  static void print_bootclasspath();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  // Timing
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   295
  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
   296
  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
   297
  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
   298
  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
   299
  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
   300
  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
   301
  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
   302
  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
   303
  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
   304
  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
   305
  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
   306
  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
   307
  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
   308
  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
   309
  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
   310
  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
   311
  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
   312
  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
   313
  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
   314
  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
   315
  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
   316
  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
   317
  static PerfCounter* perf_sys_classfile_bytes_read() { return _perf_sys_classfile_bytes_read; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  // Record how often system loader lock object is contended
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  static PerfCounter* sync_systemLoaderLockContentionRate() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
    return _sync_systemLoaderLockContentionRate;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  // Record how often non system loader lock object is contended
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  static PerfCounter* sync_nonSystemLoaderLockContentionRate() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    return _sync_nonSystemLoaderLockContentionRate;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  // Record how many calls to JVM_FindLoadedClass w/o holding a lock
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  static PerfCounter* sync_JVMFindLoadedClassLockFreeCounter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
    return _sync_JVMFindLoadedClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  // Record how many calls to JVM_DefineClass w/o holding a lock
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  static PerfCounter* sync_JVMDefineClassLockFreeCounter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
    return _sync_JVMDefineClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  // Record how many calls to jni_DefineClass w/o holding a lock
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  static PerfCounter* sync_JNIDefineClassLockFreeCounter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    return _sync_JNIDefineClassLockFreeCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  // Record how many calls to Unsafe_DefineClass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
  static PerfCounter* unsafe_defineClassCallCounter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
    return _unsafe_defineClassCallCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  // Record how many times SystemDictionary::load_instance_class call
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
  // fails with linkageError when Unsyncloadclass flag is set.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  static PerfCounter* load_instance_class_failCounter() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
    return _load_instance_class_failCounter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   355
  // Set up the module/path pairs as specified to -Xpatch
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   356
  static void setup_xpatch_entries();
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   357
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   358
  // Sets _has_jimage to TRUE if "modules" jimage file exists
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   359
  static void set_has_jimage();
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   360
  static bool has_jimage() { return _has_jimage; }
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   361
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   362
  // Create the ModuleEntry for java.base
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   363
  static void create_javabase();
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   364
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
  // Load individual .class file
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   366
  static instanceKlassHandle load_class(Symbol* class_name, bool search_append_only, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
  // If the specified package has been loaded by the system, then returns
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  // the name of the directory or ZIP file that the package was loaded from.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  // Returns null if the package was not loaded.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  // Note: The specified name can either be the name of a class or package.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  // If a package name is specified, then it must be "/"-separator and also
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  // end with a trailing "/".
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  static oop get_system_package(const char* name, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  // Returns an array of Java strings representing all of the currently
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  // loaded system packages.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
  // Note: The package names returned are "/"-separated and end with a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  // trailing "/".
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
  static objArrayOop get_system_packages(TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  // Initialization
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  static void initialize();
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   384
  CDS_ONLY(static void initialize_shared_path();)
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   385
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  static int compute_Object_vtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  static ClassPathEntry* classpath_entry(int n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
    ClassPathEntry* e = ClassLoader::_first_entry;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
    while (--n >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
      assert(e != NULL, "Not that many classpath entries.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
      e = e->next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
    return e;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   397
#if INCLUDE_CDS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  // Sharing dump and restore
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   400
  static void  check_shared_classpath(const char *path);
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   401
  static void  finalize_shared_paths_misc_info();
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   402
  static int   get_shared_paths_misc_info_size();
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   403
  static void* get_shared_paths_misc_info();
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   404
  static bool  check_shared_paths_misc_info(void* info, int size);
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   405
  static void  exit_with_path_failure(const char* error, const char* message);
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   406
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   407
  static s2 module_to_classloader(const char* module_name);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   408
  static void initialize_module_loader_map(JImageFile* jimage);
38192
05ab1ee04bf2 8155678: ClassLoader::initialize_module_loader_map should only be called when dumping CDS archive.
jiangli
parents: 37418
diff changeset
   409
  static s2 classloader_type(Symbol* class_name, ClassPathEntry* e,
05ab1ee04bf2 8155678: ClassLoader::initialize_module_loader_map should only be called when dumping CDS archive.
jiangli
parents: 37418
diff changeset
   410
                             int classpath_index, TRAPS);
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   411
#endif
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   412
36364
5971776598e5 8150103: Convert TraceClassPaths to Unified Logging
mockner
parents: 34666
diff changeset
   413
  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
   414
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  // VM monitoring and management support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
  static jlong classloader_time_ms();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
  static jlong class_method_total_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
  static jlong class_init_count();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  static jlong class_init_time_ms();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
  static jlong class_verify_time_ms();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  static jlong class_link_count();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  static jlong class_link_time_ms();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   424
  static void set_first_append_entry(ClassPathEntry* entry);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   425
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  // indicates if class path already contains a entry (exact match by name)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
  static bool contains_entry(ClassPathEntry* entry);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
  // adds a class path list
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
  static void add_to_list(ClassPathEntry* new_entry);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   432
  // prepends a class path list
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   433
  static void prepend_to_list(ClassPathEntry* new_entry);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   434
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
  // 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
   436
  static ClassPathZipEntry* create_class_path_zip_entry(const char *apath, bool is_boot_append);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   438
  // add a path to class path list
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   439
  static void add_to_list(const char* apath);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   440
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   441
  // prepend a path to class path list
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   442
  static void prepend_to_list(const char* apath);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   443
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   444
  static bool string_ends_with(const char* str, const char* str_to_find);
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   445
37773
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   446
  // obtain package name from a fully qualified class name
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   447
  static const char* package_from_name(const char* class_name);
e5b3e9732c3c 8154956: Module system implementation refresh (4/2016)
alanb
parents: 37418
diff changeset
   448
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   449
  static bool is_jrt(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 36364
diff changeset
   450
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
  // Debugging
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
  static void verify()              PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
  // Force compilation of all methods in all classes in bootstrap class path (stress test)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
#ifndef PRODUCT
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 25949
diff changeset
   456
 protected:
17004
4d2371d76a19 8011933: add number of classes, methods and time spent to CompileTheWorld
twisti
parents: 13963
diff changeset
   457
  static int _compile_the_world_class_counter;
4d2371d76a19 8011933: add number of classes, methods and time spent to CompileTheWorld
twisti
parents: 13963
diff changeset
   458
  static int _compile_the_world_method_counter;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
  static void compile_the_world();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  static void compile_the_world_in(char* name, Handle loader, TRAPS);
17004
4d2371d76a19 8011933: add number of classes, methods and time spent to CompileTheWorld
twisti
parents: 13963
diff changeset
   462
  static int  compile_the_world_counter() { return _compile_the_world_class_counter; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
#endif //PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
};
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   465
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   466
// 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
   467
// 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
   468
// 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
   469
// 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
   470
// 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
   471
// (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
   472
// 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
   473
class PerfClassTraceTime {
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   474
 public:
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   475
  enum {
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   476
    CLASS_LOAD   = 0,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   477
    PARSE_CLASS  = 1,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   478
    CLASS_LINK   = 2,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   479
    CLASS_VERIFY = 3,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   480
    CLASS_CLINIT = 4,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   481
    DEFINE_CLASS = 5,
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   482
    EVENT_TYPE_COUNT = 6
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   483
  };
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   484
 protected:
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   485
  // _t tracks time from initialization to destruction of this timer instance
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   486
  // 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
   487
  // 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
   488
  elapsedTimer     _t;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   489
  PerfLongCounter* _timep;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   490
  PerfLongCounter* _selftimep;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   491
  PerfLongCounter* _eventp;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   492
  // pointer to thread-local recursion counter and timer array
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   493
  // The thread_local timers track cumulative time for specific event types
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   494
  // exclusive of time for other event types, but including recursive calls
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   495
  // of the same type.
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   496
  int*             _recursion_counters;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   497
  elapsedTimer*    _timers;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   498
  int              _event_type;
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   499
  int              _prev_active_event;
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   500
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   501
 public:
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   502
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   503
  inline PerfClassTraceTime(PerfLongCounter* timep,     /* counter incremented with inclusive time */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   504
                            PerfLongCounter* selftimep, /* counter incremented with exclusive time */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   505
                            PerfLongCounter* eventp,    /* event counter */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   506
                            int* recursion_counters,    /* thread-local recursion counter array */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   507
                            elapsedTimer* timers,       /* thread-local timer array */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   508
                            int type                    /* event type */ ) :
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   509
      _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
   510
    initialize();
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   511
  }
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   512
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   513
  inline PerfClassTraceTime(PerfLongCounter* timep,     /* counter incremented with inclusive time */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   514
                            elapsedTimer* timers,       /* thread-local timer array */
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   515
                            int type                    /* event type */ ) :
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   516
      _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
   517
    initialize();
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   518
  }
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   519
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   520
  inline void suspend() { _t.stop(); _timers[_event_type].stop(); }
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   521
  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
   522
7910
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   523
  ~PerfClassTraceTime();
135031ddb2bb 6966589: hs16-b08 causes java.lang.StackOverflowError
minqi
parents: 7397
diff changeset
   524
  void initialize();
3575
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   525
};
224791e7ecab 6857194: Add hotspot perf counters to aid class loading performance measurement
mchung
parents: 1
diff changeset
   526
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   527
#endif // SHARE_VM_CLASSFILE_CLASSLOADER_HPP