< prev index next >

test/compiler/whitebox/LockCompilationTest.java

Print this page




  21  * questions.
  22  */
  23 
  24 /*
  25  * @test LockCompilationTest
  26  * @bug 8059624
  27  * @library /testlibrary /../../test/lib
  28  * @modules java.management
  29  * @build LockCompilationTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* LockCompilationTest
  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 com.oracle.java.testlibrary.Asserts;
  42 
  43 public class LockCompilationTest extends CompilerWhiteBoxTest {
  44     public static void main(String[] args) throws Exception {
  45         CompilerWhiteBoxTest.main(LockCompilationTest::new, args);
  46     }
  47 
  48     private LockCompilationTest(TestCase testCase) {
  49         super(testCase);
  50         // to prevent inlining of #method
  51         WHITE_BOX.testSetDontInlineMethod(method, true);
  52     }
  53 
  54     protected void test() throws Exception {
  55         checkNotCompiled();
  56 
  57         System.out.println("locking compilation");
  58         WHITE_BOX.lockCompilation();
  59 
  60         try {
  61             System.out.println("trying to compile");




  21  * questions.
  22  */
  23 
  24 /*
  25  * @test LockCompilationTest
  26  * @bug 8059624
  27  * @library /testlibrary /../../test/lib
  28  * @modules java.management
  29  * @build LockCompilationTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* LockCompilationTest
  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 jdk.test.lib.Asserts;
  42 
  43 public class LockCompilationTest extends CompilerWhiteBoxTest {
  44     public static void main(String[] args) throws Exception {
  45         CompilerWhiteBoxTest.main(LockCompilationTest::new, args);
  46     }
  47 
  48     private LockCompilationTest(TestCase testCase) {
  49         super(testCase);
  50         // to prevent inlining of #method
  51         WHITE_BOX.testSetDontInlineMethod(method, true);
  52     }
  53 
  54     protected void test() throws Exception {
  55         checkNotCompiled();
  56 
  57         System.out.println("locking compilation");
  58         WHITE_BOX.lockCompilation();
  59 
  60         try {
  61             System.out.println("trying to compile");


< prev index next >