src/hotspot/share/classfile/classLoader.cpp
changeset 49037 dc68aeea4840
parent 48473 9a5bcee1a706
child 49340 4e82736053ae
equal deleted inserted replaced
49036:bc92debe57e4 49037:dc68aeea4840
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   135 PerfCounter*    ClassLoader::_sync_nonSystemLoaderLockContentionRate = NULL;
   135 PerfCounter*    ClassLoader::_sync_nonSystemLoaderLockContentionRate = NULL;
   136 PerfCounter*    ClassLoader::_sync_JVMFindLoadedClassLockFreeCounter = NULL;
   136 PerfCounter*    ClassLoader::_sync_JVMFindLoadedClassLockFreeCounter = NULL;
   137 PerfCounter*    ClassLoader::_sync_JVMDefineClassLockFreeCounter = NULL;
   137 PerfCounter*    ClassLoader::_sync_JVMDefineClassLockFreeCounter = NULL;
   138 PerfCounter*    ClassLoader::_sync_JNIDefineClassLockFreeCounter = NULL;
   138 PerfCounter*    ClassLoader::_sync_JNIDefineClassLockFreeCounter = NULL;
   139 PerfCounter*    ClassLoader::_unsafe_defineClassCallCounter = NULL;
   139 PerfCounter*    ClassLoader::_unsafe_defineClassCallCounter = NULL;
   140 PerfCounter*    ClassLoader::_isUnsyncloadClass = NULL;
       
   141 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
   140 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
   142 
   141 
   143 GrowableArray<ModuleClassPathList*>* ClassLoader::_patch_mod_entries = NULL;
   142 GrowableArray<ModuleClassPathList*>* ClassLoader::_patch_mod_entries = NULL;
   144 GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
   143 GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
   145 ClassPathEntry* ClassLoader::_jrt_entry = NULL;
   144 ClassPathEntry* ClassLoader::_jrt_entry = NULL;
  1640 
  1639 
  1641     // The following performance counters are added for measuring the impact
  1640     // The following performance counters are added for measuring the impact
  1642     // of the bug fix of 6365597. They are mainly focused on finding out
  1641     // of the bug fix of 6365597. They are mainly focused on finding out
  1643     // the behavior of system & user-defined classloader lock, whether
  1642     // the behavior of system & user-defined classloader lock, whether
  1644     // ClassLoader.loadClass/findClass is being called synchronized or not.
  1643     // ClassLoader.loadClass/findClass is being called synchronized or not.
  1645     // Also two additional counters are created to see whether 'UnsyncloadClass'
       
  1646     // flag is being set or not and how many times load_instance_class call
       
  1647     // fails with linkageError etc.
       
  1648     NEWPERFEVENTCOUNTER(_sync_systemLoaderLockContentionRate, SUN_CLS,
  1644     NEWPERFEVENTCOUNTER(_sync_systemLoaderLockContentionRate, SUN_CLS,
  1649                         "systemLoaderLockContentionRate");
  1645                         "systemLoaderLockContentionRate");
  1650     NEWPERFEVENTCOUNTER(_sync_nonSystemLoaderLockContentionRate, SUN_CLS,
  1646     NEWPERFEVENTCOUNTER(_sync_nonSystemLoaderLockContentionRate, SUN_CLS,
  1651                         "nonSystemLoaderLockContentionRate");
  1647                         "nonSystemLoaderLockContentionRate");
  1652     NEWPERFEVENTCOUNTER(_sync_JVMFindLoadedClassLockFreeCounter, SUN_CLS,
  1648     NEWPERFEVENTCOUNTER(_sync_JVMFindLoadedClassLockFreeCounter, SUN_CLS,
  1658                         "jniDefineClassNoLockCalls");
  1654                         "jniDefineClassNoLockCalls");
  1659 
  1655 
  1660     NEWPERFEVENTCOUNTER(_unsafe_defineClassCallCounter, SUN_CLS,
  1656     NEWPERFEVENTCOUNTER(_unsafe_defineClassCallCounter, SUN_CLS,
  1661                         "unsafeDefineClassCalls");
  1657                         "unsafeDefineClassCalls");
  1662 
  1658 
  1663     NEWPERFEVENTCOUNTER(_isUnsyncloadClass, SUN_CLS, "isUnsyncloadClassSet");
       
  1664     NEWPERFEVENTCOUNTER(_load_instance_class_failCounter, SUN_CLS,
  1659     NEWPERFEVENTCOUNTER(_load_instance_class_failCounter, SUN_CLS,
  1665                         "loadInstanceClassFailRate");
  1660                         "loadInstanceClassFailRate");
  1666 
       
  1667     // increment the isUnsyncloadClass counter if UnsyncloadClass is set.
       
  1668     if (UnsyncloadClass) {
       
  1669       _isUnsyncloadClass->inc();
       
  1670     }
       
  1671   }
  1661   }
  1672 
  1662 
  1673   // lookup zip library entry points
  1663   // lookup zip library entry points
  1674   load_zip_library();
  1664   load_zip_library();
  1675   // lookup jimage library entry points
  1665   // lookup jimage library entry points