From e2abde88bb8c9f612c71739149d32f0940c2eaea Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Sep 2023 08:37:15 +0200 Subject: [PATCH] Backport 922e86f4ff28c7b17af8e7b5867a40fc76b7fdd7 --- src/hotspot/share/prims/whitebox.cpp | 4 ++-- test/hotspot/jtreg/TEST.ROOT | 2 +- test/hotspot/jtreg/runtime/cds/SharedStrings.java | 2 +- test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java | 2 +- .../jtreg/runtime/cds/SharedStringsRunAuto.java | 2 +- .../jtreg/runtime/cds/appcds/CommandLineFlagCombo.java | 2 +- .../appcds/cacheObject/ArchivedIntegerCacheTest.java | 2 +- .../appcds/cacheObject/ArchivedModuleComboTest.java | 2 +- .../appcds/cacheObject/ArchivedModuleCompareTest.java | 2 +- .../cacheObject/ArchivedModuleWithCustomImageTest.java | 2 +- .../cds/appcds/cacheObject/CheckCachedMirrorTest.java | 2 +- .../cds/appcds/cacheObject/DifferentHeapSizes.java | 2 +- .../cds/appcds/cacheObject/DumpTimeVerifyFailure.java | 4 ++-- .../runtime/cds/appcds/cacheObject/GCStressTest.java | 2 +- .../cds/appcds/cacheObject/HeapFragmentationTest.java | 2 +- .../cacheObject/MirrorWithReferenceFieldsTest.java | 2 +- .../cds/appcds/cacheObject/OpenArchiveRegion.java | 4 ++-- .../cds/appcds/cacheObject/PrimitiveTypesTest.java | 2 +- .../cds/appcds/cacheObject/RedefineClassTest.java | 2 +- .../javaldr/ExceptionDuringDumpAtObjectsInitPhase.java | 2 +- .../cds/appcds/javaldr/GCSharedStringsDuringDump.java | 2 +- .../cds/appcds/javaldr/HumongousDuringDump.java | 2 +- .../runtime/cds/appcds/sharedStrings/ExerciseGC.java | 2 +- .../runtime/cds/appcds/sharedStrings/FlagCombo.java | 4 ++-- .../cds/appcds/sharedStrings/IncompatibleOptions.java | 6 +++--- .../cds/appcds/sharedStrings/InternSharedString.java | 2 +- .../cds/appcds/sharedStrings/InvalidFileFormat.java | 4 ++-- .../runtime/cds/appcds/sharedStrings/LargePages.java | 2 +- .../cds/appcds/sharedStrings/LockSharedStrings.java | 2 +- .../cds/appcds/sharedStrings/SharedStringsBasic.java | 2 +- .../appcds/sharedStrings/SharedStringsBasicPlus.java | 2 +- .../appcds/sharedStrings/SharedStringsHumongous.java | 2 +- .../cds/appcds/sharedStrings/SharedStringsStress.java | 2 +- .../cds/appcds/sharedStrings/SharedStringsWbTest.java | 2 +- .../runtime/cds/appcds/sharedStrings/SysDictCrash.java | 2 +- .../ReplaceCriticalClassesForSubgraphs.java | 2 +- test/jtreg-ext/requires/VMProps.java | 10 ++++------ test/lib/jdk/test/whitebox/WhiteBox.java | 2 +- 38 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index d5ff64cd0eb..5a610227e7c 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -1962,7 +1962,7 @@ WB_ENTRY(jboolean, WB_IsJVMCISupportedByGC(JNIEnv* env)) #endif WB_END -WB_ENTRY(jboolean, WB_IsJavaHeapArchiveSupported(JNIEnv* env)) +WB_ENTRY(jboolean, WB_CanWriteJavaHeapArchive(JNIEnv* env)) return HeapShared::is_heap_object_archiving_allowed(); WB_END @@ -2585,7 +2585,7 @@ static JNINativeMethod methods[] = { {CC"isDTraceIncluded", CC"()Z", (void*)&WB_IsDTraceIncluded }, {CC"isC2OrJVMCIIncluded", CC"()Z", (void*)&WB_isC2OrJVMCIIncluded }, {CC"isJVMCISupportedByGC", CC"()Z", (void*)&WB_IsJVMCISupportedByGC}, - {CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported }, + {CC"canWriteJavaHeapArchive", CC"()Z", (void*)&WB_CanWriteJavaHeapArchive }, {CC"cdsMemoryMappingFailed", CC"()Z", (void*)&WB_CDSMemoryMappingFailed }, {CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches }, diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 36f7c78de2b..48e0cca9021 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -68,7 +68,7 @@ requires.properties= \ vm.rtm.compiler \ vm.cds \ vm.cds.custom.loaders \ - vm.cds.archived.java.heap \ + vm.cds.write.archived.java.heap \ vm.jvmti \ vm.graal.enabled \ vm.compiler1.enabled \ diff --git a/test/hotspot/jtreg/runtime/cds/SharedStrings.java b/test/hotspot/jtreg/runtime/cds/SharedStrings.java index 247a8571499..7a4e9813c39 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStrings.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStrings.java @@ -25,7 +25,7 @@ * @test * @summary Check to make sure that shared strings in the bootstrap CDS archive * are actually shared - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib * @build SharedStringsWb jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java b/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java index 434cee78937..c555268026d 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java @@ -24,7 +24,7 @@ /** * @test SharedStringsDedup * @summary Test -Xshare:auto with shared strings and -XX:+UseStringDeduplication - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib * @run driver SharedStringsDedup */ diff --git a/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java b/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java index a2437a0231d..271fb2ec255 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java @@ -24,7 +24,7 @@ /** * @test SharedStringsAuto * @summary Test -Xshare:auto with shared strings. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib * @run driver SharedStringsRunAuto */ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java index eb1822550cd..4384954c12c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java @@ -24,7 +24,7 @@ /* * @test CommandLineFlagCombo - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java index 5dc05e2686c..2bcbe18e1ff 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Test primitive box caches integrity in various scenarios (IntegerCache etc) - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckIntegerCacheApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java index 0b47319bf91..3b37bfde77a 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Test archived system module sub-graph and verify objects are archived. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckArchivedModuleApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java index 00ef746123f..d66ba685290 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Compare archived system modules with non-archived. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile PrintSystemModulesApp.java * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar PrintSystemModulesApp diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java index a47c9488ce1..2b2115b8472 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java @@ -24,7 +24,7 @@ /* * @test * @summary Test archived module graph with custom runtime image - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckArchivedModuleApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java index 24648273fef..8e8cfe51a75 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Test archived mirror - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.cds.custom.loaders * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java index 9c12b300236..9b4987f8894 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java @@ -25,7 +25,7 @@ /* * @test * @summary Test automatic relocation of archive heap regions dur to heap size changes. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile ../test-classes/Hello.java * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java index fe5c546493e..0ac5dbe672b 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -26,7 +26,7 @@ * @test * @summary Dump time should not crash if any class with shared strings fails verification due to missing dependencies. * @bug 8186789 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile MyOuter.java MyException.java * @run driver DumpTimeVerifyFailure diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java index ecf6ebea5d7..68811a841b0 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java @@ -26,7 +26,7 @@ * @test * @key randomness * @summary - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox jdk.test.lib.Utils * @compile GCStressApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java index f2ec91aee42..ca1df0c9487 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java @@ -26,7 +26,7 @@ * @test * @summary Relocate CDS archived regions to the top of the G1 heap * @bug 8214455 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (sun.arch.data.model == "64" & os.maxMemory > 4g) * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HeapFragmentationApp diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java index 0ab28b13b5b..4c670ccba9b 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Test archived mirror with reference fields - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile MirrorWithReferenceFieldsApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java index c2384db0943..2f24f589c0e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -25,7 +25,7 @@ /* * @test * @summary Test open archive heap regions - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java index d367aecbd56..f94ea15f8b1 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java @@ -25,7 +25,7 @@ /* * @test * @summary Test archived primitive type mirrors - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile PrimitiveTypesApp.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java index 3c8e09da747..22cad07d561 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java @@ -26,7 +26,7 @@ * @test * @summary Redefine shared class. GC should not cause crash with cached resolved_references. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes /test/hotspot/jtreg/runtime/cds/appcds/jvmti - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @build jdk.test.whitebox.WhiteBox * RedefineClassApp diff --git a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java index 2f3b18d1ae7..9238a832add 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java @@ -26,7 +26,7 @@ * @test * @summary Out of memory When dumping the CDS archive * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @run driver ExceptionDuringDumpAtObjectsInitPhase */ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java index 9062976c536..501e2398d9d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java @@ -27,7 +27,7 @@ * @summary Similar to GCDuringDumping.java, this test adds the -XX:SharedArchiveConfigFile * option for testing the interaction with GC and shared strings. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java index 7867b5b7b36..267eb5b9452 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java @@ -26,7 +26,7 @@ * @test * @summary Test how CDS dumping handles the existence of humongous G1 regions. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @run driver/timeout=240 HumongousDuringDump */ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java index 29a5230c3b1..77097e0b7a4 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java @@ -25,7 +25,7 @@ /* * @test * @summary Exercise GC with shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloStringGC jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java index 886a46f1c17..d53db6d6be6 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java @@ -25,7 +25,7 @@ /** * @test * @summary Test relevant combinations of command line flags with shared strings - * @requires vm.cds.archived.java.heap & vm.hasJFR + * @requires vm.cds.write.archived.java.heap & vm.hasJFR * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver FlagCombo @@ -35,7 +35,7 @@ * @test * @summary Test relevant combinations of command line flags with shared strings * @comment A special test excluding the case that requires JFR - * @requires vm.cds.archived.java.heap & !vm.hasJFR + * @requires vm.cds.write.archived.java.heap & !vm.hasJFR * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver FlagCombo noJfr diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java index 496310555dd..8d3d75d9c08 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java @@ -31,7 +31,7 @@ * @test * @summary Test options that are incompatible with use of shared strings * Also test mismatch in oops encoding between dump time and run time - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. @@ -46,7 +46,7 @@ /* * @test - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (vm.gc=="null") * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox @@ -57,7 +57,7 @@ /* * @test - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (vm.gc=="null") * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java index 461c6cd98c6..83d1929751b 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java @@ -25,7 +25,7 @@ /* * @test * @summary Test shared strings together with string intern operation - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @compile InternStringTest.java * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java index 463673aea06..dfe374cd02a 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,7 +25,7 @@ /* * @test * @summary Check most common errors in file format - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver InvalidFileFormat diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java index 0a7d4d0a57b..bd1ee674bcd 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java @@ -25,7 +25,7 @@ /* * @test * @summary Basic shared string test with large pages - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver LargePages diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java index 5e0d275e1ff..cb004c74f36 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java @@ -25,7 +25,7 @@ /* * @test * @summary Test locking on shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @compile LockStringTest.java LockStringValueTest.java * @build jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java index f116690ac01..294b01c4c91 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java @@ -25,7 +25,7 @@ /* * @test * @summary Basic test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString * @run driver SharedStringsBasic diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java index c477e27fd0d..69cca750bc5 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java @@ -25,7 +25,7 @@ /* * @test * @summary Basic plus test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloStringPlus jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java index 83d82de5031..b863f609caf 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java @@ -26,7 +26,7 @@ * @test * @summary Use a shared string allocated in a humongous G1 region. * @comment -- the following implies that G1 is used (by command-line or by default) - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java index 13a0bc34f50..0a4148ee487 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java @@ -25,7 +25,7 @@ /* * @test * @summary Write a lots of shared strings. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString * @run driver/timeout=500 SharedStringsStress diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java index d11de88ffb9..1ab5e2f3ee9 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java @@ -25,7 +25,7 @@ /* * @test * @summary White box test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox SharedStringsWb * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java index ab3473777f4..f15674171e4 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java @@ -26,7 +26,7 @@ * @test * @summary Regression test for JDK-8098821 * @bug 8098821 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @run driver SysDictCrash */ diff --git a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java index ca321eab58d..1a267665dd6 100644 --- a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java +++ b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java @@ -26,7 +26,7 @@ * @test * @summary Tests how CDS works when critical library classes are replaced with JVMTI ClassFileLoadHook * @library /test/lib - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox * @run main/othervm/native ReplaceCriticalClassesForSubgraphs diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index ec4ca37bd4b..08979baae6d 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -111,7 +111,7 @@ public Map call() { // vm.cds is true if the VM is compiled with cds support. map.put("vm.cds", this::vmCDS); map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders); - map.put("vm.cds.archived.java.heap", this::vmCDSForArchivedJavaHeap); + map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap); // vm.graal.enabled is true if Graal is used as JIT map.put("vm.graal.enabled", this::isGraalEnabled); map.put("vm.compiler1.enabled", this::isCompiler1Enabled); @@ -386,12 +386,10 @@ protected String vmCDSForCustomLoaders() { } /** - * Check for CDS support for archived Java heap regions. - * - * @return true if CDS provides support for archive Java heap regions in the VM to be tested. + * @return true if this VM can write Java heap objects into the CDS archive */ - protected String vmCDSForArchivedJavaHeap() { - return "" + ("true".equals(vmCDS()) && WB.isJavaHeapArchiveSupported()); + protected String vmCDSCanWriteArchivedJavaHeap() { + return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()); } /** diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index bc9434fa508..517c47e8705 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -600,7 +600,7 @@ public Object getMethodOption(Executable method, String name) { public native boolean isCDSIncluded(); public native boolean isJFRIncluded(); public native boolean isDTraceIncluded(); - public native boolean isJavaHeapArchiveSupported(); + public native boolean canWriteJavaHeapArchive(); public native Object getResolvedReferences(Class c); public native void linkClass(Class c); public native boolean areOpenArchiveHeapObjectsMapped();