1.1 --- a/test/compiler/whitebox/IsMethodCompilableTest.java Fri Aug 16 17:34:37 2013 +0400 1.2 +++ b/test/compiler/whitebox/IsMethodCompilableTest.java Wed Aug 14 23:50:23 2013 +0400 1.3 @@ -23,11 +23,11 @@ 1.4 1.5 /* 1.6 * @test IsMethodCompilableTest 1.7 - * @bug 8007270 1.8 + * @bug 8007270 8006683 8007288 8022832 1.9 * @library /testlibrary /testlibrary/whitebox 1.10 * @build IsMethodCompilableTest 1.11 * @run main ClassFileInstaller sun.hotspot.WhiteBox 1.12 - * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* IsMethodCompilableTest 1.13 + * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* IsMethodCompilableTest 1.14 * @summary testing of WB::isMethodCompilable() 1.15 * @author igor.ignatyev@oracle.com 1.16 */ 1.17 @@ -68,7 +68,7 @@ 1.18 */ 1.19 @Override 1.20 protected void test() throws Exception { 1.21 - if (!WHITE_BOX.isMethodCompilable(method)) { 1.22 + if (!isCompilable()) { 1.23 throw new RuntimeException(method + " must be compilable"); 1.24 } 1.25 System.out.println("PerMethodRecompilationCutoff = " 1.26 @@ -83,7 +83,8 @@ 1.27 for (long i = 0L, n = PER_METHOD_RECOMPILATION_CUTOFF - 1; i < n; ++i) { 1.28 compileAndDeoptimize(); 1.29 } 1.30 - if (!WHITE_BOX.isMethodCompilable(method)) { 1.31 + if (!testCase.isOsr && !isCompilable()) { 1.32 + // in osr test case count of deopt maybe more than iterations 1.33 throw new RuntimeException(method + " is not compilable after " 1.34 + (PER_METHOD_RECOMPILATION_CUTOFF - 1) + " iterations"); 1.35 } 1.36 @@ -92,15 +93,16 @@ 1.37 // deoptimize 'PerMethodRecompilationCutoff' + 1 times 1.38 long i; 1.39 for (i = 0L; i < PER_METHOD_RECOMPILATION_CUTOFF 1.40 - && WHITE_BOX.isMethodCompilable(method); ++i) { 1.41 + && isCompilable(); ++i) { 1.42 compileAndDeoptimize(); 1.43 } 1.44 - if (i != PER_METHOD_RECOMPILATION_CUTOFF) { 1.45 + if (!testCase.isOsr && i != PER_METHOD_RECOMPILATION_CUTOFF) { 1.46 + // in osr test case count of deopt maybe more than iterations 1.47 throw new RuntimeException(method + " is not compilable after " 1.48 + i + " iterations, but must only after " 1.49 + PER_METHOD_RECOMPILATION_CUTOFF); 1.50 } 1.51 - if (WHITE_BOX.isMethodCompilable(method)) { 1.52 + if (isCompilable()) { 1.53 throw new RuntimeException(method + " is still compilable after " 1.54 + PER_METHOD_RECOMPILATION_CUTOFF + " iterations"); 1.55 } 1.56 @@ -109,7 +111,7 @@ 1.57 1.58 // WB.clearMethodState() must reset no-compilable flags 1.59 WHITE_BOX.clearMethodState(method); 1.60 - if (!WHITE_BOX.isMethodCompilable(method)) { 1.61 + if (!isCompilable()) { 1.62 throw new RuntimeException(method 1.63 + " is not compilable after clearMethodState()"); 1.64 } 1.65 @@ -120,6 +122,6 @@ 1.66 private void compileAndDeoptimize() throws Exception { 1.67 compile(); 1.68 waitBackgroundCompilation(); 1.69 - WHITE_BOX.deoptimizeMethod(method); 1.70 + deoptimize(); 1.71 } 1.72 }