25 * @test MakeMethodNotCompilableTest |
25 * @test MakeMethodNotCompilableTest |
26 * @bug 8012322 8006683 8007288 8022832 |
26 * @bug 8012322 8006683 8007288 8022832 |
27 * @library /testlibrary /testlibrary/whitebox |
27 * @library /testlibrary /testlibrary/whitebox |
28 * @build MakeMethodNotCompilableTest |
28 * @build MakeMethodNotCompilableTest |
29 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
29 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
30 * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* MakeMethodNotCompilableTest |
30 * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest |
31 * @summary testing of WB::makeMethodNotCompilable() |
31 * @summary testing of WB::makeMethodNotCompilable() |
32 * @author igor.ignatyev@oracle.com |
32 * @author igor.ignatyev@oracle.com |
33 */ |
33 */ |
34 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { |
34 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { |
35 private int bci; |
35 private int bci; |
36 public static void main(String[] args) throws Exception { |
36 public static void main(String[] args) throws Exception { |
37 if (args.length == 0) { |
37 CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args); |
38 for (TestCase test : TestCase.values()) { |
38 } |
39 new MakeMethodNotCompilableTest(test).runTest(); |
39 |
40 } |
40 private MakeMethodNotCompilableTest(TestCase testCase) { |
41 } else { |
|
42 for (String name : args) { |
|
43 new MakeMethodNotCompilableTest( |
|
44 TestCase.valueOf(name)).runTest(); |
|
45 } |
|
46 } |
|
47 } |
|
48 |
|
49 public MakeMethodNotCompilableTest(TestCase testCase) { |
|
50 super(testCase); |
41 super(testCase); |
51 // to prevent inlining of #method |
42 // to prevent inlining of #method |
52 WHITE_BOX.testSetDontInlineMethod(method, true); |
43 WHITE_BOX.testSetDontInlineMethod(method, true); |
53 } |
44 } |
54 |
45 |
60 * |
51 * |
61 * @throws Exception if one of the checks fails. |
52 * @throws Exception if one of the checks fails. |
62 */ |
53 */ |
63 @Override |
54 @Override |
64 protected void test() throws Exception { |
55 protected void test() throws Exception { |
65 if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( |
56 if (testCase.isOsr() && CompilerWhiteBoxTest.MODE.startsWith( |
66 "compiled ")) { |
57 "compiled ")) { |
67 System.err.printf("Warning: %s is not applicable in %s%n", |
58 System.err.printf("Warning: %s is not applicable in %s%n", |
68 testCase.name(), CompilerWhiteBoxTest.MODE); |
59 testCase.name(), CompilerWhiteBoxTest.MODE); |
69 return; |
60 return; |
70 } |
61 } |