33 * @summary testing of WB::lock/unlockCompilation()
34 */
35
36 import java.io.OutputStream;
37 import java.io.PrintWriter;
38 import java.util.concurrent.BrokenBarrierException;
39 import java.util.concurrent.CyclicBarrier;
40
41 import compiler.whitebox.CompilerWhiteBoxTest;
42 import jdk.test.lib.Asserts;
43
44 public class LockCompilationTest extends CompilerWhiteBoxTest {
45
46 public static void main(String[] args) throws Exception {
47 // This case waits for 5 seconds and verifies that the method hasn't been
48 // compiled during that time. Only do that for one of the test cases.
49
50 // Only compile SimpleTestCase$Helper.method and exclude all other to ensure no
51 // contention on the compile queue causes problems.
52 String directive =
53 "[{ match:\"*SimpleTestCase$Helper.method\", Exclude:false}, " +
54 " { match:\"*.*\", Exclude:true}]";
55 if (WHITE_BOX.addCompilerDirective(directive) != 2) {
56 throw new RuntimeException("Could not add directive");
57 }
58 try {
59 CompilerWhiteBoxTest.main(LockCompilationTest::new, new String[] {"METHOD_TEST"});
60 } finally {
61 WHITE_BOX.removeCompilerDirective(2);
62 }
63
64 }
65
66 private LockCompilationTest(TestCase testCase) {
67 super(testCase);
68 // to prevent inlining of #method
69 WHITE_BOX.testSetDontInlineMethod(method, true);
70 }
71
72 protected void test() throws Exception {
73 checkNotCompiled();
|
33 * @summary testing of WB::lock/unlockCompilation()
34 */
35
36 import java.io.OutputStream;
37 import java.io.PrintWriter;
38 import java.util.concurrent.BrokenBarrierException;
39 import java.util.concurrent.CyclicBarrier;
40
41 import compiler.whitebox.CompilerWhiteBoxTest;
42 import jdk.test.lib.Asserts;
43
44 public class LockCompilationTest extends CompilerWhiteBoxTest {
45
46 public static void main(String[] args) throws Exception {
47 // This case waits for 5 seconds and verifies that the method hasn't been
48 // compiled during that time. Only do that for one of the test cases.
49
50 // Only compile SimpleTestCase$Helper.method and exclude all other to ensure no
51 // contention on the compile queue causes problems.
52 String directive =
53 "[{ match:\"*SimpleTestCaseHelper.method\", Exclude:false}, " +
54 " { match:\"*.*\", Exclude:true}]";
55 if (WHITE_BOX.addCompilerDirective(directive) != 2) {
56 throw new RuntimeException("Could not add directive");
57 }
58 try {
59 CompilerWhiteBoxTest.main(LockCompilationTest::new, new String[] {"METHOD_TEST"});
60 } finally {
61 WHITE_BOX.removeCompilerDirective(2);
62 }
63
64 }
65
66 private LockCompilationTest(TestCase testCase) {
67 super(testCase);
68 // to prevent inlining of #method
69 WHITE_BOX.testSetDontInlineMethod(method, true);
70 }
71
72 protected void test() throws Exception {
73 checkNotCompiled();
|