test/compiler/whitebox/DeoptimizeAllTest.java

changeset 4951
4b2eebe03f93
parent 4908
b84fd7d73702
child 5512
11237ee74aae
     1.1 --- a/test/compiler/whitebox/DeoptimizeAllTest.java	Tue Apr 16 10:37:16 2013 -0400
     1.2 +++ b/test/compiler/whitebox/DeoptimizeAllTest.java	Tue Apr 16 10:04:01 2013 -0700
     1.3 @@ -27,20 +27,34 @@
     1.4   * @build DeoptimizeAllTest
     1.5   * @run main ClassFileInstaller sun.hotspot.WhiteBox
     1.6   * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeAllTest
     1.7 + * @summary testing of WB::deoptimizeAll()
     1.8   * @author igor.ignatyev@oracle.com
     1.9   */
    1.10  public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
    1.11  
    1.12      public static void main(String[] args) throws Exception {
    1.13 -        // to prevent inlining #method into #compile()
    1.14 -        WHITE_BOX.testSetDontInlineMethod(METHOD, true);
    1.15 -        new DeoptimizeAllTest().runTest();
    1.16 +        for (TestCase test : TestCase.values()) {
    1.17 +            new DeoptimizeAllTest(test).runTest();
    1.18 +        }
    1.19      }
    1.20  
    1.21 +    public DeoptimizeAllTest(TestCase testCase) {
    1.22 +        super(testCase);
    1.23 +        // to prevent inlining of #method
    1.24 +        WHITE_BOX.testSetDontInlineMethod(method, true);
    1.25 +    }
    1.26 +
    1.27 +    /**
    1.28 +     * Tests {@code WB::deoptimizeAll()} by calling it after
    1.29 +     * compilation and checking that method isn't compiled.
    1.30 +     *
    1.31 +     * @throws Exception if one of the checks fails.
    1.32 +     */
    1.33 +    @Override
    1.34      protected void test() throws Exception {
    1.35          compile();
    1.36 -        checkCompiled(METHOD);
    1.37 +        checkCompiled();
    1.38          WHITE_BOX.deoptimizeAll();
    1.39 -        checkNotCompiled(METHOD);
    1.40 +        checkNotCompiled();
    1.41      }
    1.42  }

mercurial