--- old/src/hotspot/share/classfile/classLoaderExt.hpp 2018-04-02 14:11:37.439770998 -0700 +++ new/src/hotspot/share/classfile/classLoaderExt.hpp 2018-04-02 14:11:37.170745648 -0700 @@ -26,6 +26,7 @@ #define SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP #include "classfile/classLoader.hpp" +#include "classfile/moduleEntry.hpp" #include "utilities/macros.hpp" CDS_ONLY(class SharedPathsMiscInfoExt;) @@ -59,14 +60,14 @@ _file_name = file_name; #if INCLUDE_CDS if (!DumpSharedSpaces && !UseSharedSpaces) { - // Must not modify _app_paths_start_index if we're not using CDS. - assert(_app_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); + // Must not modify _app_class_paths_start_index if we're not using CDS. + assert(_app_class_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); } #endif } bool should_verify(int classpath_index) { - CDS_ONLY(return (classpath_index >= _app_paths_start_index);) + CDS_ONLY(return (classpath_index >= _app_class_paths_start_index);) NOT_CDS(return false;) } @@ -82,8 +83,8 @@ ~Context() { #if INCLUDE_CDS if (!DumpSharedSpaces && !UseSharedSpaces) { - // Must not modify app_paths_start_index if we're not using CDS. - assert(_app_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); + // Must not modify app_class_paths_start_index if we're not using CDS. + assert(_app_class_paths_start_index == ClassLoaderExt::max_classpath_index, "must be"); } #endif } @@ -93,10 +94,16 @@ #if INCLUDE_CDS static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size); static void setup_app_search_path(); // Only when -Xshare:dump + static void process_module_table(ModuleEntryTable* met); + static void setup_module_search_path(); static SharedPathsMiscInfoExt* shared_paths_misc_info() { return (SharedPathsMiscInfoExt*)_shared_paths_misc_info; } - static jshort _app_paths_start_index; // index of first app JAR in shared classpath entry table + // index of first app JAR in shared classpath entry table + static jshort _app_class_paths_start_index; + // index of first modular JAR in shared modulepath entry table + static jshort _app_module_paths_start_index; + static bool _has_app_classes; static bool _has_platform_classes; #endif @@ -116,6 +123,7 @@ } static void setup_search_paths() NOT_CDS_RETURN; + static void setup_module_paths() NOT_CDS_RETURN; #if INCLUDE_CDS private: @@ -137,14 +145,20 @@ static void finalize_shared_paths_misc_info(); - static jshort app_paths_start_index() { return _app_paths_start_index; } + static jshort app_class_paths_start_index() { return _app_class_paths_start_index; } + + static jshort app_module_paths_start_index() { return _app_module_paths_start_index; } static void init_paths_start_index(jshort app_start) { - _app_paths_start_index = app_start; + _app_class_paths_start_index = app_start; + } + + static void init_app_module_paths_start_index(jshort module_start) { + _app_module_paths_start_index = module_start; } static bool is_boot_classpath(int classpath_index) { - return classpath_index < _app_paths_start_index; + return classpath_index < _app_class_paths_start_index; } static bool has_platform_or_app_classes() {