--- old/make/GenerateLinkOptData.gmk 2018-04-24 20:03:35.478766499 -0400 +++ new/make/GenerateLinkOptData.gmk 2018-04-24 20:03:34.194692568 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -61,11 +61,13 @@ $(call MakeDir, $(LINK_OPT_DIR)) $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@)) $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE))) - $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \ + $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.tmp \ -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ build.tools.classlist.HelloClasslist \ $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE) + $(GREP) -v HelloClasslist $@.tmp > $@ + $(RM) -r $@.tmp # The jli trace is created by the same recipe as classlist. By declaring these # dependencies, make will correctly rebuild both jli trace and classlist --- old/src/hotspot/share/classfile/classListParser.cpp 2018-04-24 20:03:39.703009711 -0400 +++ new/src/hotspot/share/classfile/classListParser.cpp 2018-04-24 20:03:38.342931404 -0400 @@ -283,7 +283,6 @@ error("AppCDS custom class loaders not supported on this platform"); #endif - assert(UseAppCDS, "must be"); if (!is_super_specified()) { error("If source location is specified, super class must be also specified"); } @@ -383,9 +382,7 @@ } else { // If "source:" tag is specified, all super class and super interfaces must be specified in the // class list file. - if (UseAppCDS) { - klass = load_class_from_source(class_name_symbol, CHECK_NULL); - } + klass = load_class_from_source(class_name_symbol, CHECK_NULL); } if (klass != NULL && klass->is_instance_klass() && is_id_specified()) { --- old/src/hotspot/share/classfile/classLoader.cpp 2018-04-24 20:03:43.443225056 -0400 +++ new/src/hotspot/share/classfile/classLoader.cpp 2018-04-24 20:03:42.143150203 -0400 @@ -270,14 +270,6 @@ // check if file exists struct stat st; if (os::stat(path, &st) == 0) { -#if INCLUDE_CDS - if (DumpSharedSpaces) { - // We have already check in ClassLoader::check_shared_classpath() that the directory is empty, so - // we should never find a file underneath it -- unless user has added a new file while we are running - // the dump, in which case let's quit! - ShouldNotReachHere(); - } -#endif // found file, open it int file_handle = os::open(path, 0, 0); if (file_handle != -1) { @@ -713,8 +705,6 @@ strncpy(path, &class_path[start], end - start); path[end - start] = '\0'; - check_shared_classpath(path); - update_class_path_entry_list(path, false, false); while (class_path[end] == os::path_separator()[0]) { @@ -757,7 +747,6 @@ } void ClassLoader::setup_module_search_path(const char* path, TRAPS) { - check_shared_classpath(path); update_module_path_entry_list(path, THREAD); } #endif // INCLUDE_CDS @@ -886,11 +875,6 @@ update_class_path_entry_list(path, false, true); } -#if INCLUDE_CDS - if (DumpSharedSpaces) { - check_shared_classpath(path); - } -#endif while (class_path[end] == os::path_separator()[0]) { end++; } @@ -1082,11 +1066,6 @@ if (entry->is_jar_file()) { ClassLoaderExt::process_jar_manifest(entry, check_for_duplicates); - } else { - if (!os::dir_is_empty(path)) { - tty->print_cr("Error: non-empty directory '%s'", path); - exit_with_path_failure("Cannot have non-empty directory in app classpaths", NULL); - } } #endif } --- old/src/hotspot/share/classfile/classLoaderExt.cpp 2018-04-24 20:03:47.439455140 -0400 +++ new/src/hotspot/share/classfile/classLoaderExt.cpp 2018-04-24 20:03:46.123379367 -0400 @@ -54,8 +54,17 @@ bool ClassLoaderExt::_has_app_classes = false; bool ClassLoaderExt::_has_platform_classes = false; +void ClassLoaderExt::append_boot_classpath(ClassPathEntry* new_entry) { +#if INCLUDE_CDS + warning("Sharing is only supported for boot loader classes because bootstrap classpath has been appended"); + FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header(); + header->set_has_platform_or_app_classes(false); +#endif + ClassLoader::add_to_boot_append_entries(new_entry); +} + void ClassLoaderExt::setup_app_search_path() { - assert(DumpSharedSpaces, "this function is only used with -Xshare:dump and -XX:+UseAppCDS"); + assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); _app_class_paths_start_index = ClassLoader::num_boot_classpath_entries(); char* app_class_path = os::strdup(Arguments::get_appclasspath()); @@ -85,8 +94,8 @@ } } } -void ClassLoaderExt::setup_module_search_path(TRAPS) { - assert(DumpSharedSpaces, "this function is only used with -Xshare:dump and -XX:+UseAppCDS"); +void ClassLoaderExt::setup_module_paths(TRAPS) { + assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); _app_module_paths_start_index = ClassLoader::num_boot_classpath_entries() + ClassLoader::num_app_classpath_entries(); Handle system_class_loader (THREAD, SystemDictionary::java_system_loader()); @@ -215,16 +224,8 @@ } void ClassLoaderExt::setup_search_paths() { - if (UseAppCDS) { - shared_paths_misc_info()->record_app_offset(); - ClassLoaderExt::setup_app_search_path(); - } -} - -void ClassLoaderExt::setup_module_paths(TRAPS) { - if (UseAppCDS) { - ClassLoaderExt::setup_module_search_path(THREAD); - } + shared_paths_misc_info()->record_app_offset(); + ClassLoaderExt::setup_app_search_path(); } Thread* ClassLoaderExt::Context::_dump_thread = NULL; @@ -251,10 +252,8 @@ } void ClassLoaderExt::finalize_shared_paths_misc_info() { - if (UseAppCDS) { - if (!_has_app_classes) { - shared_paths_misc_info()->pop_app(); - } + if (!_has_app_classes) { + shared_paths_misc_info()->pop_app(); } } @@ -264,7 +263,7 @@ InstanceKlass* ClassLoaderExt::load_class(Symbol* name, const char* path, TRAPS) { assert(name != NULL, "invariant"); - assert(DumpSharedSpaces && UseAppCDS, "this function is only used with -Xshare:dump and -XX:+UseAppCDS"); + assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); ResourceMark rm(THREAD); const char* class_name = name->as_C_string(); @@ -322,7 +321,7 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path, TRAPS) { // This is called from dump time so it's single threaded and there's no need for a lock. - assert(DumpSharedSpaces && UseAppCDS, "this function is only used with -Xshare:dump and -XX:+UseAppCDS"); + assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); if (cached_path_entries == NULL) { cached_path_entries = new (ResourceObj::C_HEAP, mtClass) GrowableArray(20, /*c heap*/ true); } --- old/src/hotspot/share/classfile/classLoaderExt.hpp 2018-04-24 20:03:51.287676704 -0400 +++ new/src/hotspot/share/classfile/classLoaderExt.hpp 2018-04-24 20:03:50.011603233 -0400 @@ -95,7 +95,6 @@ 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, TRAPS); - static void setup_module_search_path(TRAPS); static SharedPathsMiscInfoExt* shared_paths_misc_info() { return (SharedPathsMiscInfoExt*)_shared_paths_misc_info; } @@ -112,15 +111,7 @@ CDS_ONLY(static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates);) // Called by JVMTI code to add boot classpath - static void append_boot_classpath(ClassPathEntry* new_entry) { -#if INCLUDE_CDS - if (UseAppCDS) { - warning("UseAppCDS is disabled because bootstrap classpath has been appended"); - UseAppCDS = false; - } -#endif - ClassLoader::add_to_boot_append_entries(new_entry); - } + static void append_boot_classpath(ClassPathEntry* new_entry); static void setup_search_paths() NOT_CDS_RETURN; static void setup_module_paths(TRAPS) NOT_CDS_RETURN; --- old/src/hotspot/share/classfile/sharedClassUtil.cpp 2018-04-24 20:03:55.003890667 -0400 +++ new/src/hotspot/share/classfile/sharedClassUtil.cpp 2018-04-24 20:03:53.719816736 -0400 @@ -173,11 +173,9 @@ int size = FileMapInfo::get_number_of_shared_paths(); if (size > 0) { SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD); - if (!DumpSharedSpaces) { - FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header(); - ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index); - ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index); - } + FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header(); + ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index); + ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index); } } @@ -229,19 +227,20 @@ } bool FileMapHeaderExt::validate() { - if (UseAppCDS) { - const char* prop = Arguments::get_property("java.system.class.loader"); - if (prop != NULL) { - warning("UseAppCDS is disabled because the java.system.class.loader property is specified (value = \"%s\"). " - "To enable UseAppCDS, this property must be not be set", prop); - UseAppCDS = false; - } - } - if (!FileMapInfo::FileMapHeader::validate()) { return false; } + // This must be done after header validation because it might change the + // header data + const char* prop = Arguments::get_property("java.system.class.loader"); + if (prop != NULL) { + warning("Archived non-system classes are disabled because the " + "java.system.class.loader property is specified (value = \"%s\"). " + "To use archived non-system classes, this property must be not be set", prop); + _has_platform_or_app_classes = false; + } + // For backwards compatibility, we don't check the verification setting // if the archive only contains system classes. if (_has_platform_or_app_classes && --- old/src/hotspot/share/classfile/sharedClassUtil.hpp 2018-04-24 20:03:58.744106012 -0400 +++ new/src/hotspot/share/classfile/sharedClassUtil.hpp 2018-04-24 20:03:57.448031390 -0400 @@ -43,6 +43,10 @@ FileMapHeaderExt() { _has_platform_or_app_classes = true; } + void set_has_platform_or_app_classes(bool v) { + _has_platform_or_app_classes = v; + } + bool has_platform_or_app_classes() { return _has_platform_or_app_classes; } virtual void populate(FileMapInfo* mapinfo, size_t alignment); virtual bool validate(); }; --- old/src/hotspot/share/classfile/sharedPathsMiscInfo.cpp 2018-04-24 20:04:02.464320206 -0400 +++ new/src/hotspot/share/classfile/sharedPathsMiscInfo.cpp 2018-04-24 20:04:01.168245583 -0400 @@ -141,7 +141,7 @@ switch (type) { case BOOT: // In the future we should perform the check based on the content of the mapped archive. - if (UseAppCDS && os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) { + if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) { return fail("[BOOT classpath mismatch, actual =", Arguments::get_sysclasspath()); } break; --- old/src/hotspot/share/classfile/systemDictionary.cpp 2018-04-24 20:04:06.236537393 -0400 +++ new/src/hotspot/share/classfile/systemDictionary.cpp 2018-04-24 20:04:04.956463692 -0400 @@ -3059,13 +3059,9 @@ // During run time, we only have one shared dictionary. void SystemDictionary::combine_shared_dictionaries() { assert(DumpSharedSpaces, "dump time only"); - // If AppCDS isn't enabled, we only dump the classes in the boot loader dictionary - // into the shared archive. - if (UseAppCDS) { - Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary(); - CombineDictionariesClosure cdc(master_dictionary); - ClassLoaderDataGraph::cld_do(&cdc); - } + Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary(); + CombineDictionariesClosure cdc(master_dictionary); + ClassLoaderDataGraph::cld_do(&cdc); // These tables are no longer valid or necessary. Keeping them around will // cause SystemDictionary::verify() to fail. Let's empty them. --- old/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-04-24 20:04:09.992753660 -0400 +++ new/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-04-24 20:04:08.700679268 -0400 @@ -360,9 +360,8 @@ bool SystemDictionaryShared::is_sharing_possible(ClassLoaderData* loader_data) { oop class_loader = loader_data->class_loader(); return (class_loader == NULL || - (UseAppCDS && (SystemDictionary::is_system_class_loader(class_loader) || - SystemDictionary::is_platform_class_loader(class_loader))) - ); + SystemDictionary::is_system_class_loader(class_loader) || + SystemDictionary::is_platform_class_loader(class_loader)); } // Currently AppCDS only archives classes from the run-time image, the @@ -508,57 +507,59 @@ // InstanceKlass* SystemDictionaryShared::find_or_load_shared_class( Symbol* name, Handle class_loader, TRAPS) { - if (DumpSharedSpaces) { - return NULL; - } - InstanceKlass* k = NULL; - if (shared_dictionary() != NULL && - UseAppCDS && (SystemDictionary::is_system_class_loader(class_loader()) || - SystemDictionary::is_platform_class_loader(class_loader()))) { - - // Fix for 4474172; see evaluation for more details - class_loader = Handle( - THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader())); - ClassLoaderData *loader_data = register_loader(class_loader); - Dictionary* dictionary = loader_data->dictionary(); - - unsigned int d_hash = dictionary->compute_hash(name); - - bool DoObjectLock = true; - if (is_parallelCapable(class_loader)) { - DoObjectLock = false; + if (UseSharedSpaces) { + FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header(); + if (!header->has_platform_or_app_classes()) { + return NULL; } - // Make sure we are synchronized on the class loader before we proceed - // - // Note: currently, find_or_load_shared_class is called only from - // JVM_FindLoadedClass and used for PlatformClassLoader and AppClassLoader, - // which are parallel-capable loaders, so this lock is NOT taken. - Handle lockObject = compute_loader_lock_object(class_loader, THREAD); - check_loader_lock_contention(lockObject, THREAD); - ObjectLocker ol(lockObject, THREAD, DoObjectLock); - - { - MutexLocker mu(SystemDictionary_lock, THREAD); - Klass* check = find_class(d_hash, name, dictionary); - if (check != NULL) { - return InstanceKlass::cast(check); + if (shared_dictionary() != NULL && + (SystemDictionary::is_system_class_loader(class_loader()) || + SystemDictionary::is_platform_class_loader(class_loader()))) { + // Fix for 4474172; see evaluation for more details + class_loader = Handle( + THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader())); + ClassLoaderData *loader_data = register_loader(class_loader); + Dictionary* dictionary = loader_data->dictionary(); + + unsigned int d_hash = dictionary->compute_hash(name); + + bool DoObjectLock = true; + if (is_parallelCapable(class_loader)) { + DoObjectLock = false; } - } - k = load_shared_class_for_builtin_loader(name, class_loader, THREAD); - if (k != NULL) { - define_instance_class(k, CHECK_NULL); + // Make sure we are synchronized on the class loader before we proceed + // + // Note: currently, find_or_load_shared_class is called only from + // JVM_FindLoadedClass and used for PlatformClassLoader and AppClassLoader, + // which are parallel-capable loaders, so this lock is NOT taken. + Handle lockObject = compute_loader_lock_object(class_loader, THREAD); + check_loader_lock_contention(lockObject, THREAD); + ObjectLocker ol(lockObject, THREAD, DoObjectLock); + + { + MutexLocker mu(SystemDictionary_lock, THREAD); + Klass* check = find_class(d_hash, name, dictionary); + if (check != NULL) { + return InstanceKlass::cast(check); + } + } + + k = load_shared_class_for_builtin_loader(name, class_loader, THREAD); + if (k != NULL) { + define_instance_class(k, CHECK_NULL); + } } } - return k; } InstanceKlass* SystemDictionaryShared::load_shared_class_for_builtin_loader( Symbol* class_name, Handle class_loader, TRAPS) { - assert(UseAppCDS && shared_dictionary() != NULL, "already checked"); + assert(UseSharedSpaces, "must be"); + assert(shared_dictionary() != NULL, "already checked"); Klass* k = shared_dictionary()->find_class_for_builtin_loader(class_name); if (k != NULL) { @@ -609,13 +610,13 @@ allocate_shared_jar_manifest_array(size, CHECK); } - +// This function is called for loading only UNREGISTERED classes InstanceKlass* SystemDictionaryShared::lookup_from_stream(const Symbol* class_name, Handle class_loader, Handle protection_domain, const ClassFileStream* cfs, TRAPS) { - if (!UseAppCDS || shared_dictionary() == NULL) { + if (shared_dictionary() == NULL) { return NULL; } if (class_name == NULL) { // don't do this for anonymous classes @@ -624,7 +625,6 @@ if (class_loader.is_null() || SystemDictionary::is_system_class_loader(class_loader()) || SystemDictionary::is_platform_class_loader(class_loader())) { - // This function is called for loading only UNREGISTERED classes. // Do nothing for the BUILTIN loaders. return NULL; } @@ -686,11 +686,12 @@ return shared_klass; } -bool SystemDictionaryShared::add_non_builtin_klass(Symbol* name, ClassLoaderData* loader_data, +bool SystemDictionaryShared::add_non_builtin_klass(Symbol* name, + ClassLoaderData* loader_data, InstanceKlass* k, TRAPS) { assert(DumpSharedSpaces, "only when dumping"); - assert(UseAppCDS && boot_loader_dictionary() != NULL, "must be"); + assert(boot_loader_dictionary() != NULL, "must be"); if (boot_loader_dictionary()->add_non_builtin_klass(name, loader_data, k)) { MutexLocker mu_r(Compile_lock, THREAD); // not really necessary, but add_to_hierarchy asserts this. --- old/src/hotspot/share/memory/filemap.cpp 2018-04-24 20:04:13.812973612 -0400 +++ new/src/hotspot/share/memory/filemap.cpp 2018-04-24 20:04:12.496897838 -0400 @@ -207,10 +207,6 @@ struct stat st; if (os::stat(name, &st) == 0) { if ((st.st_mode & S_IFMT) == S_IFDIR) { - if (!os::dir_is_empty(name)) { - ClassLoader::exit_with_path_failure( - "Cannot have non-empty directory in archived classpaths", name); - } _is_dir = true; } else { _is_dir = false; @@ -232,6 +228,8 @@ } bool SharedClassPathEntry::validate(bool is_class_path) { + assert(UseSharedSpaces, "runtime only"); + struct stat st; const char* name = this->name(); bool ok = true; @@ -335,22 +333,41 @@ assert(i == num_entries, "number of shared path entry mismatch"); } -// This function should only be called during run time with UseSharedSpaces enabled. +void FileMapInfo::check_nonempty_dir_in_shared_path_table() { + assert(DumpSharedSpaces, "dump time only"); + int end = _shared_path_table_size; + if (!ClassLoaderExt::has_platform_or_app_classes()) { + // only check the boot path if no app class is loaded + end = ClassLoaderExt::app_class_paths_start_index(); + } + for (int i = 0; i < end; i++) { + SharedClassPathEntry *e = shared_path(i); + if (e->is_dir()) { + const char* path = e->name(); + if (!os::dir_is_empty(path)) { + tty->print_cr("Error: non-empty directory '%s'", path); + ClassLoader::exit_with_path_failure("Cannot have non-empty directory in paths", NULL); + } + } + } +} + bool FileMapInfo::validate_shared_path_table() { - _validating_shared_path_table = true; + assert(UseSharedSpaces, "runtime only"); + _validating_shared_path_table = true; _shared_path_table = _header->_shared_path_table; _shared_path_entry_size = _header->_shared_path_entry_size; _shared_path_table_size = _header->_shared_path_table_size; - // Note: _app_module_paths_start_index may not have a valid value if the UseAppCDS flag - // wasn't enabled during dump time. Therefore, we need to use the smaller of - // _shared_path_table_size and _app_module_paths_start_index for the _app_module_paths_start_index. FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header(); - int module_paths_start_index = (header->_app_module_paths_start_index >= _shared_path_table_size) ? - _shared_path_table_size : header->_app_module_paths_start_index; + int module_paths_start_index = header->_app_module_paths_start_index; - int count = _shared_path_table_size; + // If the shared archive contain app or platform classes, validate all entries + // in the shared path table. Otherwise, only validate the boot path entries (with + // entry index < _app_class_paths_start_index). + int count = header->has_platform_or_app_classes() ? + _shared_path_table_size : header->_app_class_paths_start_index; for (int i=0; iclass_loader_data()->is_the_null_class_loader_data()) { - // AppCDS is not enabled. Let's omit non-boot classes. - return; - } - if (!(k->is_instance_klass() && InstanceKlass::cast(k)->is_in_error_state())) { if (k->is_instance_klass() && InstanceKlass::cast(k)->signers() != NULL) { // Mark any class with signers and don't add to the _global_klass_objects @@ -1327,6 +1322,8 @@ void VM_PopulateDumpSharedSpace::doit() { Thread* THREAD = VMThread::vm_thread(); + FileMapInfo::check_nonempty_dir_in_shared_path_table(); + NOT_PRODUCT(SystemDictionary::verify();) // The following guarantee is meant to ensure that no loader constraints // exist yet, since the constraints table is not shared. This becomes --- old/src/hotspot/share/runtime/arguments.cpp 2018-04-24 20:04:25.653655351 -0400 +++ new/src/hotspot/share/runtime/arguments.cpp 2018-04-24 20:04:24.353580496 -0400 @@ -545,6 +545,7 @@ { "SharedMiscDataSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() }, { "SharedMiscCodeSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() }, { "UseUTCFileTimestamp", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, + { "UseAppCDS", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, @@ -3889,14 +3890,6 @@ vm_exit(0); } #endif - - if (match_option(option, "-XX:+UseAppCDS")) { - Flag* flag = Flag::find_flag("SharedArchiveFile", 17, true, true); - if (flag->is_diagnostic()) { - flag->clear_diagnostic(); - } - continue; - } } return JNI_OK; } --- old/src/hotspot/share/runtime/globals.hpp 2018-04-24 20:04:29.453874150 -0400 +++ new/src/hotspot/share/runtime/globals.hpp 2018-04-24 20:04:28.149799068 -0400 @@ -2823,10 +2823,6 @@ "Address to allocate shared memory region for class data") \ range(0, SIZE_MAX) \ \ - product(bool, UseAppCDS, false, \ - "Enable Application Class Data Sharing when using shared spaces") \ - writeable(CommandLineOnly) \ - \ product(ccstr, SharedArchiveConfigFile, NULL, \ "Data to add to the CDS archive file") \ \ @@ -2932,7 +2928,7 @@ product(ccstr, SharedClassListFile, NULL, \ "Override the default CDS class list") \ \ - diagnostic(ccstr, SharedArchiveFile, NULL, \ + product(ccstr, SharedArchiveFile, NULL, \ "Override the default location of the CDS archive file") \ \ product(ccstr, ExtraSharedClassListFile, NULL, \ --- old/test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java 2018-04-24 20:04:33.558110457 -0400 +++ new/test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java 2018-04-24 20:04:31.926016486 -0400 @@ -53,9 +53,7 @@ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( heapsize, "-XX:+IgnoreUnrecognizedVMOptions", - "-XX:+UnlockCommercialFeatures", "-XX:+UseAppCDS", - "-XX:+UnlockDiagnosticVMOptions", "-cp", classpath, "-XX:ExtraSharedClassListFile=" + classlist, "-XX:SharedArchiveFile=" + archive, --- old/test/hotspot/jtreg/compiler/aot/fingerprint/SelfChangedCDS.java 2018-04-24 20:04:37.326327416 -0400 +++ new/test/hotspot/jtreg/compiler/aot/fingerprint/SelfChangedCDS.java 2018-04-24 20:04:35.990250488 -0400 @@ -43,9 +43,9 @@ * compiler.aot.fingerprint.Blah TEST-UNMODIFIED * @run main compiler.aot.fingerprint.CDSRunner -cp SelfChangedCDS.jar * -XX:+UseAOT -XX:+PrintAOT -XX:AOTLibrary=./libSelfChanged.so - * -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=SelfChangedCDS.jsa + * -XX:SharedArchiveFile=SelfChangedCDS.jsa * -XX:+IgnoreUnrecognizedVMOptions - * -Xshare:auto -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -showversion + * -Xshare:auto -XX:+UseAppCDS -showversion * -Xlog:cds -Xlog:gc+heap+coops * -Xlog:aot+class+fingerprint=trace -Xlog:aot+class+load=trace * compiler.aot.fingerprint.Blah TEST-UNMODIFIED @@ -59,9 +59,9 @@ * compiler.aot.fingerprint.Blah TEST-MODIFIED * @run main compiler.aot.fingerprint.CDSRunner -cp SelfChangedCDS.jar * -XX:+UseAOT -XX:+PrintAOT -XX:AOTLibrary=./libSelfChanged.so - * -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=SelfChangedCDS.jsa + * -XX:SharedArchiveFile=SelfChangedCDS.jsa * -XX:+IgnoreUnrecognizedVMOptions - * -Xshare:auto -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -showversion + * -Xshare:auto -XX:+UseAppCDS -showversion * -Xlog:cds -Xlog:gc+heap+coops * -Xlog:aot+class+fingerprint=trace -Xlog:aot+class+load=trace * compiler.aot.fingerprint.Blah TEST-MODIFIED @@ -78,9 +78,9 @@ * compiler.aot.fingerprint.Blah TEST-UNMODIFIED * @run main compiler.aot.fingerprint.CDSRunner -Xmx512m -cp SelfChangedCDS.jar * -XX:+UseAOT -XX:+PrintAOT -XX:AOTLibrary=./libSelfChanged.so - * -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=SelfChangedCDS.jsa + * -XX:SharedArchiveFile=SelfChangedCDS.jsa * -XX:+IgnoreUnrecognizedVMOptions - * -Xshare:auto -XX:+UnlockCommercialFeatures -XX:+UseAppCDS -showversion + * -Xshare:auto -XX:+UseAppCDS -showversion * -Xlog:cds -Xlog:gc+heap+coops * -Xlog:aot+class+fingerprint=trace -Xlog:aot+class+load=trace * compiler.aot.fingerprint.Blah TEST-UNMODIFIED --- old/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java 2018-04-24 20:04:41.078543452 -0400 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java 2018-04-24 20:04:39.754467217 -0400 @@ -42,7 +42,6 @@ if (args.length == 0) { // Start this process ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./DumpSharedDictionary.jsa", "-Xshare:dump"); @@ -52,7 +51,6 @@ String testjdkPath = System.getProperty("test.jdk"); pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./DumpSharedDictionary.jsa", "-Dtest.jdk=" + testjdkPath, "-Xshare:on", "DumpSharedDictionary", "test"); --- old/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java 2018-04-24 20:04:44.974767781 -0400 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java 2018-04-24 20:04:43.654691776 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test NonBootLoaderClasses - * @summary Test to ensure platform and app classes are not being archived + * @summary Test to ensure platform and app classes are archived when specified in classlist * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.misc @@ -46,20 +46,21 @@ CDSTestUtils.makeClassList(classes).getPath(); String archiveName = "NonBootLoaderClasses.jsa"; CDSOptions opts = (new CDSOptions()) - .addPrefix("-XX:ExtraSharedClassListFile=" + classList) + .addPrefix("-XX:ExtraSharedClassListFile=" + classList, "-cp", "\"\"") .setArchiveName(archiveName); CDSTestUtils.createArchiveAndCheck(opts); // Print the shared dictionary and inspect the output ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-cp", "\"\"", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName, "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary"); OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "print-shared-archive"); if (!CDSTestUtils.isUnableToMap(out)) { out.shouldContain("archive is valid") .shouldHaveExitValue(0) // Should report success in error code. - .shouldNotContain(PLATFORM_CLASS) - .shouldNotContain(APP_CLASS); + .shouldContain(PLATFORM_CLASS.replace('/', '.')) + .shouldContain(APP_CLASS.replace('/', '.')); } } } --- old/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java 2018-04-24 20:04:48.798987965 -0400 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java 2018-04-24 20:04:47.466911269 -0400 @@ -77,7 +77,6 @@ // (1) Launch the attachee process System.out.println("Starting LingeredApp"); List vmOpts = Arrays.asList( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + jsaName, "-Xshare:" + flag, "-showversion"); // so we can see "sharing" in the output --- old/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java 2018-04-24 20:04:52.767216440 -0400 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java 2018-04-24 20:04:51.367135829 -0400 @@ -42,14 +42,12 @@ public class SharedArchiveFile { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:dump"); OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); CDSTestUtils.checkDump(out); pb = ProcessTools.createJavaProcessBuilder(true, - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:on", "-version"); out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); --- old/test/hotspot/jtreg/runtime/appcds/DirClasspathTest.java 2018-04-24 20:04:56.471429714 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/DirClasspathTest.java 2018-04-24 20:04:55.155353940 -0400 @@ -24,7 +24,7 @@ /* * @test - * @summary AppCDS handling of directories in -cp + * @summary Handling of directories in -cp is based on the classlist * @requires vm.cds * @library /test/lib * @run main DirClasspathTest @@ -45,10 +45,14 @@ File emptydir = new File(dir, "emptydir"); emptydir.mkdir(); + ///////////////////////////////////////////////////////////////// + // The classlist only contains boot class in following test cases + ///////////////////////////////////////////////////////////////// + String bootClassList[] = {"java/lang/Object"}; + // Empty dir in -cp: should be OK OutputAnalyzer output; - String classList[] = {"java/lang/Object"}; - output = TestCommon.dump(emptydir.getPath(), classList, "-Xlog:class+path=info"); + output = TestCommon.dump(emptydir.getPath(), bootClassList, "-Xlog:class+path=info"); TestCommon.checkDump(output); // Long path to empty dir in -cp: should be OK @@ -65,19 +69,32 @@ longDir.mkdir(); File subDir = new File(longDir, "subdir"); subDir.mkdir(); - output = TestCommon.dump(subDir.getPath(), classList, "-Xlog:class+path=info"); + output = TestCommon.dump(subDir.getPath(), bootClassList, "-Xlog:class+path=info"); TestCommon.checkDump(output); - // Non-empty dir in -cp: should fail + // Non-empty dir in -cp: should be OK // is not empty because it has at least one subdirectory, i.e., - output = TestCommon.dump(dir.getPath(), classList, "-Xlog:class+path=info"); - output.shouldNotHaveExitValue(0); - output.shouldContain("CDS allows only empty directories in archived classpaths"); + output = TestCommon.dump(dir.getPath(), bootClassList, "-Xlog:class+path=info"); + TestCommon.checkDump(output); - // Long path to non-empty dir in -cp: should fail + // Long path to non-empty dir in -cp: should be OK // is not empty because it has at least one subdirectory, i.e., - output = TestCommon.dump(longDir.getPath(), classList, "-Xlog:class+path=info"); + output = TestCommon.dump(longDir.getPath(), bootClassList, "-Xlog:class+path=info"); + TestCommon.checkDump(output); + + ///////////////////////////////////////////////////////////////// + // The classlist contains non-boot class in following test cases + ///////////////////////////////////////////////////////////////// + String appClassList[] = {"java/lang/Object", "com/sun/tools/javac/Main"}; + + // Non-empty dir in -cp: should report error + output = TestCommon.dump(dir.getPath(), appClassList, "-Xlog:class+path=info"); + output.shouldNotHaveExitValue(0); + output.shouldContain("Cannot have non-empty directory in paths"); + + // Long path to non-empty dir in -cp: should report error + output = TestCommon.dump(longDir.getPath(), appClassList, "-Xlog:class+path=info"); output.shouldNotHaveExitValue(0); - output.shouldContain("CDS allows only empty directories in archived classpaths"); + output.shouldContain("Cannot have non-empty directory in paths"); } } --- old/test/hotspot/jtreg/runtime/appcds/DumpClassList.java 2018-04-24 20:05:00.191643910 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/DumpClassList.java 2018-04-24 20:04:58.879568366 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,6 @@ output = TestCommon.createArchive(appJar, appClass, "-Xbootclasspath/a:" + appendJar, - "-XX:+UnlockDiagnosticVMOptions", "-Xlog:class+load", "-XX:SharedClassListFile=" + classList); TestCommon.checkDump(output) --- old/test/hotspot/jtreg/runtime/appcds/MismatchedUseAppCDS.java 2018-04-24 20:05:03.931859258 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/MismatchedUseAppCDS.java 2018-04-24 20:05:02.611783253 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ "-XX:-UseAppCDS", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "CheckIfShared", "false"); + "CheckIfShared", "true"); TestCommon.checkExec(output); // (2): dump with -XX:-UseAppCDS, but run with -XX:+UseAppCDS @@ -74,7 +74,7 @@ "-XX:+UseAppCDS", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "CheckIfShared", "false"); + "CheckIfShared", "true"); TestCommon.checkExec(output); } } --- old/test/hotspot/jtreg/runtime/appcds/SharedArchiveFile.java 2018-04-24 20:05:07.640072763 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/SharedArchiveFile.java 2018-04-24 20:05:06.327997218 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ */ /* * @test - * @summary The diagnostic option, -XX:SharedArchiveFile can be unlocked using -XX:+UseAppCDS + * @summary Dumping -XX:SharedArchiveFile should succeed without extra flag to unlock * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.misc @@ -44,28 +44,21 @@ boolean isProduct = !Platform.isDebugBuild(); String appJar = JarBuilder.getOrCreateHelloJar(); - // 1) Using -XX:SharedArchiveFile without -XX:+UseAppCDS should fail - // on product binary without -XX:+UnlockDiagnosticVMOptions. - if (isProduct) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, - "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:dump"); - OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "dump"); - out.shouldContain("Error: VM option 'SharedArchiveFile' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions."); - } - - // 2) Dumping with -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile - // should always succeed. - CDSTestUtils.createArchive("-XX:+UnlockDiagnosticVMOptions") - .shouldContain("Dumping"); + // 1) Dumping -XX:SharedArchiveFile without -XX:+UseAppCDS should + // succeed with all binary. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + "-cp", appJar, "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:dump"); + OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "dump"); + out.shouldContain("Dumping"); - // 3) Using -XX:SharedArchiveFile with -XX:+UseAppCDS should work + // 2) Using -XX:SharedArchiveFile with -XX:+UseAppCDS should work // on product binary by default. OutputAnalyzer output3 = TestCommon.dump(appJar, TestCommon.list("Hello")); output3.shouldContain("Dumping"); output3 = TestCommon.exec(appJar, "Hello"); TestCommon.checkExec(output3, "Hello World"); - // 4) Using -XX:+UseAppCDS should not affect other diagnostic flags, + // 3) Using -XX:+UseAppCDS should not affect other diagnostic flags, // such as LogEvents OutputAnalyzer output4 = TestCommon.exec(appJar, "-XX:+LogEvents", "Hello"); if (isProduct) { @@ -74,7 +67,7 @@ TestCommon.checkExec(output4, "Hello World"); } - // 5) 8066921 - Extra -XX:+UseAppCDS + // 4) 8066921 - Extra -XX:+UseAppCDS TestCommon.testDump(appJar, TestCommon.list("Hello"), "-XX:+UseAppCDS"); OutputAnalyzer output5 = TestCommon.exec(appJar, "-XX:+UseAppCDS", "Hello"); TestCommon.checkExec(output5); --- old/test/hotspot/jtreg/runtime/appcds/SpecifySysLoaderProp.java 2018-04-24 20:05:11.632302621 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/SpecifySysLoaderProp.java 2018-04-24 20:05:10.328227537 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /* * @test - * @summary If -Djava.system.class.loader=xxx is specified in command-line, disable UseAppCDS + * @summary If -Djava.system.class.loader=xxx is specified in command-line, disable archived non-system classes * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.misc @@ -46,7 +46,7 @@ String jarFileName = "sysloader.jar"; String appJar = TestCommon.getTestJar(jarFileName); TestCommon.testDump(appJar, TestCommon.list("ReportMyLoader")); - String warning = "VM warning: UseAppCDS is disabled because the java.system.class.loader property is specified"; + String warning = "VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified"; // (0) Baseline. Do not specify -Djava.system.class.loader @@ -70,7 +70,7 @@ }); // (2) Try to execute the archive with -Djava.system.class.loader=TestClassLoader, - // it should run, but AppCDS should be disabled + // it should run, but archived non-system classes should be disabled TestCommon.run( "-verbose:class", "-cp", appJar, --- old/test/hotspot/jtreg/runtime/appcds/TestCommon.java 2018-04-24 20:05:15.392519120 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/TestCommon.java 2018-04-24 20:05:14.060442424 -0400 @@ -110,17 +110,9 @@ } // If you use -XX:+UseAppCDS or -XX:-UseAppCDS in your JVM command-line, call this method - // to wrap the arguments. On commercial builds, -XX:+UnlockCommercialFeatures will be - // prepended to the command-line. See JDK-8193664. + // to wrap the arguments. public static String[] makeCommandLineForAppCDS(String... args) throws Exception { - if (BuildHelper.isCommercialBuild()) { - String[] newArgs = new String[args.length + 1]; - newArgs[0] = "-XX:+UnlockCommercialFeatures"; - System.arraycopy(args, 0, newArgs, 1, args.length); - return newArgs; - } else { - return args; - } + return args; } // Create AppCDS archive using appcds options --- old/test/hotspot/jtreg/runtime/appcds/UseAppCDS.java 2018-04-24 20:05:19.504755888 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/UseAppCDS.java 2018-04-24 20:05:17.836659845 -0400 @@ -74,36 +74,33 @@ pb = new ProcessBuilder(jar.getCommand()); TestCommon.executeAndLog(pb, "jar02").shouldHaveExitValue(0); - // In all tests the BOOTCLASS should be loaded/dumped/used + // In all tests the BOOTCLASS and TESTNAME should be loaded/dumped/used - // Test 1: No AppCDS - dumping loaded classes excludes the "test" classes - dumpLoadedClasses(false, new String[] { BOOTCLASS }, - new String[] { TESTNAME }); + // Test 1: -XX:-UseAppCDS - No effect, dumping loaded classes includes "test" classes + dumpLoadedClasses(false, new String[] { BOOTCLASS, TESTNAME }, + new String[0]); - // Test 2: AppCDS - dumping loaded classes includes "test" classes + // Test 2: -XX:+UseAppCDS - dumping loaded classes includes "test" classes dumpLoadedClasses(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); // Next tests rely on the classlist we just dumped - // Test 3: No AppCDS - "test" classes in classlist ignored when dumping - // Although AppCDS isn't used, all classes will be found during dumping - // after the fix for JDK-8193434. Classes which are not in the boot - // loader dictionary will not be saved into the archive. - dumpArchive(false, new String[] { BOOTCLASS }, + // Test 3: -XX:-UseAppCDS - No effect, "test" classes in classlist are dumped + dumpArchive(false, new String[] { BOOTCLASS, TESTNAME }, new String[0]); - // Test 4: AppCDS - "test" classes in classlist are dumped + // Test 4: -XX:+UseAppCDS - "test" classes in classlist are dumped dumpArchive(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); // Next tests rely on the archive we just dumped - // Test 5: No AppCDS - Using archive containing "test" classes ignores them - useArchive(false, new String[] { BOOTCLASS }, - new String[] { TESTNAME }); + // Test 5: -XX:-UseAppCDS - No effect, using archive containing "test" loads them + useArchive(false, new String[] { BOOTCLASS, TESTNAME }, + new String[0]); - // Test 6: AppCDS - Using archive containing "test" classes loads them + // Test 6: -XX:+UseAppCDS - Using archive containing "test" classes loads them useArchive(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); } @@ -129,7 +126,7 @@ "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, "-cp", TESTJAR, - useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", + (useAppCDS) ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", TESTNAME, TEST_OUT)); @@ -156,8 +153,6 @@ String[] unexpectedClasses) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, TestCommon.makeCommandLineForAppCDS( - useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" : - "-XX:+UnlockDiagnosticVMOptions", "-cp", TESTJAR, useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", @@ -183,8 +178,6 @@ String[] unexpectedClasses) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, TestCommon.makeCommandLineForAppCDS( - useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" : - "-XX:+UnlockDiagnosticVMOptions", "-cp", TESTJAR, useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", --- old/test/hotspot/jtreg/runtime/appcds/VerifierTest.java 2018-04-24 20:05:23.700997493 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/VerifierTest.java 2018-04-24 20:05:22.376921257 -0400 @@ -243,7 +243,6 @@ if (!dump_setting.equals(prev_dump_setting)) { OutputAnalyzer dumpOutput = TestCommon.dump( jar, appClasses, dump_setting, - "-XX:+UnlockDiagnosticVMOptions", // FIXME: the following options are for working around a GC // issue - assert failure when dumping archive with the -Xverify:all "-Xms256m", --- old/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-04-24 20:05:27.461213993 -0400 +++ new/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-04-24 20:05:26.109136145 -0400 @@ -247,7 +247,6 @@ cmd.add("-Xshare:dump"); cmd.add("-Xlog:cds,cds+hashtables"); - cmd.add("-XX:+UnlockDiagnosticVMOptions"); if (opts.archiveName == null) opts.archiveName = getDefaultArchiveName(); cmd.add("-XX:SharedArchiveFile=./" + opts.archiveName); @@ -385,7 +384,6 @@ for (String p : opts.prefix) cmd.add(p); cmd.add("-Xshare:" + opts.xShareMode); - cmd.add("-XX:+UnlockDiagnosticVMOptions"); cmd.add("-Dtest.timeout.factor=" + TestTimeoutFactor); if (opts.archiveName == null)