changeset 2775:8a911c55ded5

8185536: @key aot should be replaced w/ @requires vm.aot Reviewed-by: kvn, goetz
author iignatyev
date Wed, 02 Aug 2017 08:52:14 -0700
parents 035a3a7c0ea7
children d16c61dfcaf6
files test/jtreg-ext/requires/VMProps.java
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/jtreg-ext/requires/VMProps.java	Wed Jul 05 18:23:35 2017 -0700
+++ b/test/jtreg-ext/requires/VMProps.java	Wed Aug 02 08:52:14 2017 -0700
@@ -24,6 +24,7 @@
 
 import java.io.IOException;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardOpenOption;
 import java.util.ArrayList;
@@ -69,6 +70,7 @@
         map.put("vm.cpu.features", cpuFeatures());
         map.put("vm.rtm.cpu", vmRTMCPU());
         map.put("vm.rtm.os", vmRTMOS());
+        map.put("vm.aot", vmAOT());
         vmGC(map); // vm.gc.X = true/false
 
         VMProps.dump(map);
@@ -239,6 +241,22 @@
     }
 
     /**
+     * @return true if VM supports AOT and false otherwise
+     */
+    protected String vmAOT() {
+        // builds with aot have jaotc in <JDK>/bin
+        Path bin = Paths.get(System.getProperty("java.home"))
+                        .resolve("bin");
+        Path jaotc;
+        if (Platform.isWindows()) {
+            jaotc = bin.resolve("jaotc.exe");
+        } else {
+            jaotc = bin.resolve("jaotc");
+        }
+        return "" + Files.exists(jaotc);
+    }
+
+    /**
      * 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.