hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
changeset 38025 5ed9ce1e4a2f
parent 36599 8dd1694c0480
child 38152 80e5da81fb2c
equal deleted inserted replaced
38023:5fcccfdea459 38025:5ed9ce1e4a2f
    27  * @test MakeMethodNotCompilableTest
    27  * @test MakeMethodNotCompilableTest
    28  * @bug 8012322 8006683 8007288 8022832
    28  * @bug 8012322 8006683 8007288 8022832
    29  * @library /testlibrary /test/lib /
    29  * @library /testlibrary /test/lib /
    30  * @modules java.management
    30  * @modules java.management
    31  * @build MakeMethodNotCompilableTest
    31  * @build MakeMethodNotCompilableTest
    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:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI  -Xmixed MakeMethodNotCompilableTest
    34  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay MakeMethodNotCompilableTest
    35  * @summary testing of WB::makeMethodNotCompilable()
    35  * @summary testing of WB::makeMethodNotCompilable()
    36  * @author igor.ignatyev@oracle.com
    36  * @author igor.ignatyev@oracle.com
    37  */
    37  */
    38 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
    38 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
    39     private int bci;
    39     private int bci;
    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(MakeMethodNotCompilableTest::new, args);
    48             CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args);
   225             return true;
   225             return true;
   226         }
   226         }
   227         return false;
   227         return false;
   228     }
   228     }
   229 
   229 
   230     private int getBci() {
   230     private int getBci() throws Exception {
   231         compile();
   231         compile();
   232         checkCompiled();
   232         checkCompiled();
   233         int result = WHITE_BOX.getMethodEntryBci(method);
   233         int result = WHITE_BOX.getMethodEntryBci(method);
   234         deoptimize();
   234         deoptimize();
   235         WHITE_BOX.clearMethodState(method);
   235         WHITE_BOX.clearMethodState(method);