< prev index next >
test/jtreg-ext/requires/VMProps.java
Print this page
@@ -50,14 +50,36 @@
public Map<String, String> call() {
Map<String, String> map = new HashMap<>();
map.put("vm.flavor", vmFlavor());
map.put("vm.compMode", vmCompMode());
map.put("vm.bits", vmBits());
+ map.put("vm.arch", vmArch());
dump(map);
return map;
}
+
+ /**
+ * @return vm.arch value extracted from the "os.arch" property of tested JDK.
+ */
+ protected String vmArch() {
+ String arch = System.getProperty("os.arch");
+ if (arch.equals("x86_64") || arch.equals("amd64")) {
+ return "x64";
+ }
+ else if (arch.contains("86")) {
+ return "x86";
+ }
+ else if (arch.equals("aarch64")) {
+ return "arm64";
+ } else {
+ return arch;
+ }
+ }
+
+
+
/**
* @return VM type value extracted from the "java.vm.name" property.
*/
protected String vmFlavor() {
// E.g. "Java HotSpot(TM) 64-Bit Server VM"
< prev index next >