< prev index next >

test/compiler/whitebox/DeoptimizeFramesTest.java

Print this page




  29  * @build DeoptimizeFramesTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  33  *                   -XX:+WhiteBoxAPI -Xmixed
  34  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  35  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
  36  *                   DeoptimizeFramesTest true
  37  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  38  *                   -XX:+WhiteBoxAPI -Xmixed
  39  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  40  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
  41  *                   DeoptimizeFramesTest false
  42  * @summary testing of WB::deoptimizeFrames()
  43  */
  44 import java.lang.reflect.Executable;
  45 import java.util.concurrent.Callable;
  46 import java.util.concurrent.Phaser;
  47 
  48 import sun.hotspot.code.NMethod;
  49 import com.oracle.java.testlibrary.Asserts;
  50 import com.oracle.java.testlibrary.InfiniteLoop;
  51 
  52 public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
  53     private final boolean makeNotEntrant;
  54     private final Phaser phaser;
  55 
  56     private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
  57         super(new TestCaseImpl(phaser));
  58         // to prevent inlining of #method
  59         WHITE_BOX.testSetDontInlineMethod(method, true);
  60         this.makeNotEntrant = makeNotEntrant;
  61         this.phaser = phaser;
  62         System.out.printf("DeoptimizeFramesTest(makeNotEntrant = %b)%n",
  63                 makeNotEntrant);
  64     }
  65 
  66     public static void main(String[] args) throws Exception {
  67         Asserts.assertEQ(args.length, 1,
  68                 "[TESTBUG] args should contain 1 element");
  69         new DeoptimizeFramesTest(Boolean.valueOf(args[0]), new Phaser()).runTest();
  70     }




  29  * @build DeoptimizeFramesTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  33  *                   -XX:+WhiteBoxAPI -Xmixed
  34  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  35  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
  36  *                   DeoptimizeFramesTest true
  37  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  38  *                   -XX:+WhiteBoxAPI -Xmixed
  39  *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
  40  *                   -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot
  41  *                   DeoptimizeFramesTest false
  42  * @summary testing of WB::deoptimizeFrames()
  43  */
  44 import java.lang.reflect.Executable;
  45 import java.util.concurrent.Callable;
  46 import java.util.concurrent.Phaser;
  47 
  48 import sun.hotspot.code.NMethod;
  49 import jdk.test.lib.Asserts;
  50 import jdk.test.lib.InfiniteLoop;
  51 
  52 public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
  53     private final boolean makeNotEntrant;
  54     private final Phaser phaser;
  55 
  56     private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
  57         super(new TestCaseImpl(phaser));
  58         // to prevent inlining of #method
  59         WHITE_BOX.testSetDontInlineMethod(method, true);
  60         this.makeNotEntrant = makeNotEntrant;
  61         this.phaser = phaser;
  62         System.out.printf("DeoptimizeFramesTest(makeNotEntrant = %b)%n",
  63                 makeNotEntrant);
  64     }
  65 
  66     public static void main(String[] args) throws Exception {
  67         Asserts.assertEQ(args.length, 1,
  68                 "[TESTBUG] args should contain 1 element");
  69         new DeoptimizeFramesTest(Boolean.valueOf(args[0]), new Phaser()).runTest();
  70     }


< prev index next >