Mercurial > hg > truffle
comparison test/compiler/whitebox/EnqueueMethodForCompilationTest.java @ 10143:c4af77d20454 hs25-b30
Merge
author | amurillo |
---|---|
date | Fri, 26 Apr 2013 00:29:11 -0700 |
parents | 4b2eebe03f93 |
children | 11237ee74aae |
comparison
equal
deleted
inserted
replaced
10124:d080f5168deb | 10143:c4af77d20454 |
---|---|
25 * @test EnqueueMethodForCompilationTest | 25 * @test EnqueueMethodForCompilationTest |
26 * @library /testlibrary /testlibrary/whitebox | 26 * @library /testlibrary /testlibrary/whitebox |
27 * @build EnqueueMethodForCompilationTest | 27 * @build EnqueueMethodForCompilationTest |
28 * @run main ClassFileInstaller sun.hotspot.WhiteBox | 28 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
29 * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest | 29 * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest |
30 * @summary testing of WB::enqueueMethodForCompilation() | |
30 * @author igor.ignatyev@oracle.com | 31 * @author igor.ignatyev@oracle.com |
31 */ | 32 */ |
32 public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { | 33 public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { |
34 | |
33 public static void main(String[] args) throws Exception { | 35 public static void main(String[] args) throws Exception { |
34 // to prevent inlining #method into #compile() | 36 for (TestCase test : TestCase.values()) { |
35 WHITE_BOX.testSetDontInlineMethod(METHOD, true); | 37 new EnqueueMethodForCompilationTest(test).runTest(); |
36 new EnqueueMethodForCompilationTest().runTest(); | 38 } |
37 } | 39 } |
38 | 40 |
41 public EnqueueMethodForCompilationTest(TestCase testCase) { | |
42 super(testCase); | |
43 // to prevent inlining of #method | |
44 WHITE_BOX.testSetDontInlineMethod(method, true); | |
45 } | |
46 | |
47 @Override | |
39 protected void test() throws Exception { | 48 protected void test() throws Exception { |
40 checkNotCompiled(METHOD); | 49 checkNotCompiled(); |
41 | 50 |
42 WHITE_BOX.enqueueMethodForCompilation(METHOD, 0); | 51 // method can not be compiled on level 'none' |
43 if (WHITE_BOX.isMethodCompilable(METHOD, 0)) { | 52 WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_NONE); |
44 throw new RuntimeException(METHOD + " is compilable at level 0"); | 53 if (WHITE_BOX.isMethodCompilable(method, COMP_LEVEL_NONE)) { |
54 throw new RuntimeException(method | |
55 + " is compilable at level COMP_LEVEL_NONE"); | |
45 } | 56 } |
46 checkNotCompiled(METHOD); | 57 checkNotCompiled(); |
47 | 58 |
48 WHITE_BOX.enqueueMethodForCompilation(METHOD, -1); | 59 // COMP_LEVEL_ANY is inapplicable as level for compilation |
49 checkNotCompiled(METHOD); | 60 WHITE_BOX.enqueueMethodForCompilation(method, COMP_LEVEL_ANY); |
61 checkNotCompiled(); | |
50 | 62 |
51 WHITE_BOX.enqueueMethodForCompilation(METHOD, 5); | 63 WHITE_BOX.enqueueMethodForCompilation(method, 5); |
52 if (!WHITE_BOX.isMethodCompilable(METHOD, 5)) { | 64 if (!WHITE_BOX.isMethodCompilable(method, 5)) { |
53 checkNotCompiled(METHOD); | 65 checkNotCompiled(); |
54 compile(); | 66 compile(); |
55 checkCompiled(METHOD); | 67 checkCompiled(); |
56 } else { | 68 } else { |
57 checkCompiled(METHOD); | 69 checkCompiled(); |
58 } | 70 } |
59 | 71 |
60 int compLevel = WHITE_BOX.getMethodCompilationLevel(METHOD); | 72 int compLevel = WHITE_BOX.getMethodCompilationLevel(method); |
61 WHITE_BOX.deoptimizeMethod(METHOD); | 73 WHITE_BOX.deoptimizeMethod(method); |
62 checkNotCompiled(METHOD); | 74 checkNotCompiled(); |
63 | 75 |
64 WHITE_BOX.enqueueMethodForCompilation(METHOD, compLevel); | 76 WHITE_BOX.enqueueMethodForCompilation(method, compLevel); |
65 checkCompiled(METHOD); | 77 checkCompiled(); |
66 WHITE_BOX.deoptimizeMethod(METHOD); | 78 WHITE_BOX.deoptimizeMethod(method); |
67 checkNotCompiled(METHOD); | 79 checkNotCompiled(); |
68 | 80 |
69 compile(); | 81 compile(); |
70 checkCompiled(METHOD); | 82 checkCompiled(); |
71 WHITE_BOX.deoptimizeMethod(METHOD); | 83 WHITE_BOX.deoptimizeMethod(method); |
72 checkNotCompiled(METHOD); | 84 checkNotCompiled(); |
73 } | 85 } |
74 } | 86 } |