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

src/hotspot/share/classfile/classLoader.cpp

Print this page

        

*** 737,768 **** _last_module_path_entry = entry; } } // Add a module path to the _module_path_entries list. ! void ClassLoader::update_module_path_entry_list(const char *path, ! bool throw_exception) { assert(DumpSharedSpaces, "dump time only"); struct stat st; int ret = os::stat(path, &st); assert(ret == 0, "module path must exist"); // File or directory found ClassPathEntry* new_entry = NULL; ! Thread* THREAD = Thread::current(); ! new_entry = create_class_path_entry(path, &st, throw_exception, false /*is_boot_append */, CHECK); if (new_entry == NULL) { return; } add_to_module_path_entries(path, new_entry); return; } ! void ClassLoader::setup_module_search_path(const char* path) { check_shared_classpath(path); ! update_module_path_entry_list(path); } #endif // INCLUDE_CDS // Construct the array of module/path pairs as specified to --patch-module // for the boot loader to search ahead of the jimage, if the class being --- 737,766 ---- _last_module_path_entry = entry; } } // Add a module path to the _module_path_entries list. ! void ClassLoader::update_module_path_entry_list(const char *path, TRAPS) { assert(DumpSharedSpaces, "dump time only"); struct stat st; int ret = os::stat(path, &st); assert(ret == 0, "module path must exist"); // File or directory found ClassPathEntry* new_entry = NULL; ! new_entry = create_class_path_entry(path, &st, true /* throw_exception */, false /*is_boot_append */, CHECK); if (new_entry == NULL) { return; } add_to_module_path_entries(path, new_entry); return; } ! void ClassLoader::setup_module_search_path(const char* path, TRAPS) { check_shared_classpath(path); ! update_module_path_entry_list(path, THREAD); } #endif // INCLUDE_CDS // Construct the array of module/path pairs as specified to --patch-module // for the boot loader to search ahead of the jimage, if the class being
*** 1572,1582 **** return source; } // Record the shared classpath index and loader type for classes loaded // by the builtin loaders at dump time. ! void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream) { assert(DumpSharedSpaces, "sanity"); assert(stream != NULL, "sanity"); if (ik->is_anonymous()) { // We do not archive anonymous classes. --- 1570,1580 ---- return source; } // Record the shared classpath index and loader type for classes loaded // by the builtin loaders at dump time. ! void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) { assert(DumpSharedSpaces, "sanity"); assert(stream != NULL, "sanity"); if (ik->is_anonymous()) { // We do not archive anonymous classes.
*** 1594,1605 **** return; } assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build"); ! ResourceMark rm; ! Thread* THREAD = Thread::current(); int classpath_index = -1; PackageEntry* pkg_entry = ik->package(); if (FileMapInfo::get_number_of_shared_paths() > 0) { char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN); --- 1592,1602 ---- return; } assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build"); ! ResourceMark rm(THREAD); int classpath_index = -1; PackageEntry* pkg_entry = ik->package(); if (FileMapInfo::get_number_of_shared_paths() > 0) { char* canonical_path = NEW_RESOURCE_ARRAY(char, JVM_MAXPATHLEN);
*** 1612,1622 **** if (get_canonical_path(ent->name(), canonical_path, JVM_MAXPATHLEN)) { // If the path (from the class stream source) is the same as the shared // class or module path, then we have a match. if (strcmp(canonical_path, os::native_path((char*)path)) == 0) { // NULL pkg_entry and pkg_entry in an unnamed module implies the class ! // is from the -cp or -Xbootclasspath/a. if ((pkg_entry == NULL) || (pkg_entry->in_unnamed_module())) { // Ensure the index is within the -cp range before assigning // to the classpath_index. if (SystemDictionary::is_system_class_loader(loader) && (i >= ClassLoaderExt::app_class_paths_start_index()) && --- 1609,1620 ---- if (get_canonical_path(ent->name(), canonical_path, JVM_MAXPATHLEN)) { // If the path (from the class stream source) is the same as the shared // class or module path, then we have a match. if (strcmp(canonical_path, os::native_path((char*)path)) == 0) { // NULL pkg_entry and pkg_entry in an unnamed module implies the class ! // is from the -cp or boot loader append path which consists of -Xbootclasspath/a ! // and jvmti appended entries. if ((pkg_entry == NULL) || (pkg_entry->in_unnamed_module())) { // Ensure the index is within the -cp range before assigning // to the classpath_index. if (SystemDictionary::is_system_class_loader(loader) && (i >= ClassLoaderExt::app_class_paths_start_index()) &&
*** 1624,1634 **** classpath_index = i; break; } else { if ((i >= 1) && (i < ClassLoaderExt::app_class_paths_start_index())) { ! // The class must be from -Xbootclasspath/a assert(loader == NULL, "sanity"); classpath_index = i; break; } } --- 1622,1633 ---- classpath_index = i; break; } else { if ((i >= 1) && (i < ClassLoaderExt::app_class_paths_start_index())) { ! // The class must be from boot loader append path which consists of ! // -Xbootclasspath/a and jvmti appended entries. assert(loader == NULL, "sanity"); classpath_index = i; break; } }
*** 1756,1768 **** ClassLoaderExt::setup_search_paths(); _shared_paths_misc_info->write_jint(0); // see comments in SharedPathsMiscInfo::check() } } ! void ClassLoader::initialize_module_path() { if (DumpSharedSpaces) { ! ClassLoaderExt::setup_module_paths(); FileMapInfo::allocate_shared_path_table(); } } #endif --- 1755,1767 ---- ClassLoaderExt::setup_search_paths(); _shared_paths_misc_info->write_jint(0); // see comments in SharedPathsMiscInfo::check() } } ! void ClassLoader::initialize_module_path(TRAPS) { if (DumpSharedSpaces) { ! ClassLoaderExt::setup_module_paths(THREAD); FileMapInfo::allocate_shared_path_table(); } } #endif
src/hotspot/share/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File