Mercurial > hg > truffle
annotate test/compiler/8002069/Test8002069.java @ 14466:d166675568f6
8034761: Remove the do_code_roots parameter from process_strong_roots
Reviewed-by: tschatzl, mgerdin, jmasa
author | stefank |
---|---|
date | Thu, 13 Feb 2014 17:44:39 +0100 |
parents | f3da5ff1514c |
children |
rev | line source |
---|---|
6944
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
1 /* |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
4 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
8 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
13 * accompanied this code). |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
14 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
18 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
21 * questions. |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
22 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
23 */ |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
24 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
25 /** |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
26 * @test |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
27 * @bug 8002069 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
28 * @summary Assert failed in C2: assert(field->edge_count() > 0) failed: sanity |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
29 * |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
30 * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:CompileCommand=exclude,Test8002069.dummy Test8002069 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
31 */ |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
32 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
33 abstract class O { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
34 int f; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
35 public O() { f = 5; } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
36 abstract void put(int i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
37 public int foo(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
38 put(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
39 return i; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
40 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
41 }; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
42 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
43 class A extends O { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
44 int[] a; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
45 public A(int s) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
46 a = new int[s]; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
47 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
48 public void put(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
49 a[i%a.length] = i; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
50 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
51 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
52 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
53 class B extends O { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
54 int sz; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
55 int[] a; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
56 public B(int s) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
57 sz = s; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
58 a = new int[s]; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
59 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
60 public void put(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
61 a[i%sz] = i; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
62 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
63 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
64 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
65 public class Test8002069 { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
66 public static void main(String args[]) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
67 int sum = 0; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
68 for (int i=0; i<8000; i++) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
69 sum += test1(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
70 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
71 for (int i=0; i<100000; i++) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
72 sum += test2(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
73 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
74 System.out.println("PASSED. sum = " + sum); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
75 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
76 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
77 private O o; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
78 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
79 private int foo(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
80 return o.foo(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
81 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
82 static int test1(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
83 Test8002069 t = new Test8002069(); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
84 t.o = new A(5); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
85 return t.foo(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
86 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
87 static int test2(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
88 Test8002069 t = new Test8002069(); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
89 t.o = new B(5); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
90 dummy(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
91 return t.foo(i); |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
92 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
93 |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
94 static int dummy(int i) { |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
95 return i*2; |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
96 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
97 } |
f3da5ff1514c
8002069: Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
kvn
parents:
diff
changeset
|
98 |