test/compiler/whitebox/MakeMethodNotCompilableTest.java

Print this page




  29  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MakeMethodNotCompilableTest
  30  * @author igor.ignatyev@oracle.com
  31  */
  32 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
  33 
  34     public static void main(String[] args) throws Exception {
  35         // to prevent inlining #method into #compile()
  36         WHITE_BOX.setDontInlineMethod(METHOD, true);
  37         new MakeMethodNotCompilableTest().runTest();
  38     }
  39 
  40     protected void test() throws Exception  {
  41         if (!WHITE_BOX.isMethodCompilable(METHOD)) {
  42             throw new RuntimeException(METHOD + " must be compilable");
  43         }
  44         WHITE_BOX.makeMethodNotCompilable(METHOD);
  45         if (WHITE_BOX.isMethodCompilable(METHOD)) {
  46             throw new RuntimeException(METHOD + " must be not compilable");
  47         }
  48         compile();
  49         if (WHITE_BOX.isMethodQueuedForCompilation(METHOD)) {
  50             throw new RuntimeException(METHOD + " must not be in queue");
  51         }
  52         checkNotCompiled(METHOD);
  53         if (WHITE_BOX.isMethodCompilable(METHOD)) {
  54             throw new RuntimeException(METHOD + " must be not compilable");
  55         }
  56     }
  57 }


  29  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MakeMethodNotCompilableTest
  30  * @author igor.ignatyev@oracle.com
  31  */
  32 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
  33 
  34     public static void main(String[] args) throws Exception {
  35         // to prevent inlining #method into #compile()
  36         WHITE_BOX.setDontInlineMethod(METHOD, true);
  37         new MakeMethodNotCompilableTest().runTest();
  38     }
  39 
  40     protected void test() throws Exception  {
  41         if (!WHITE_BOX.isMethodCompilable(METHOD)) {
  42             throw new RuntimeException(METHOD + " must be compilable");
  43         }
  44         WHITE_BOX.makeMethodNotCompilable(METHOD);
  45         if (WHITE_BOX.isMethodCompilable(METHOD)) {
  46             throw new RuntimeException(METHOD + " must be not compilable");
  47         }
  48         compile();



  49         checkNotCompiled(METHOD);
  50         if (WHITE_BOX.isMethodCompilable(METHOD)) {
  51             throw new RuntimeException(METHOD + " must be not compilable");
  52         }
  53     }
  54 }