< prev index next >

test/jtreg-ext/requires/VMProps.java

Print this page

        

@@ -22,10 +22,11 @@
  */
 package requires;
 
 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;
 import java.util.HashMap;
 import java.util.List;

@@ -67,10 +68,11 @@
         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());
+        map.put("vm.aot", vmAot());
         vmGC(map); // vm.gc.X = true/false
 
         VMProps.dump(map);
         return map;
     }

@@ -237,10 +239,26 @@
 
         return "" + vmRTMCPU;
     }
 
     /**
+     * @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.
      *
      * @param map
< prev index next >