--- 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;
}