test/jtreg-ext/requires/VMProps.java
changeset 46225 f99654379e9c
parent 43394 68ed4de0f9c8
child 46237 3aeb6cbc0ccc
child 46238 661b22bb24d2
--- a/test/jtreg-ext/requires/VMProps.java	Tue May 30 17:03:42 2017 -0400
+++ b/test/jtreg-ext/requires/VMProps.java	Thu Jun 01 17:34:34 2017 -0700
@@ -37,6 +37,7 @@
 import sun.hotspot.cpuinfo.CPUInfo;
 import sun.hotspot.gc.GC;
 import sun.hotspot.WhiteBox;
+import jdk.test.lib.Platform;
 
 /**
  * The Class to be invoked by jtreg prior Test Suite execution to
@@ -66,6 +67,8 @@
         map.put("vm.jvmci", vmJvmci());
         map.put("vm.emulatedClient", vmEmulatedClient());
         map.put("vm.cpu.features", cpuFeatures());
+        map.put("vm.rtm.cpu", vmRTMCPU());
+        map.put("vm.rtm.os", vmRTMOS());
         vmGC(map); // vm.gc.X = true/false
 
         VMProps.dump(map);
@@ -206,6 +209,36 @@
     }
 
     /**
+     * @return true if VM runs RTM supported OS and false otherwise.
+     */
+    protected String vmRTMOS() {
+        boolean isRTMOS = true;
+
+        if (Platform.isAix()) {
+            // Actually, this works since AIX 7.1.3.30, but os.version property
+            // is set to 7.1.
+            isRTMOS = (Platform.getOsVersionMajor()  > 7) ||
+                      (Platform.getOsVersionMajor() == 7 && Platform.getOsVersionMinor() > 1);
+
+        } else if (Platform.isLinux()) {
+            if (Platform.isPPC()) {
+                isRTMOS = (Platform.getOsVersionMajor()  > 4) ||
+                          (Platform.getOsVersionMajor() == 4 && Platform.getOsVersionMinor() > 1);
+            }
+        }
+        return "" + isRTMOS;
+    }
+
+    /**
+     * @return true if VM runs RTM supported CPU and false otherwise.
+     */
+    protected String vmRTMCPU() {
+        boolean vmRTMCPU = (Platform.isPPC() ? CPUInfo.hasFeature("tcheck") : CPUInfo.hasFeature("rtm"));
+
+        return "" + vmRTMCPU;
+    }
+
+    /**
      * 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
      * execution.