changeset 1928:c52c42c98ca1

8066599: Add methods to check VM mode to c.o.j.t.Platform Reviewed-by: iignatyev
author fzhinkin
date Tue, 22 Dec 2015 10:18:55 +0300
parents f130c05c3afa
children c6fb1b62c8cd
files test/lib/share/classes/jdk/test/lib/Platform.java
diffstat 1 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/lib/share/classes/jdk/test/lib/Platform.java	Fri Jan 15 09:13:02 2016 +0100
+++ b/test/lib/share/classes/jdk/test/lib/Platform.java	Tue Dec 22 10:18:55 2015 +0300
@@ -34,6 +34,7 @@
     private static final String vmName      = System.getProperty("java.vm.name");
     private static final String userName    = System.getProperty("user.name");
     private static final String compiler    = System.getProperty("sun.management.compiler");
+    private static final String vmInfo      = System.getProperty("java.vm.info");
 
     public static boolean isClient() {
         return vmName.endsWith(" Client VM");
@@ -63,6 +64,18 @@
         return compiler.contains("Tiered Compilers");
     }
 
+    public static boolean isInt() {
+        return vmInfo.contains("interpreted");
+    }
+
+    public static boolean isMixed() {
+        return vmInfo.contains("mixed");
+    }
+
+    public static boolean isComp() {
+        return vmInfo.contains("compiled");
+    }
+
     public static boolean is32bit() {
         return dataModel.equals("32");
     }
@@ -135,12 +148,6 @@
         return isArch("aarch64");
     }
 
-    private static boolean isArch(String archnameRE) {
-        return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
-                .matcher(osArch)
-                .matches();
-    }
-
     public static String getOsArch() {
         return osArch;
     }
@@ -203,4 +210,10 @@
     public static boolean canAttachOSX() throws Exception {
         return userName.equals("root");
     }
+
+    private static boolean isArch(String archnameRE) {
+        return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
+                      .matcher(osArch)
+                      .matches();
+    }
 }