Mercurial > hg > truffle
comparison test/compiler/tiered/NonTieredLevelsTest.java @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 4ca6dc0799b6 2dfa56e10640 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
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. |
28 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox | 28 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox |
29 * @build NonTieredLevelsTest | 29 * @build NonTieredLevelsTest |
30 * @run main ClassFileInstaller sun.hotspot.WhiteBox | 30 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
31 * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation | 31 * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation |
32 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI | 32 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
33 * -XX:CompileCommand=compileonly,TestCase$Helper::* | 33 * -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* |
34 * NonTieredLevelsTest | 34 * NonTieredLevelsTest |
35 * @summary Verify that only one level can be used | 35 * @summary Verify that only one level can be used |
36 * @author igor.ignatyev@oracle.com | 36 * @author igor.ignatyev@oracle.com |
37 */ | 37 */ |
38 public class NonTieredLevelsTest extends CompLevelsTest { | 38 public class NonTieredLevelsTest extends CompLevelsTest { |
57 if (TIERED_COMPILATION) { | 57 if (TIERED_COMPILATION) { |
58 System.err.println("Test isn't applicable w/ enabled " | 58 System.err.println("Test isn't applicable w/ enabled " |
59 + "TieredCompilation. Skip test."); | 59 + "TieredCompilation. Skip test."); |
60 return; | 60 return; |
61 } | 61 } |
62 for (TestCase test : TestCase.values()) { | 62 CompilerWhiteBoxTest.main(NonTieredLevelsTest::new, args); |
63 new NonTieredLevelsTest(test).runTest(); | |
64 } | |
65 } | 63 } |
66 | 64 |
67 private NonTieredLevelsTest(TestCase testCase) { | 65 private NonTieredLevelsTest(TestCase testCase) { |
68 super(testCase); | 66 super(testCase); |
69 // to prevent inlining of #method | 67 // to prevent inlining of #method |
70 WHITE_BOX.testSetDontInlineMethod(method, true); | 68 WHITE_BOX.testSetDontInlineMethod(method, true); |
71 } | 69 } |
72 | 70 |
73 @Override | 71 @Override |
74 protected void test() throws Exception { | 72 protected void test() throws Exception { |
73 if (skipXcompOSR()) { | |
74 return; | |
75 } | |
75 checkNotCompiled(); | 76 checkNotCompiled(); |
76 compile(); | 77 compile(); |
77 checkCompiled(); | 78 checkCompiled(); |
78 | 79 |
79 int compLevel = getCompLevel(); | 80 int compLevel = getCompLevel(); |
80 checkLevel(AVAILABLE_COMP_LEVEL, compLevel); | 81 checkLevel(AVAILABLE_COMP_LEVEL, compLevel); |
81 int bci = WHITE_BOX.getMethodEntryBci(method); | 82 int bci = WHITE_BOX.getMethodEntryBci(method); |
82 deoptimize(); | 83 deoptimize(); |
83 if (!testCase.isOsr) { | 84 if (!testCase.isOsr()) { |
84 for (int level = 1; level <= COMP_LEVEL_MAX; ++level) { | 85 for (int level = 1; level <= COMP_LEVEL_MAX; ++level) { |
85 if (IS_AVAILABLE_COMPLEVEL.test(level)) { | 86 if (IS_AVAILABLE_COMPLEVEL.test(level)) { |
86 testAvailableLevel(level, bci); | 87 testAvailableLevel(level, bci); |
87 } else { | 88 } else { |
88 testUnavailableLevel(level, bci); | 89 testUnavailableLevel(level, bci); |
92 System.out.println("skip other levels testing in OSR"); | 93 System.out.println("skip other levels testing in OSR"); |
93 testAvailableLevel(AVAILABLE_COMP_LEVEL, bci); | 94 testAvailableLevel(AVAILABLE_COMP_LEVEL, bci); |
94 } | 95 } |
95 } | 96 } |
96 } | 97 } |
98 |