diff --git a/hotspot/src/share/vm/runtime/globals_ext.hpp b/hotspot/src/share/vm/runtime/globals_ext.hpp index f9843f0bcc4..a385c614e14 100644 --- a/hotspot/src/share/vm/runtime/globals_ext.hpp +++ b/hotspot/src/share/vm/runtime/globals_ext.hpp @@ -125,7 +125,7 @@ experimental(bool, UseWispMonitor, false, \ "yields to next coroutine when ObjectMonitor is contended") \ \ - product(bool, UseWisp2, false, \ + experimental(bool, UseWisp2, false, \ "Enable Wisp2") \ \ diagnostic(bool, VerboseWisp, false, \ diff --git a/hotspot/src/share/vm/runtime/quickStart.cpp b/hotspot/src/share/vm/runtime/quickStart.cpp index 9211b686548..73cfcf5e899 100644 --- a/hotspot/src/share/vm/runtime/quickStart.cpp +++ b/hotspot/src/share/vm/runtime/quickStart.cpp @@ -1,16 +1,15 @@ -#include -#include -#include +#include "precompiled.hpp" #include "classfile/vmSymbols.hpp" #include "classfile/javaClasses.hpp" #include "memory/resourceArea.hpp" +#include "memory/oopFactory.hpp" #include "runtime/arguments.hpp" #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" #include "runtime/quickStart.hpp" #include "runtime/vm_version.hpp" #include "utilities/defaultStream.hpp" -#include "jfr/recorder/service/jfrOptionSet.hpp" +#include "runtime/globals_extension.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "oops/oop.inline.hpp" @@ -411,7 +410,7 @@ void QuickStart::check_features(const char* &str) { if (str[end] == ',' || (exit = (str[end] == '\n'))) { // handle feature for (int i = 0; i < QuickStart::Count; i++) { - int len = MIN2(::strlen(&str[begin]), ::strlen(_opt_name[i])); + size_t len = MIN2(::strlen(&str[begin]), ::strlen(_opt_name[i])); if (::strncmp(&str[begin], _opt_name[i], len) == 0) { // find a feature which is enabled at tracer phase. tracer_features[i] = true; @@ -440,7 +439,7 @@ void QuickStart::check_features(const char* &str) { } bool QuickStart::load_and_validate(const JavaVMInitArgs* options_args) { - char line[PATH_MAX]; + char line[JVM_MAXPATHLEN]; const char* tail = NULL; bool feature_checked = false; bool version_checked = false; @@ -469,9 +468,9 @@ bool QuickStart::load_and_validate(const JavaVMInitArgs* options_args) { continue; } // ignore \n - int size = strlen(tail) - 1; + size_t size = strlen(tail) - 1; const char *image_ident = QuickStart::image_id(); - int ident_size = image_ident != NULL ? strlen(image_ident) : 0; + size_t ident_size = image_ident != NULL ? strlen(image_ident) : 0; if (size != ident_size) { tty->print_cr("Container image isn't the same."); return false; @@ -575,8 +574,8 @@ void QuickStart::calculate_cache_path() { tty->print_cr("Cannot get temp directory"); vm_exit(1); } - char buf[PATH_MAX]; - jio_snprintf(buf, PATH_MAX, "%s%s%s_%d_%ld", temp, os::file_separator(), DEFAULT_SHARED_DIRECTORY, os::current_process_id(), os::javaTimeMillis()); + char buf[JVM_MAXPATHLEN]; + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s_%d_%ld", temp, os::file_separator(), DEFAULT_SHARED_DIRECTORY, os::current_process_id(), os::javaTimeMillis()); _cache_path = os::strdup(buf); } else { const char* home = ::getenv("HOME"); @@ -588,8 +587,8 @@ void QuickStart::calculate_cache_path() { vm_exit(1); } } - char buf[PATH_MAX]; - jio_snprintf(buf, PATH_MAX, "%s%s%s", home, os::file_separator(), DEFAULT_SHARED_DIRECTORY); + char buf[JVM_MAXPATHLEN]; + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", home, os::file_separator(), DEFAULT_SHARED_DIRECTORY); _cache_path = os::strdup(buf); } tty->print_cr("cache path is set as default with %s", _cache_path); @@ -655,7 +654,11 @@ void QuickStart::setenv_for_roles() { } else { ShouldNotReachHere(); } +#if defined(_WINDOWS) + Unimplemented(); +#else setenv("ALIBABA_QUICKSTART_ROLE", role, 1); +#endif } void QuickStart::process_argument_for_optimization() { @@ -740,8 +743,12 @@ void QuickStart::add_CDSDumpHook(TRAPS) { } bool QuickStart::determine_role(const JavaVMInitArgs* options_args) { +#if defined(_WINDOWS) + Unimplemented(); + return false; +#else struct stat st; - char buf[PATH_MAX]; + char buf[JVM_MAXPATHLEN]; int ret = os::stat(_cache_path, &st); if (ret != 0) { if (_print_stat_enabled) { @@ -761,7 +768,7 @@ bool QuickStart::determine_role(const JavaVMInitArgs* options_args) { } // check whether the metadata file exists. - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), METADATA_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), METADATA_FILE); _metadata_file_path = os::strdup(buf, mtInternal); ret = os::stat(_metadata_file_path, &st); if (ret < 0 && errno == ENOENT) { @@ -769,7 +776,7 @@ bool QuickStart::determine_role(const JavaVMInitArgs* options_args) { print_stat(false); } // Create a LOCK file - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), LOCK_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), LOCK_FILE); _lock_path = os::strdup(buf, mtInternal); // if the lock exists, it returns -1. _lock_file_fd = os::create_binary_file(_lock_path, false); @@ -777,7 +784,7 @@ bool QuickStart::determine_role(const JavaVMInitArgs* options_args) { tty->print_cr("Fail to create LOCK file"); return false; } - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), TEMP_METADATA_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), TEMP_METADATA_FILE); _temp_metadata_file_path = os::strdup(buf, mtInternal); ret = os::stat(buf, &st); if (ret == 0) { @@ -808,14 +815,19 @@ bool QuickStart::determine_role(const JavaVMInitArgs* options_args) { return true; } return false; +#endif } bool QuickStart::prepare_dump(const JavaVMInitArgs *options_args) { +#if defined(_WINDOWS) + Unimplemented(); + return false; +#else struct stat st; - char buf[PATH_MAX]; + char buf[JVM_MAXPATHLEN]; // check whether the metadata file exists. // when run quickstart with profile,then dump.In the profile stage,the metadata.tmp not rename to metadata. - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), TEMP_METADATA_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), TEMP_METADATA_FILE); _temp_metadata_file_path = os::strdup(buf); int ret = os::stat(_temp_metadata_file_path, &st); if (ret < 0 && errno == ENOENT) { @@ -823,7 +835,7 @@ bool QuickStart::prepare_dump(const JavaVMInitArgs *options_args) { return false; } else if (ret == 0 && check_integrity(options_args, _temp_metadata_file_path)) { // Create a LOCK file - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), LOCK_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), LOCK_FILE); _lock_path = os::strdup(buf); // if the lock exists, it returns -1. _lock_file_fd = os::create_binary_file(_lock_path, false); @@ -831,7 +843,7 @@ bool QuickStart::prepare_dump(const JavaVMInitArgs *options_args) { tty->print_cr("Fail to create LOCK file"); return false; } - jio_snprintf(buf, PATH_MAX, "%s%s%s", _cache_path, os::file_separator(), METADATA_FILE); + jio_snprintf(buf, JVM_MAXPATHLEN, "%s%s%s", _cache_path, os::file_separator(), METADATA_FILE); _metadata_file_path = os::strdup(buf); _role = Dumper; tty->print_cr("Running as dumper"); @@ -839,6 +851,7 @@ bool QuickStart::prepare_dump(const JavaVMInitArgs *options_args) { } tty->print_cr("Cannot dump,maybe the %s is invalid!ret: %d", TEMP_METADATA_FILE, ret); return false; +#endif } void QuickStart::settle_opt_pass_table() { // If a feature is disabled by quickstart, we have no need to check it @@ -896,9 +909,13 @@ void QuickStart::generate_metadata_file(bool rename_metafile) { } int QuickStart::remove_dir(const char* dir) { +#if defined(_WINDOWS) + Unimplemented(); + return -1; +#else char cur_dir[] = "."; char up_dir[] = ".."; - char dir_name[PATH_MAX]; + char dir_name[JVM_MAXPATHLEN]; DIR *dirp = NULL; struct dirent *dp; struct stat dir_stat; @@ -917,7 +934,7 @@ int QuickStart::remove_dir(const char* dir) { if ((strcmp(cur_dir, dp->d_name) == 0) || (strcmp(up_dir, dp->d_name) == 0)) { continue; } - jio_snprintf(dir_name, PATH_MAX, "%s%s%s", dir, os::file_separator(), dp->d_name); + jio_snprintf(dir_name, JVM_MAXPATHLEN, "%s%s%s", dir, os::file_separator(), dp->d_name); ret = remove_dir(dir_name); if (ret != 0) { break; @@ -933,6 +950,7 @@ int QuickStart::remove_dir(const char* dir) { tty->print_cr("unknow file type\n"); } return ret; +#endif } void QuickStart::notify_dump() { @@ -976,7 +994,7 @@ bool QuickStart::dump_cached_info(const JavaVMInitArgs* options_args) { _temp_metadata_file->print_cr("%s", _identifier_name[ContainerImageID]); } - int cp_len = strlen(Arguments::get_appclasspath()); + int cp_len = (int)strlen(Arguments::get_appclasspath()); _temp_metadata_file->print_cr("%s%d", _identifier_name[ClassPathLength], cp_len); _temp_metadata_file->write(Arguments::get_appclasspath(), cp_len); _temp_metadata_file->cr(); diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadClass.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadClass.java index 75b363279b4..43aa9f041db 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadClass.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadClass.java @@ -70,6 +70,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -116,6 +118,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -138,6 +142,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Xshare:on", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithException.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithException.java index 7df362d3b1c..f2c623b299c 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithException.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithException.java @@ -55,6 +55,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -75,6 +77,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -107,6 +111,8 @@ static void changeSourcePath() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Xshare:on", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithNullURL.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithNullURL.java index f89be54305f..81cb27c6614 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithNullURL.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithNullURL.java @@ -66,6 +66,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -86,6 +88,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -108,6 +112,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Xshare:on", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithWisp.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithWisp.java index 2ad0c5000f9..dd52feb1fb4 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithWisp.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadClassWithWisp.java @@ -69,6 +69,9 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:+UseWisp2", "-cp", @@ -114,8 +117,11 @@ static void convertClassList() throws Exception { } static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + "-XX:+UnlockExperimentalVMOptions", "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -139,6 +145,9 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Xshare:on", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadNotFound.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadNotFound.java index bb1761d5468..7cfc520124d 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadNotFound.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadNotFound.java @@ -69,6 +69,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -115,6 +117,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -137,6 +141,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Dcom.alibaba.cds.listPath=" + CLASSLIST_FILE_2, "-Xshare:on", diff --git a/jdk/test/com/alibaba/cds/TestDumpAndLoadVerficationFailure.java b/jdk/test/com/alibaba/cds/TestDumpAndLoadVerficationFailure.java index f154b51415e..c61db637ac4 100644 --- a/jdk/test/com/alibaba/cds/TestDumpAndLoadVerficationFailure.java +++ b/jdk/test/com/alibaba/cds/TestDumpAndLoadVerficationFailure.java @@ -74,6 +74,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -120,6 +122,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -142,6 +146,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Dcom.alibaba.cds.listPath=" + CLASSLIST_FILE_2, "-Xshare:on", diff --git a/jdk/test/com/alibaba/cds/TestDumpListInParallel.java b/jdk/test/com/alibaba/cds/TestDumpListInParallel.java index aedabd1406c..ac400cb1373 100644 --- a/jdk/test/com/alibaba/cds/TestDumpListInParallel.java +++ b/jdk/test/com/alibaba/cds/TestDumpListInParallel.java @@ -51,6 +51,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist "-XX:+EagerAppCDS", @@ -73,6 +75,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestDumpUnsupportedCheck.java b/jdk/test/com/alibaba/cds/TestDumpUnsupportedCheck.java index 64ea8b20b32..32a11056d08 100644 --- a/jdk/test/com/alibaba/cds/TestDumpUnsupportedCheck.java +++ b/jdk/test/com/alibaba/cds/TestDumpUnsupportedCheck.java @@ -31,6 +31,8 @@ public static void main(String[] args) throws Exception { static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + System.getProperty("test.src", ".") + File.separator + CLASSLIST_FILE, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestLoadClassFlow.java b/jdk/test/com/alibaba/cds/TestLoadClassFlow.java index 30b8d592928..9c09e21a5f0 100644 --- a/jdk/test/com/alibaba/cds/TestLoadClassFlow.java +++ b/jdk/test/com/alibaba/cds/TestLoadClassFlow.java @@ -70,6 +70,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -116,6 +118,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -137,6 +141,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-Xshare:on", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, diff --git a/jdk/test/com/alibaba/cds/TestRegisterClassLoader.java b/jdk/test/com/alibaba/cds/TestRegisterClassLoader.java index 9032c05f1f9..f4a8d119484 100644 --- a/jdk/test/com/alibaba/cds/TestRegisterClassLoader.java +++ b/jdk/test/com/alibaba/cds/TestRegisterClassLoader.java @@ -32,6 +32,8 @@ public static void main(String... args) throws Exception { if (args.length == 0) { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-Dtest.src=" + TEST_SRC, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", TestRegisterClassLoader.class.getName(), "1"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("[Register CL Exception] identifier or loader is null") diff --git a/jdk/test/com/alibaba/cds/TestSuppressingAppCDSErrors.java b/jdk/test/com/alibaba/cds/TestSuppressingAppCDSErrors.java index 1df221f9058..afb78a797b1 100644 --- a/jdk/test/com/alibaba/cds/TestSuppressingAppCDSErrors.java +++ b/jdk/test/com/alibaba/cds/TestSuppressingAppCDSErrors.java @@ -74,6 +74,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-cp", TESTJAR, @@ -120,6 +122,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, @@ -142,6 +146,8 @@ static void dumpArchive() throws Exception { static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:+SuppressAppCDSErrors", // Test suppressing errors "-Xshare:on", diff --git a/jdk/test/com/alibaba/cds/TestWispWithAppCDS.java b/jdk/test/com/alibaba/cds/TestWispWithAppCDS.java index 5b193325b9c..9fbdde800c9 100644 --- a/jdk/test/com/alibaba/cds/TestWispWithAppCDS.java +++ b/jdk/test/com/alibaba/cds/TestWispWithAppCDS.java @@ -67,7 +67,10 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist + "-XX:+UnlockExperimentalVMOptions", "-XX:+UseWisp2", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:ActiveProcessorCount=4", "-cp", @@ -91,7 +94,10 @@ static void dumpArchive() throws Exception { TESTJAR, "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, + "-XX:+UnlockExperimentalVMOptions", "-XX:+UseWisp2", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:ActiveProcessorCount=4", "-XX:+TraceCDSLoading", @@ -114,6 +120,9 @@ static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, "-Xshare:on", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+EagerAppCDS", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, "-XX:+TraceCDSLoading", diff --git a/jdk/test/com/alibaba/cds/appcds/TestDumpAndLoadForAppCDS.java b/jdk/test/com/alibaba/cds/appcds/TestDumpAndLoadForAppCDS.java index 523ba7eedd8..f4142d7a284 100644 --- a/jdk/test/com/alibaba/cds/appcds/TestDumpAndLoadForAppCDS.java +++ b/jdk/test/com/alibaba/cds/appcds/TestDumpAndLoadForAppCDS.java @@ -73,6 +73,8 @@ static void dumpLoadedClasses(String[] expectedClasses) throws Exception { // trigger JVMCI runtime init so that JVMCI classes will be // included in the classlist // "-Xlog:class+load=debug", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:+UseAppCDS", "-XX:DumpLoadedClassList=" + Paths.get(CLASSLIST_FILE), "-Xshare:off", @@ -124,6 +126,8 @@ static void dumpArchive() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", TESTJAR, + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:SharedClassListFile=" + CLASSLIST_FILE_2, "-XX:SharedArchiveFile=" + ARCHIVE_FILE, "-Xshare:dump", @@ -145,6 +149,8 @@ static void startWithJsa() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-Dtest.classes=" + TEST_CLASS, "-Xshare:on", + "-XX:+UseCompressedOops", + "-XX:+UseCompressedClassPointers", "-XX:SharedArchiveFile=" + ARCHIVE_FILE, "-cp", TESTJAR,