comparison test/compiler/whitebox/MakeMethodNotCompilableTest.java @ 18058:54bc75c144b0

Merge
author asaha
date Thu, 29 May 2014 13:14:25 -0700
parents d559dbbded7a
children 92aa6797d639 52b4284cb496 c88a4554854c
comparison
equal deleted inserted replaced
18055:1fa005fb28f5 18058:54bc75c144b0
1 /* 1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
25 * @test MakeMethodNotCompilableTest 25 * @test MakeMethodNotCompilableTest
26 * @bug 8012322 8006683 8007288 8022832 26 * @bug 8012322 8006683 8007288 8022832
27 * @library /testlibrary /testlibrary/whitebox 27 * @library /testlibrary /testlibrary/whitebox
28 * @build MakeMethodNotCompilableTest 28 * @build MakeMethodNotCompilableTest
29 * @run main ClassFileInstaller sun.hotspot.WhiteBox 29 * @run main ClassFileInstaller sun.hotspot.WhiteBox
30 * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* MakeMethodNotCompilableTest 30 * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest
31 * @summary testing of WB::makeMethodNotCompilable() 31 * @summary testing of WB::makeMethodNotCompilable()
32 * @author igor.ignatyev@oracle.com 32 * @author igor.ignatyev@oracle.com
33 */ 33 */
34 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { 34 public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
35 private int bci; 35 private int bci;
36 public static void main(String[] args) throws Exception { 36 public static void main(String[] args) throws Exception {
37 if (args.length == 0) { 37 CompilerWhiteBoxTest.main(MakeMethodNotCompilableTest::new, args);
38 for (TestCase test : TestCase.values()) { 38 }
39 new MakeMethodNotCompilableTest(test).runTest(); 39
40 } 40 private MakeMethodNotCompilableTest(TestCase testCase) {
41 } else {
42 for (String name : args) {
43 new MakeMethodNotCompilableTest(
44 TestCase.valueOf(name)).runTest();
45 }
46 }
47 }
48
49 public MakeMethodNotCompilableTest(TestCase testCase) {
50 super(testCase); 41 super(testCase);
51 // to prevent inlining of #method 42 // to prevent inlining of #method
52 WHITE_BOX.testSetDontInlineMethod(method, true); 43 WHITE_BOX.testSetDontInlineMethod(method, true);
53 } 44 }
54 45
60 * 51 *
61 * @throws Exception if one of the checks fails. 52 * @throws Exception if one of the checks fails.
62 */ 53 */
63 @Override 54 @Override
64 protected void test() throws Exception { 55 protected void test() throws Exception {
65 if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( 56 if (skipXcompOSR()) {
66 "compiled ")) { 57 return;
67 System.err.printf("Warning: %s is not applicable in %s%n",
68 testCase.name(), CompilerWhiteBoxTest.MODE);
69 return;
70 } 58 }
71 checkNotCompiled(); 59 checkNotCompiled();
72 if (!isCompilable()) { 60 if (!isCompilable()) {
73 throw new RuntimeException(method + " must be compilable"); 61 throw new RuntimeException(method + " must be compilable");
74 } 62 }