changeset 50908:df02866807b6

8203923: Add @requires feature to check flag values for the running JVM Reviewed-by: kvn, dholmes
author stefank
date Thu, 31 May 2018 10:41:36 +0200
parents da74e543020e
children b186322970f4
files test/jtreg-ext/requires/VMProps.java
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/jtreg-ext/requires/VMProps.java	Thu May 31 15:11:57 2018 +0530
+++ b/test/jtreg-ext/requires/VMProps.java	Thu May 31 10:41:36 2018 +0200
@@ -80,6 +80,7 @@
         map.put("vm.graal.enabled", isGraalEnabled());
         map.put("docker.support", dockerSupport());
         vmGC(map); // vm.gc.X = true/false
+        vmOptFinalFlags(map);
 
         VMProps.dump(map);
         return map;
@@ -236,6 +237,25 @@
     }
 
     /**
+     * Selected final flag.
+     * @param map - property-value pairs
+     * @param flagName - flag name
+     */
+    private void vmOptFinalFlag(Map<String, String> map, String flagName) {
+        String value = WB.getBooleanVMFlag(flagName) ? "true" : "false";
+        map.put("vm.opt.final." + flagName, value);
+    }
+
+    /**
+     * Selected sets of final flags.
+     * @param map -property-value pairs
+     */
+    protected void vmOptFinalFlags(Map<String, String> map) {
+        vmOptFinalFlag(map, "ClassUnloading");
+        vmOptFinalFlag(map, "UseCompressedOops");
+    }
+
+    /**
      * @return true if VM runs RTM supported OS and false otherwise.
      */
     protected String vmRTMOS() {