diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index b48a86d4d6d..59dd48e5af7 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -81,6 +81,7 @@ requires.properties= \ vm.cds \ vm.cds.custom.loaders \ vm.cds.supports.aot.class.linking \ + vm.cds.supports.aot.code.caching \ vm.cds.write.archived.java.heap \ vm.continuations \ vm.jvmti \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java index a65db6956c4..40bd8ee1a88 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java @@ -25,10 +25,8 @@ /** * @test * @summary Sanity test of AOT Code Cache with compressed oops configurations - * @requires vm.cds - * @requires vm.cds.supports.aot.class.linking + * @requires vm.cds.supports.aot.code.caching * @requires vm.flagless - * @requires !vm.jvmci.enabled * @library /test/lib /test/setup_aot * @build AOTCodeCompressedOopsTest JavacBenchApp * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar diff --git a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java index fd668497b49..d47daaff68c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeFlags.java @@ -25,13 +25,8 @@ /** * @test * @summary Sanity test of combinations of the AOT Code Caching diagnostic flags - * @requires vm.cds - * @requires vm.cds.supports.aot.class.linking - * @requires vm.flavor != "zero" - * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * @requires vm.cds.supports.aot.code.caching * @requires vm.flagless - * @comment work around JDK-8345635 - * @requires !vm.jvmci.enabled * @library /test/lib /test/setup_aot * @build AOTCodeFlags JavacBenchApp * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 5f74ffa6ea6..360c96c74ef 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -124,6 +124,7 @@ public class VMProps implements Callable> { map.put("vm.cds", this::vmCDS); map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders); map.put("vm.cds.supports.aot.class.linking", this::vmCDSSupportsAOTClassLinking); + map.put("vm.cds.supports.aot.code.caching", this::vmCDSSupportsAOTCodeCaching); map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap); map.put("vm.continuations", this::vmContinuations); // vm.graal.enabled is true if Graal is used as JIT @@ -472,6 +473,20 @@ public class VMProps implements Callable> { return vmCDSCanWriteArchivedJavaHeap(); } + /** + * @return true if this VM can support the AOT Code Caching + */ + protected String vmCDSSupportsAOTCodeCaching() { + if ("true".equals(vmCDSSupportsAOTClassLinking()) && + !"zero".equals(vmFlavor()) && + "false".equals(vmJvmciEnabled()) && + (Platform.isX64() || Platform.isAArch64())) { + return "true"; + } else { + return "false"; + } + } + /** * @return true if the VM options specified via the "test.cds.runtime.options" * property is compatible with writing Java heap objects into the CDS archive