src/hotspot/share/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/share/classfile

src/hotspot/share/classfile/classLoader.cpp

Print this page




 131 PerfCounter*    ClassLoader::_perf_define_appclass_time = NULL;
 132 PerfCounter*    ClassLoader::_perf_define_appclass_selftime = NULL;
 133 PerfCounter*    ClassLoader::_perf_app_classfile_bytes_read = NULL;
 134 PerfCounter*    ClassLoader::_perf_sys_classfile_bytes_read = NULL;
 135 PerfCounter*    ClassLoader::_sync_systemLoaderLockContentionRate = NULL;
 136 PerfCounter*    ClassLoader::_sync_nonSystemLoaderLockContentionRate = NULL;
 137 PerfCounter*    ClassLoader::_sync_JVMFindLoadedClassLockFreeCounter = NULL;
 138 PerfCounter*    ClassLoader::_sync_JVMDefineClassLockFreeCounter = NULL;
 139 PerfCounter*    ClassLoader::_sync_JNIDefineClassLockFreeCounter = NULL;
 140 PerfCounter*    ClassLoader::_unsafe_defineClassCallCounter = NULL;
 141 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
 142 
 143 GrowableArray<ModuleClassPathList*>* ClassLoader::_patch_mod_entries = NULL;
 144 GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
 145 ClassPathEntry* ClassLoader::_jrt_entry = NULL;
 146 ClassPathEntry* ClassLoader::_first_append_entry = NULL;
 147 ClassPathEntry* ClassLoader::_last_append_entry  = NULL;
 148 #if INCLUDE_CDS
 149 ClassPathEntry* ClassLoader::_app_classpath_entries = NULL;
 150 ClassPathEntry* ClassLoader::_last_app_classpath_entry = NULL;


 151 SharedPathsMiscInfo* ClassLoader::_shared_paths_misc_info = NULL;
 152 #endif
 153 
 154 // helper routines
 155 bool string_starts_with(const char* str, const char* str_to_find) {
 156   size_t str_len = strlen(str);
 157   size_t str_to_find_len = strlen(str_to_find);
 158   if (str_to_find_len > str_len) {
 159     return false;
 160   }
 161   return (strncmp(str, str_to_find, str_to_find_len) == 0);
 162 }
 163 
 164 static const char* get_jimage_version_string() {
 165   static char version_string[10] = "";
 166   if (version_string[0] == '\0') {
 167     jio_snprintf(version_string, sizeof(version_string), "%d.%d",
 168                  Abstract_VM_Version::vm_major_version(), Abstract_VM_Version::vm_minor_version());
 169   }
 170   return (const char*)version_string;


 704   for (int start = 0; start < len; start = end) {
 705     while (class_path[end] && class_path[end] != os::path_separator()[0]) {
 706       end++;
 707     }
 708     EXCEPTION_MARK;
 709     ResourceMark rm(THREAD);
 710     char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
 711     strncpy(path, &class_path[start], end - start);
 712     path[end - start] = '\0';
 713 
 714     check_shared_classpath(path);
 715 
 716     update_class_path_entry_list(path, false, false);
 717 
 718     while (class_path[end] == os::path_separator()[0]) {
 719       end++;
 720     }
 721   }
 722 }
 723 
 724 #endif





































 725 
 726 // Construct the array of module/path pairs as specified to --patch-module
 727 // for the boot loader to search ahead of the jimage, if the class being
 728 // loaded is defined to a module that has been specified to --patch-module.
 729 void ClassLoader::setup_patch_mod_entries() {
 730   Thread* THREAD = Thread::current();
 731   GrowableArray<ModulePatchPath*>* patch_mod_args = Arguments::get_patch_mod_prefix();
 732   int num_of_entries = patch_mod_args->length();
 733 
 734 
 735   // Set up the boot loader's _patch_mod_entries list
 736   _patch_mod_entries = new (ResourceObj::C_HEAP, mtModule) GrowableArray<ModuleClassPathList*>(num_of_entries, true);
 737 
 738   for (int i = 0; i < num_of_entries; i++) {
 739     const char* module_name = (patch_mod_args->at(i))->module_name();
 740     Symbol* const module_sym = SymbolTable::lookup(module_name, (int)strlen(module_name), CHECK);
 741     assert(module_sym != NULL, "Failed to obtain Symbol for module name");
 742     ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym);
 743 
 744     char* class_path = (patch_mod_args->at(i))->path_string();


1495                                                            loader_data,
1496                                                            protection_domain,
1497                                                            NULL, // host_klass
1498                                                            NULL, // cp_patches
1499                                                            THREAD);
1500   if (HAS_PENDING_EXCEPTION) {
1501     if (DumpSharedSpaces) {
1502       tty->print_cr("Preload Error: Failed to load %s", class_name);
1503     }
1504     return NULL;
1505   }
1506 
1507   if (!add_package(file_name, classpath_index, THREAD)) {
1508     return NULL;
1509   }
1510 
1511   return result;
1512 }
1513 
1514 #if INCLUDE_CDS
1515 static char* skip_uri_protocol(char* source) {
1516   if (strncmp(source, "file:", 5) == 0) {
1517     // file: protocol path could start with file:/ or file:///
1518     // locate the char after all the forward slashes
1519     int offset = 5;
1520     while (*(source + offset) == '/') {
1521         offset++;
1522     }
1523     source += offset;
1524   // for non-windows platforms, move back one char as the path begins with a '/'
1525 #ifndef _WINDOWS
1526     source -= 1;
1527 #endif
1528   } else if (strncmp(source, "jrt:/", 5) == 0) {
1529     source += 5;
1530   }
1531   return source;
1532 }
1533 
1534 // Record the shared classpath index and loader type for classes loaded
1535 // by the builtin loaders at dump time.
1536 void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream) {
1537   assert(DumpSharedSpaces, "sanity");
1538   assert(stream != NULL, "sanity");
1539 
1540   if (ik->is_anonymous()) {
1541     // We do not archive anonymous classes.
1542     return;
1543   }
1544 

1545   char* src = (char*)stream->source();
1546   if (src == NULL) {
1547     if (ik->class_loader() == NULL) {
1548       // JFR classes
1549       ik->set_shared_classpath_index(0);
1550       ik->set_class_loader_type(ClassLoader::BOOT_LOADER);
1551     }
1552     return;
1553   }
1554 
1555   assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build");
1556 
1557   ModuleEntry* module = ik->module();
1558   int classpath_index = -1;
1559   ResourceMark rm;


1560   char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN);
1561 
1562   // save the path from the file: protocol or the module name from the jrt: protocol
1563   // if no protocol prefix is found, path is the same as stream->source()
1564   char* path = skip_uri_protocol(src);
1565   for (int i = 0; i < FileMapInfo::get_number_of_share_classpaths(); i++) {
1566     SharedClassPathEntry* ent = FileMapInfo::shared_classpath(i);
1567     if (get_canonical_path(ent->name(), canonical_path, JVM_MAXPATHLEN)) {
1568       // If the path (from the class stream srouce) is the same as the shared
1569       // class path, then we have a match. For classes from module image loaded by the
1570       // PlatformClassLoader, the stream->source() is not the name of the module image.
1571       // Need to look for 'jrt:' explicitly.
1572       if (strcmp(canonical_path, os::native_path((char*)path)) == 0 ||
1573           (i == 0 && string_starts_with(src, "jrt:"))) {














1574         classpath_index = i;
1575         break;
1576       }
1577     }








1578   }
1579   if (classpath_index < 0) {
1580     // Shared classpath entry table only contains boot class path and -cp path.










1581     // No path entry found for this class. Must be a shared class loaded by the
1582     // user defined classloader.

1583     assert(ik->shared_classpath_index() < 0, "Sanity");
1584     return;
1585   }








1586 
1587   const char* const class_name = ik->name()->as_C_string();
1588   const char* const file_name = file_name_for_class_name(class_name,
1589                                                          ik->name()->utf8_length());
1590   assert(file_name != NULL, "invariant");
1591   Thread* THREAD = Thread::current();
1592   ClassLoaderExt::Context context(class_name, file_name, CATCH);
1593   context.record_result(ik->name(), classpath_index, ik, THREAD);
1594 }
1595 #endif // INCLUDE_CDS
1596 
1597 // Initialize the class loader's access to methods in libzip.  Parse and
1598 // process the boot classpath into a list ClassPathEntry objects.  Once
1599 // this list has been created, it must not change order (see class PackageInfo)
1600 // it can be appended to and is by jvmti and the kernel vm.
1601 
1602 void ClassLoader::initialize() {
1603   EXCEPTION_MARK;
1604 
1605   if (UsePerfData) {
1606     // jvmstat performance counters
1607     NEWPERFTICKCOUNTER(_perf_accumulated_time, SUN_CLS, "time");
1608     NEWPERFTICKCOUNTER(_perf_class_init_time, SUN_CLS, "classInitTime");
1609     NEWPERFTICKCOUNTER(_perf_class_init_selftime, SUN_CLS, "classInitTime.self");
1610     NEWPERFTICKCOUNTER(_perf_class_verify_time, SUN_CLS, "classVerifyTime");
1611     NEWPERFTICKCOUNTER(_perf_class_verify_selftime, SUN_CLS, "classVerifyTime.self");


1654   }
1655 
1656   // lookup zip library entry points
1657   load_zip_library();
1658   // lookup jimage library entry points
1659   load_jimage_library();
1660 #if INCLUDE_CDS
1661   // initialize search path
1662   if (DumpSharedSpaces) {
1663     _shared_paths_misc_info = SharedClassUtil::allocate_shared_paths_misc_info();
1664   }
1665 #endif
1666   setup_bootstrap_search_path();
1667 }
1668 
1669 #if INCLUDE_CDS
1670 void ClassLoader::initialize_shared_path() {
1671   if (DumpSharedSpaces) {
1672     ClassLoaderExt::setup_search_paths();
1673     _shared_paths_misc_info->write_jint(0); // see comments in SharedPathsMiscInfo::check()







1674   }
1675 }
1676 #endif
1677 
1678 jlong ClassLoader::classloader_time_ms() {
1679   return UsePerfData ?
1680     Management::ticks_to_ms(_perf_accumulated_time->get_value()) : -1;
1681 }
1682 
1683 jlong ClassLoader::class_init_count() {
1684   return UsePerfData ? _perf_classes_inited->get_value() : -1;
1685 }
1686 
1687 jlong ClassLoader::class_init_time_ms() {
1688   return UsePerfData ?
1689     Management::ticks_to_ms(_perf_class_init_time->get_value()) : -1;
1690 }
1691 
1692 jlong ClassLoader::class_verify_time_ms() {
1693   return UsePerfData ?




 131 PerfCounter*    ClassLoader::_perf_define_appclass_time = NULL;
 132 PerfCounter*    ClassLoader::_perf_define_appclass_selftime = NULL;
 133 PerfCounter*    ClassLoader::_perf_app_classfile_bytes_read = NULL;
 134 PerfCounter*    ClassLoader::_perf_sys_classfile_bytes_read = NULL;
 135 PerfCounter*    ClassLoader::_sync_systemLoaderLockContentionRate = NULL;
 136 PerfCounter*    ClassLoader::_sync_nonSystemLoaderLockContentionRate = NULL;
 137 PerfCounter*    ClassLoader::_sync_JVMFindLoadedClassLockFreeCounter = NULL;
 138 PerfCounter*    ClassLoader::_sync_JVMDefineClassLockFreeCounter = NULL;
 139 PerfCounter*    ClassLoader::_sync_JNIDefineClassLockFreeCounter = NULL;
 140 PerfCounter*    ClassLoader::_unsafe_defineClassCallCounter = NULL;
 141 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
 142 
 143 GrowableArray<ModuleClassPathList*>* ClassLoader::_patch_mod_entries = NULL;
 144 GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
 145 ClassPathEntry* ClassLoader::_jrt_entry = NULL;
 146 ClassPathEntry* ClassLoader::_first_append_entry = NULL;
 147 ClassPathEntry* ClassLoader::_last_append_entry  = NULL;
 148 #if INCLUDE_CDS
 149 ClassPathEntry* ClassLoader::_app_classpath_entries = NULL;
 150 ClassPathEntry* ClassLoader::_last_app_classpath_entry = NULL;
 151 ClassPathEntry* ClassLoader::_module_path_entries = NULL;
 152 ClassPathEntry* ClassLoader::_last_module_path_entry = NULL;
 153 SharedPathsMiscInfo* ClassLoader::_shared_paths_misc_info = NULL;
 154 #endif
 155 
 156 // helper routines
 157 bool string_starts_with(const char* str, const char* str_to_find) {
 158   size_t str_len = strlen(str);
 159   size_t str_to_find_len = strlen(str_to_find);
 160   if (str_to_find_len > str_len) {
 161     return false;
 162   }
 163   return (strncmp(str, str_to_find, str_to_find_len) == 0);
 164 }
 165 
 166 static const char* get_jimage_version_string() {
 167   static char version_string[10] = "";
 168   if (version_string[0] == '\0') {
 169     jio_snprintf(version_string, sizeof(version_string), "%d.%d",
 170                  Abstract_VM_Version::vm_major_version(), Abstract_VM_Version::vm_minor_version());
 171   }
 172   return (const char*)version_string;


 706   for (int start = 0; start < len; start = end) {
 707     while (class_path[end] && class_path[end] != os::path_separator()[0]) {
 708       end++;
 709     }
 710     EXCEPTION_MARK;
 711     ResourceMark rm(THREAD);
 712     char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
 713     strncpy(path, &class_path[start], end - start);
 714     path[end - start] = '\0';
 715 
 716     check_shared_classpath(path);
 717 
 718     update_class_path_entry_list(path, false, false);
 719 
 720     while (class_path[end] == os::path_separator()[0]) {
 721       end++;
 722     }
 723   }
 724 }
 725 
 726 void ClassLoader::add_to_module_path_entries(const char* path,
 727                                              ClassPathEntry* entry) {
 728   assert(entry != NULL, "ClassPathEntry should not be NULL");
 729   assert(DumpSharedSpaces, "dump time only");
 730 
 731   // The entry does not exist, add to the list
 732   if (_module_path_entries == NULL) {
 733     assert(_last_module_path_entry == NULL, "Sanity");
 734     _module_path_entries = _last_module_path_entry = entry;
 735   } else {
 736     _last_module_path_entry->set_next(entry);
 737     _last_module_path_entry = entry;
 738   }
 739 }
 740 
 741 // Add a module path to the _module_path_entries list.
 742 void ClassLoader::update_module_path_entry_list(const char *path, TRAPS) {
 743   assert(DumpSharedSpaces, "dump time only");
 744   struct stat st;
 745   int ret = os::stat(path, &st);
 746   assert(ret == 0, "module path must exist");
 747   // File or directory found
 748   ClassPathEntry* new_entry = NULL;
 749   new_entry = create_class_path_entry(path, &st, true /* throw_exception */,
 750                                       false /*is_boot_append */, CHECK);
 751   if (new_entry == NULL) {
 752     return;
 753   }
 754 
 755   add_to_module_path_entries(path, new_entry);
 756   return;
 757 }
 758 
 759 void ClassLoader::setup_module_search_path(const char* path, TRAPS) {
 760   check_shared_classpath(path);
 761   update_module_path_entry_list(path, THREAD);
 762 }
 763 #endif // INCLUDE_CDS
 764 
 765 // Construct the array of module/path pairs as specified to --patch-module
 766 // for the boot loader to search ahead of the jimage, if the class being
 767 // loaded is defined to a module that has been specified to --patch-module.
 768 void ClassLoader::setup_patch_mod_entries() {
 769   Thread* THREAD = Thread::current();
 770   GrowableArray<ModulePatchPath*>* patch_mod_args = Arguments::get_patch_mod_prefix();
 771   int num_of_entries = patch_mod_args->length();
 772 
 773 
 774   // Set up the boot loader's _patch_mod_entries list
 775   _patch_mod_entries = new (ResourceObj::C_HEAP, mtModule) GrowableArray<ModuleClassPathList*>(num_of_entries, true);
 776 
 777   for (int i = 0; i < num_of_entries; i++) {
 778     const char* module_name = (patch_mod_args->at(i))->module_name();
 779     Symbol* const module_sym = SymbolTable::lookup(module_name, (int)strlen(module_name), CHECK);
 780     assert(module_sym != NULL, "Failed to obtain Symbol for module name");
 781     ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym);
 782 
 783     char* class_path = (patch_mod_args->at(i))->path_string();


1534                                                            loader_data,
1535                                                            protection_domain,
1536                                                            NULL, // host_klass
1537                                                            NULL, // cp_patches
1538                                                            THREAD);
1539   if (HAS_PENDING_EXCEPTION) {
1540     if (DumpSharedSpaces) {
1541       tty->print_cr("Preload Error: Failed to load %s", class_name);
1542     }
1543     return NULL;
1544   }
1545 
1546   if (!add_package(file_name, classpath_index, THREAD)) {
1547     return NULL;
1548   }
1549 
1550   return result;
1551 }
1552 
1553 #if INCLUDE_CDS
1554 char* ClassLoader::skip_uri_protocol(char* source) {
1555   if (strncmp(source, "file:", 5) == 0) {
1556     // file: protocol path could start with file:/ or file:///
1557     // locate the char after all the forward slashes
1558     int offset = 5;
1559     while (*(source + offset) == '/') {
1560         offset++;
1561     }
1562     source += offset;
1563   // for non-windows platforms, move back one char as the path begins with a '/'
1564 #ifndef _WINDOWS
1565     source -= 1;
1566 #endif
1567   } else if (strncmp(source, "jrt:/", 5) == 0) {
1568     source += 5;
1569   }
1570   return source;
1571 }
1572 
1573 // Record the shared classpath index and loader type for classes loaded
1574 // by the builtin loaders at dump time.
1575 void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) {
1576   assert(DumpSharedSpaces, "sanity");
1577   assert(stream != NULL, "sanity");
1578 
1579   if (ik->is_anonymous()) {
1580     // We do not archive anonymous classes.
1581     return;
1582   }
1583 
1584   oop loader = ik->class_loader();
1585   char* src = (char*)stream->source();
1586   if (src == NULL) {
1587     if (loader == NULL) {
1588       // JFR classes
1589       ik->set_shared_classpath_index(0);
1590       ik->set_class_loader_type(ClassLoader::BOOT_LOADER);
1591     }
1592     return;
1593   }
1594 
1595   assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build");
1596 
1597   ResourceMark rm(THREAD);
1598   int classpath_index = -1;
1599   PackageEntry* pkg_entry = ik->package();
1600 
1601   if (FileMapInfo::get_number_of_shared_paths() > 0) {
1602     char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN);
1603 
1604     // save the path from the file: protocol or the module name from the jrt: protocol
1605     // if no protocol prefix is found, path is the same as stream->source()
1606     char* path = skip_uri_protocol(src);
1607     for (int i = 0; i < FileMapInfo::get_number_of_shared_paths(); i++) {
1608       SharedClassPathEntry* ent = FileMapInfo::shared_path(i);
1609       if (get_canonical_path(ent->name(), canonical_path, JVM_MAXPATHLEN)) {
1610         // If the path (from the class stream source) is the same as the shared
1611         // class or module path, then we have a match.
1612         if (strcmp(canonical_path, os::native_path((char*)path)) == 0) {
1613           // NULL pkg_entry and pkg_entry in an unnamed module implies the class
1614           // is from the -cp or boot loader append path which consists of -Xbootclasspath/a
1615           // and jvmti appended entries.
1616           if ((pkg_entry == NULL) || (pkg_entry->in_unnamed_module())) {
1617             // Ensure the index is within the -cp range before assigning
1618             // to the classpath_index.
1619             if (SystemDictionary::is_system_class_loader(loader) &&
1620                 (i >= ClassLoaderExt::app_class_paths_start_index()) &&
1621                 (i < ClassLoaderExt::app_module_paths_start_index())) {
1622               classpath_index = i;
1623               break;
1624             } else {
1625               if ((i >= 1) &&
1626                   (i < ClassLoaderExt::app_class_paths_start_index())) {
1627                 // The class must be from boot loader append path which consists of
1628                 // -Xbootclasspath/a and jvmti appended entries.
1629                 assert(loader == NULL, "sanity");
1630                 classpath_index = i;
1631                 break;
1632               }
1633             }
1634           } else {
1635             // A class from a named module from the --module-path. Ensure the index is
1636             // within the --module-path range before assigning to the classpath_index.
1637             if ((pkg_entry != NULL) && !(pkg_entry->in_unnamed_module()) && (i > 0)) {
1638               if (i >= ClassLoaderExt::app_module_paths_start_index() &&
1639                   i < FileMapInfo::get_number_of_shared_paths()) {
1640                 classpath_index = i;
1641                 break;
1642               }
1643             }
1644           }
1645         }
1646         // for index 0 and the stream->source() is the modules image or has the jrt: protocol.
1647         // The class must be from the runtime modules image.
1648         if (i == 0 && (is_modules_image(src) || string_starts_with(src, "jrt:"))) {
1649           classpath_index = i;
1650           break;
1651         }
1652       }
1653     }
1654 
1655     // No path entry found for this class. Must be a shared class loaded by the
1656     // user defined classloader.
1657     if (classpath_index < 0) {
1658       assert(ik->shared_classpath_index() < 0, "Sanity");
1659       return;
1660     }
1661   } else {
1662     // The shared path table is set up after module system initialization.
1663     // The path table contains no entry before that. Any classes loaded prior
1664     // to the setup of the shared path table must be from the modules image.
1665     assert(is_modules_image(src), "stream must be from modules image");
1666     assert(FileMapInfo::get_number_of_shared_paths() == 0, "shared path table must not have been setup");
1667     classpath_index = 0;
1668   }
1669 
1670   const char* const class_name = ik->name()->as_C_string();
1671   const char* const file_name = file_name_for_class_name(class_name,
1672                                                          ik->name()->utf8_length());
1673   assert(file_name != NULL, "invariant");
1674 
1675   ClassLoaderExt::Context context(class_name, file_name, CATCH);
1676   context.record_result(ik->name(), classpath_index, ik, THREAD);
1677 }
1678 #endif // INCLUDE_CDS
1679 
1680 // Initialize the class loader's access to methods in libzip.  Parse and
1681 // process the boot classpath into a list ClassPathEntry objects.  Once
1682 // this list has been created, it must not change order (see class PackageInfo)
1683 // it can be appended to and is by jvmti and the kernel vm.
1684 
1685 void ClassLoader::initialize() {
1686   EXCEPTION_MARK;
1687 
1688   if (UsePerfData) {
1689     // jvmstat performance counters
1690     NEWPERFTICKCOUNTER(_perf_accumulated_time, SUN_CLS, "time");
1691     NEWPERFTICKCOUNTER(_perf_class_init_time, SUN_CLS, "classInitTime");
1692     NEWPERFTICKCOUNTER(_perf_class_init_selftime, SUN_CLS, "classInitTime.self");
1693     NEWPERFTICKCOUNTER(_perf_class_verify_time, SUN_CLS, "classVerifyTime");
1694     NEWPERFTICKCOUNTER(_perf_class_verify_selftime, SUN_CLS, "classVerifyTime.self");


1737   }
1738 
1739   // lookup zip library entry points
1740   load_zip_library();
1741   // lookup jimage library entry points
1742   load_jimage_library();
1743 #if INCLUDE_CDS
1744   // initialize search path
1745   if (DumpSharedSpaces) {
1746     _shared_paths_misc_info = SharedClassUtil::allocate_shared_paths_misc_info();
1747   }
1748 #endif
1749   setup_bootstrap_search_path();
1750 }
1751 
1752 #if INCLUDE_CDS
1753 void ClassLoader::initialize_shared_path() {
1754   if (DumpSharedSpaces) {
1755     ClassLoaderExt::setup_search_paths();
1756     _shared_paths_misc_info->write_jint(0); // see comments in SharedPathsMiscInfo::check()
1757   }
1758 }
1759 
1760 void ClassLoader::initialize_module_path(TRAPS) {
1761   if (DumpSharedSpaces) {
1762     ClassLoaderExt::setup_module_paths(THREAD);
1763     FileMapInfo::allocate_shared_path_table();
1764   }
1765 }
1766 #endif
1767 
1768 jlong ClassLoader::classloader_time_ms() {
1769   return UsePerfData ?
1770     Management::ticks_to_ms(_perf_accumulated_time->get_value()) : -1;
1771 }
1772 
1773 jlong ClassLoader::class_init_count() {
1774   return UsePerfData ? _perf_classes_inited->get_value() : -1;
1775 }
1776 
1777 jlong ClassLoader::class_init_time_ms() {
1778   return UsePerfData ?
1779     Management::ticks_to_ms(_perf_class_init_time->get_value()) : -1;
1780 }
1781 
1782 jlong ClassLoader::class_verify_time_ms() {
1783   return UsePerfData ?


src/hotspot/share/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File