test/compiler/tiered/TieredLevelsTest.java

changeset 9689
89dcef434423
parent 6353
d559dbbded7a
child 9703
2fdf635bcf28
equal deleted inserted replaced
9688:54e5e3c816d4 9689:89dcef434423
32 * TieredLevelsTest 32 * TieredLevelsTest
33 * @summary Verify that all levels < 'TieredStopAtLevel' can be used 33 * @summary Verify that all levels < 'TieredStopAtLevel' can be used
34 * @author igor.ignatyev@oracle.com 34 * @author igor.ignatyev@oracle.com
35 */ 35 */
36 public class TieredLevelsTest extends CompLevelsTest { 36 public class TieredLevelsTest extends CompLevelsTest {
37 public static void main(String[] args) throws Exception { 37 public static void main(String[] args) throws Exception, Throwable {
38 if (!TIERED_COMPILATION) { 38 if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
39 System.err.println("Test isn't applicable w/ disabled "
40 + "TieredCompilation. Skip test.");
41 return; 39 return;
42 } 40 }
43 CompilerWhiteBoxTest.main(TieredLevelsTest::new, args); 41 CompilerWhiteBoxTest.main(TieredLevelsTest::new, args);
44 } 42 }
45 43
46 private TieredLevelsTest(TestCase testCase) { 44 protected TieredLevelsTest(TestCase testCase) {
47 super(testCase); 45 super(testCase);
48 // to prevent inlining of #method 46 // to prevent inlining of #method
49 WHITE_BOX.testSetDontInlineMethod(method, true); 47 WHITE_BOX.testSetDontInlineMethod(method, true);
50 } 48 }
51 49
74 testedTier <= COMP_LEVEL_MAX; ++testedTier) { 72 testedTier <= COMP_LEVEL_MAX; ++testedTier) {
75 testUnavailableLevel(testedTier, bci); 73 testUnavailableLevel(testedTier, bci);
76 } 74 }
77 } 75 }
78 76
79
80 @Override 77 @Override
81 protected void checkLevel(int expected, int actual) { 78 protected void checkLevel(int expected, int actual) {
82 if (expected == COMP_LEVEL_FULL_PROFILE 79 if (expected == COMP_LEVEL_FULL_PROFILE
83 && actual == COMP_LEVEL_LIMITED_PROFILE) { 80 && actual == COMP_LEVEL_LIMITED_PROFILE) {
84 // for simple method full_profile may be replaced by limited_profile 81 // for simple method full_profile may be replaced by limited_profile
82 if (IS_VERBOSE) {
83 System.out.printf("Level check: full profiling was replaced "
84 + "by limited profiling. Expected: %d, actual:%d",
85 expected, actual);
86 }
85 return; 87 return;
86 } 88 }
87 super.checkLevel(expected, actual); 89 super.checkLevel(expected, actual);
88 } 90 }
89 } 91 }

mercurial