27 * @test EnqueueMethodForCompilationTest |
27 * @test EnqueueMethodForCompilationTest |
28 * @bug 8006683 8007288 8022832 |
28 * @bug 8006683 8007288 8022832 |
29 * @library /testlibrary /test/lib / |
29 * @library /testlibrary /test/lib / |
30 * @modules java.management |
30 * @modules java.management |
31 * @build EnqueueMethodForCompilationTest |
31 * @build EnqueueMethodForCompilationTest |
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
32 * @run driver ClassFileInstaller sun.hotspot.WhiteBox |
33 * sun.hotspot.WhiteBox$WhiteBoxPermission |
33 * sun.hotspot.WhiteBox$WhiteBoxPermission |
34 * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest |
34 * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay EnqueueMethodForCompilationTest |
35 * @summary testing of WB::enqueueMethodForCompilation() |
35 * @summary testing of WB::enqueueMethodForCompilation() |
36 * @author igor.ignatyev@oracle.com |
36 * @author igor.ignatyev@oracle.com |
37 */ |
37 */ |
38 public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { |
38 public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { |
39 |
39 |
40 public static void main(String[] args) throws Exception { |
40 public static void main(String[] args) throws Exception { |
41 String directive = |
41 String directive = |
42 "[{ match:\"*SimpleTestCase$Helper.*\", BackgroundCompilation: false }, " + |
42 "[{ match:\"*SimpleTestCaseHelper.*\", BackgroundCompilation: false }, " + |
43 " { match:\"*.*\", inline:\"-*SimpleTestCase$Helper.*\"}]"; |
43 " { match:\"*.*\", inline:\"-*SimpleTestCaseHelper.*\"}]"; |
44 if (WHITE_BOX.addCompilerDirective(directive) != 2) { |
44 if (WHITE_BOX.addCompilerDirective(directive) != 2) { |
45 throw new RuntimeException("Could not add directive"); |
45 throw new RuntimeException("Could not add directive"); |
46 } |
46 } |
47 try { |
47 try { |
48 CompilerWhiteBoxTest.main(EnqueueMethodForCompilationTest::new, args); |
48 CompilerWhiteBoxTest.main(EnqueueMethodForCompilationTest::new, args); |
84 int bci = WHITE_BOX.getMethodEntryBci(method); |
84 int bci = WHITE_BOX.getMethodEntryBci(method); |
85 deoptimize(); |
85 deoptimize(); |
86 checkNotCompiled(); |
86 checkNotCompiled(); |
87 WHITE_BOX.clearMethodState(method); |
87 WHITE_BOX.clearMethodState(method); |
88 |
88 |
89 WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci); |
89 if (!WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci)) { |
|
90 throw new RuntimeException(method |
|
91 + " could not be enqueued for compilation"); |
|
92 } |
90 checkCompiled(); |
93 checkCompiled(); |
91 deoptimize(); |
94 deoptimize(); |
92 checkNotCompiled(); |
95 checkNotCompiled(); |
93 |
96 |
94 compile(); |
97 compile(); |