hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
changeset 40067 db6c74a53556
parent 40059 c2304140ed64
child 42650 1f304d0c888b
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Thu Jul 14 08:33:08 2016 +0200
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Wed Jul 13 18:03:15 2016 +0300
@@ -23,6 +23,7 @@
 
 package compiler.whitebox;
 
+import jdk.test.lib.Platform;
 import sun.hotspot.WhiteBox;
 import sun.hotspot.code.NMethod;
 
@@ -33,6 +34,7 @@
 
 /**
  * Abstract class for WhiteBox testing of JIT.
+ * Depends on jdk.test.lib.Platform from testlibrary.
  *
  * @author igor.ignatyev@oracle.com
  */
@@ -75,8 +77,6 @@
     public static final int THRESHOLD;
     /** invocation count to trigger OSR compilation */
     protected static final long BACKEDGE_THRESHOLD;
-    /** Value of {@code java.vm.info} (interpreted|mixed|comp mode) */
-    protected static final String MODE = System.getProperty("java.vm.info");
 
     static {
         if (TIERED_COMPILATION) {
@@ -165,10 +165,8 @@
      * @see #test()
      */
     protected final void runTest() {
-        if (CompilerWhiteBoxTest.MODE.startsWith("interpreted ")) {
-            System.err.println(
-                    "Warning: test is not applicable in interpreted mode");
-            return;
+        if (Platform.isInt()) {
+            throw new Error("TESTBUG: test can not be run in interpreter");
         }
         System.out.println("at test's start:");
         printInfo();
@@ -431,11 +429,10 @@
      *          Xcomp, otherwise {@code false}
      */
     protected boolean skipXcompOSR() {
-        boolean result =  testCase.isOsr()
-                && CompilerWhiteBoxTest.MODE.startsWith("compiled ");
+        boolean result = testCase.isOsr() && Platform.isComp();
         if (result && IS_VERBOSE) {
             System.err.printf("Warning: %s is not applicable in %s%n",
-                    testCase.name(), CompilerWhiteBoxTest.MODE);
+                    testCase.name(), Platform.vmInfo);
         }
         return result;
     }