test/jtreg-ext/requires/VMProps.java
changeset 46238 661b22bb24d2
parent 46225 f99654379e9c
child 46239 bd5621d3ebc1
equal deleted inserted replaced
46236:1b8fd7adc9cc 46238:661b22bb24d2
    22  */
    22  */
    23 package requires;
    23 package requires;
    24 
    24 
    25 import java.io.IOException;
    25 import java.io.IOException;
    26 import java.nio.file.Files;
    26 import java.nio.file.Files;
       
    27 import java.nio.file.Path;
    27 import java.nio.file.Paths;
    28 import java.nio.file.Paths;
    28 import java.nio.file.StandardOpenOption;
    29 import java.nio.file.StandardOpenOption;
    29 import java.util.ArrayList;
    30 import java.util.ArrayList;
    30 import java.util.HashMap;
    31 import java.util.HashMap;
    31 import java.util.List;
    32 import java.util.List;
    67         map.put("vm.jvmci", vmJvmci());
    68         map.put("vm.jvmci", vmJvmci());
    68         map.put("vm.emulatedClient", vmEmulatedClient());
    69         map.put("vm.emulatedClient", vmEmulatedClient());
    69         map.put("vm.cpu.features", cpuFeatures());
    70         map.put("vm.cpu.features", cpuFeatures());
    70         map.put("vm.rtm.cpu", vmRTMCPU());
    71         map.put("vm.rtm.cpu", vmRTMCPU());
    71         map.put("vm.rtm.os", vmRTMOS());
    72         map.put("vm.rtm.os", vmRTMOS());
       
    73         map.put("vm.aot", vmAOT());
    72         vmGC(map); // vm.gc.X = true/false
    74         vmGC(map); // vm.gc.X = true/false
    73 
    75 
    74         VMProps.dump(map);
    76         VMProps.dump(map);
    75         return map;
    77         return map;
    76     }
    78     }
   237 
   239 
   238         return "" + vmRTMCPU;
   240         return "" + vmRTMCPU;
   239     }
   241     }
   240 
   242 
   241     /**
   243     /**
       
   244      * @return true if VM supports AOT and false otherwise
       
   245      */
       
   246     protected String vmAOT() {
       
   247         // builds with aot have jaotc in <JDK>/bin
       
   248         Path bin = Paths.get(System.getProperty("java.home"))
       
   249                         .resolve("bin");
       
   250         Path jaotc;
       
   251         if (Platform.isWindows()) {
       
   252             jaotc = bin.resolve("jaotc.exe");
       
   253         } else {
       
   254             jaotc = bin.resolve("jaotc");
       
   255         }
       
   256         return "" + Files.exists(jaotc);
       
   257     }
       
   258 
       
   259     /**
   242      * Dumps the map to the file if the file name is given as the property.
   260      * Dumps the map to the file if the file name is given as the property.
   243      * This functionality could be helpful to know context in the real
   261      * This functionality could be helpful to know context in the real
   244      * execution.
   262      * execution.
   245      *
   263      *
   246      * @param map
   264      * @param map