test/compiler/whitebox/MakeMethodNotCompilableTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff test/compiler/whitebox

test/compiler/whitebox/MakeMethodNotCompilableTest.java

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test MakeMethodNotCompilableTest
  26  * @bug 8012322 8006683 8007288 8022832
  27  * @library /testlibrary /testlibrary/whitebox
  28  * @ignore 8046268
  29  * @build MakeMethodNotCompilableTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest
  33  * @summary testing of WB::makeMethodNotCompilable()
  34  * @author igor.ignatyev@oracle.com
  35  */
  36 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
  37     private int bci;
  38     public static void main(String[] args) throws Exception {
  39         CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args);
  40     }
  41 
  42     private MakeMethodNotCompilableTest(TestCase testCase) {
  43         super(testCase);
  44         // to prevent inlining of #method
  45         WHITE_BOX.testSetDontInlineMethod(method, true);
  46     }
  47 
  48     /**


 123                         + " must be compilable at level " + compLevel
 124                         + ", even it is not compilable at opposite level ["
 125                         + compLevel + "]");
 126             }
 127         }
 128 
 129         // clearing after tiered/non-tiered tests
 130         // WB.clearMethodState() must reset no-compilable flags
 131         WHITE_BOX.clearMethodState(method);
 132         if (!isCompilable()) {
 133             throw new RuntimeException(method
 134                     + " is not compilable after clearMethodState()");
 135         }
 136 
 137         makeNotCompilable();
 138         if (isCompilable()) {
 139             throw new RuntimeException(method + " must be not compilable");
 140         }
 141 
 142         compile();
 143         checkNotCompiled();
 144         if (isCompilable()) {
 145             throw new RuntimeException(method + " must be not compilable");
 146         }
 147         // WB.clearMethodState() must reset no-compilable flags
 148         WHITE_BOX.clearMethodState(method);
 149         if (!isCompilable()) {
 150             throw new RuntimeException(method
 151                     + " is not compilable after clearMethodState()");
 152         }
 153         compile();
 154         checkCompiled();
 155     }
 156 
 157     // separately tests each tier
 158     private void testTier(int testedTier) {
 159         if (!isCompilable(testedTier)) {
 160             throw new RuntimeException(method
 161                     + " is not compilable on start");
 162         }
 163         makeNotCompilable(testedTier);




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test MakeMethodNotCompilableTest
  26  * @bug 8012322 8006683 8007288 8022832
  27  * @library /testlibrary /testlibrary/whitebox

  28  * @build MakeMethodNotCompilableTest
  29  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  30  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  31  * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest
  32  * @summary testing of WB::makeMethodNotCompilable()
  33  * @author igor.ignatyev@oracle.com
  34  */
  35 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
  36     private int bci;
  37     public static void main(String[] args) throws Exception {
  38         CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args);
  39     }
  40 
  41     private MakeMethodNotCompilableTest(TestCase testCase) {
  42         super(testCase);
  43         // to prevent inlining of #method
  44         WHITE_BOX.testSetDontInlineMethod(method, true);
  45     }
  46 
  47     /**


 122                         + " must be compilable at level " + compLevel
 123                         + ", even it is not compilable at opposite level ["
 124                         + compLevel + "]");
 125             }
 126         }
 127 
 128         // clearing after tiered/non-tiered tests
 129         // WB.clearMethodState() must reset no-compilable flags
 130         WHITE_BOX.clearMethodState(method);
 131         if (!isCompilable()) {
 132             throw new RuntimeException(method
 133                     + " is not compilable after clearMethodState()");
 134         }
 135 
 136         makeNotCompilable();
 137         if (isCompilable()) {
 138             throw new RuntimeException(method + " must be not compilable");
 139         }
 140 
 141         compile();
 142         checkNotOsrCompiled();
 143         if (isCompilable()) {
 144             throw new RuntimeException(method + " must be not compilable");
 145         }
 146         // WB.clearMethodState() must reset no-compilable flags
 147         WHITE_BOX.clearMethodState(method);
 148         if (!isCompilable()) {
 149             throw new RuntimeException(method
 150                     + " is not compilable after clearMethodState()");
 151         }
 152         compile();
 153         checkCompiled();
 154     }
 155 
 156     // separately tests each tier
 157     private void testTier(int testedTier) {
 158         if (!isCompilable(testedTier)) {
 159             throw new RuntimeException(method
 160                     + " is not compilable on start");
 161         }
 162         makeNotCompilable(testedTier);


test/compiler/whitebox/MakeMethodNotCompilableTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File