diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 88562e365a9..3623db4c5e5 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -71,6 +71,8 @@ public class VMProps implements Callable> { map.put("vm.rtm.cpu", vmRTMCPU()); map.put("vm.rtm.os", vmRTMOS()); map.put("vm.aot", vmAOT()); + // vm.cds is true if the VM is compiled with cds support. + map.put("vm.cds", vmCDS()); vmGC(map); // vm.gc.X = true/false VMProps.dump(map); @@ -277,6 +279,19 @@ public class VMProps implements Callable> { return "" + Files.exists(jaotc); } + /** + * Check for CDS support. + * + * @return true if CDS is supported by the VM to be tested. + */ + protected String vmCDS() { + if (WB.isCDSIncludedInVmBuild()) { + return "true"; + } else { + return "false"; + } + } + /** * Dumps the map to the file if the file name is given as the property. * This functionality could be helpful to know context in the real diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 84b4a573123..e8c0dba92fa 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -523,6 +523,7 @@ public class WhiteBox { public native boolean isShared(Object o); public native boolean isSharedClass(Class c); public native boolean areSharedStringsIgnored(); + public native boolean isCDSIncludedInVmBuild(); // Compiler Directive public native int addCompilerDirective(String compDirect);