From 1b0dd7c254dc1a087874c8726d8d26b9a41d4145 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Thu, 13 Jul 2023 07:20:18 +0000 Subject: [PATCH] 8310108: Skip ReplaceCriticalClassesForSubgraphs when EnableJVMCI is specified Reviewed-by: dnsimon, iklam --- test/hotspot/jtreg/TEST.ROOT | 1 + .../ReplaceCriticalClassesForSubgraphs.java | 1 + test/jdk/TEST.ROOT | 1 + test/jtreg-ext/requires/VMProps.java | 15 +++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/test/hotspot/jtreg/TEST.ROOT b/test/hotspot/jtreg/TEST.ROOT index 6d789169cea..30b83f79383 100644 --- a/test/hotspot/jtreg/TEST.ROOT +++ b/test/hotspot/jtreg/TEST.ROOT @@ -62,6 +62,7 @@ requires.properties= \ vm.gc.ZGenerational \ vm.gc.ZSinglegen \ vm.jvmci \ + vm.jvmci.enabled \ vm.emulatedClient \ vm.cpu.features \ vm.pageSize \ diff --git a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java index 1a267665dd6..f7d50fd7fe6 100644 --- a/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java +++ b/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java @@ -27,6 +27,7 @@ * @summary Tests how CDS works when critical library classes are replaced with JVMTI ClassFileLoadHook * @library /test/lib * @requires vm.cds.write.archived.java.heap + * @requires !vm.jvmci.enabled * @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/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index f5c593fb4a4..45c858b8315 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -72,6 +72,7 @@ requires.properties= \ vm.hasSA \ vm.hasJFR \ vm.jvmci \ + vm.jvmci.enabled \ vm.jvmti \ docker.support \ release.implementor \ diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index e5b4d561e2b..447b4133cc3 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -102,6 +102,7 @@ public class VMProps implements Callable> { map.put("vm.simpleArch", this::vmArch); map.put("vm.debug", this::vmDebug); map.put("vm.jvmci", this::vmJvmci); + map.put("vm.jvmci.enabled", this::vmJvmciEnabled); map.put("vm.emulatedClient", this::vmEmulatedClient); // vm.hasSA is "true" if the VM contains the serviceability agent // and jhsdb. @@ -266,6 +267,20 @@ public class VMProps implements Callable> { return "true"; } + + /** + * @return true if JVMCI is enabled + */ + protected String vmJvmciEnabled() { + // builds with jvmci have this flag + if ("false".equals(vmJvmci())) { + return "false"; + } + + return "" + Compiler.isJVMCIEnabled(); + } + + /** * @return true if VM runs in emulated-client mode and false otherwise. */