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 /**
26 * @test
27 * @bug 8149797
28 * @summary node replaced by dominating dead cast during parsing
29 * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=200 -XX:CompileCommand=dontinline,TestDominatingDeadCheckCast::not_inlined TestDominatingDeadCheckCast
30 *
31 */
32
33 public class TestDominatingDeadCheckCast {
34
35 static class A {
36 int f;
37 }
38
39 static class B extends A {
40 }
41
42 static A not_inlined() {
43 return new A();
44 }
45
46 static void inlined(A param) {
47 param.f = 42;
48 }
49
50 static A field;
51
52 static void test(boolean flag1, boolean flag2, boolean flag3, boolean flag4, boolean flag5) {
|
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 /**
26 * @test
27 * @bug 8149797
28 * @summary node replaced by dominating dead cast during parsing
29 *
30 * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation
31 * -XX:TypeProfileLevel=200
32 * -XX:CompileCommand=dontinline,compiler.c2.TestDominatingDeadCheckCast::not_inlined
33 * compiler.c2.TestDominatingDeadCheckCast
34 */
35
36 package compiler.c2;
37
38 public class TestDominatingDeadCheckCast {
39
40 static class A {
41 int f;
42 }
43
44 static class B extends A {
45 }
46
47 static A not_inlined() {
48 return new A();
49 }
50
51 static void inlined(A param) {
52 param.f = 42;
53 }
54
55 static A field;
56
57 static void test(boolean flag1, boolean flag2, boolean flag3, boolean flag4, boolean flag5) {
|