--- old/src/hotspot/share/classfile/classLoader.cpp 2018-04-09 15:29:52.635523912 -0700 +++ new/src/hotspot/share/classfile/classLoader.cpp 2018-04-09 15:29:52.357497690 -0700 @@ -739,16 +739,14 @@ } // Add a module path to the _module_path_entries list. -void ClassLoader::update_module_path_entry_list(const char *path, - bool throw_exception) { +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; - Thread* THREAD = Thread::current(); - new_entry = create_class_path_entry(path, &st, throw_exception, + new_entry = create_class_path_entry(path, &st, true /* throw_exception */, false /*is_boot_append */, CHECK); if (new_entry == NULL) { return; @@ -758,9 +756,9 @@ return; } -void ClassLoader::setup_module_search_path(const char* path) { +void ClassLoader::setup_module_search_path(const char* path, TRAPS) { check_shared_classpath(path); - update_module_path_entry_list(path); + update_module_path_entry_list(path, THREAD); } #endif // INCLUDE_CDS @@ -1574,7 +1572,7 @@ // 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) { +void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) { assert(DumpSharedSpaces, "sanity"); assert(stream != NULL, "sanity"); @@ -1596,8 +1594,7 @@ assert(has_jrt_entry(), "CDS dumping does not support exploded JDK build"); - ResourceMark rm; - Thread* THREAD = Thread::current(); + ResourceMark rm(THREAD); int classpath_index = -1; PackageEntry* pkg_entry = ik->package(); @@ -1614,7 +1611,8 @@ // 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. + // 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. @@ -1626,7 +1624,8 @@ } else { if ((i >= 1) && (i < ClassLoaderExt::app_class_paths_start_index())) { - // The class must be from -Xbootclasspath/a + // 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; @@ -1758,9 +1757,9 @@ } } -void ClassLoader::initialize_module_path() { +void ClassLoader::initialize_module_path(TRAPS) { if (DumpSharedSpaces) { - ClassLoaderExt::setup_module_paths(); + ClassLoaderExt::setup_module_paths(THREAD); FileMapInfo::allocate_shared_path_table(); } }