Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/TypeSystemTest.java @ 18969:14496953435e
Use Node#getUsageCount wherever possible.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 27 Jan 2015 13:17:53 +0100 |
parents | 2ad82c6147f1 |
children | a2cb19764970 |
rev | line source |
---|---|
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
1 /* |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
4 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
8 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
14 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
18 * |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
21 * questions. |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
22 */ |
6334
f8ba3bb81f6f
Renamed com.oracle.graal.tests project to com.oracle.graal.compiler.test
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5891
diff
changeset
|
23 package com.oracle.graal.compiler.test; |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
24 |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
25 import java.io.*; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
26 |
10088
9d0c16df0bc7
junit.framework package is deprecated
Andreas Woess <andreas.woess@jku.at>
parents:
9909
diff
changeset
|
27 import org.junit.*; |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
28 |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6587
diff
changeset
|
29 import com.oracle.graal.api.code.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.debug.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.graph.*; |
16841
cbd42807a31f
moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
32 import com.oracle.graal.nodeinfo.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
33 import com.oracle.graal.nodes.*; |
6529
2e96dc4eb8e2
renamed package: com.oracle.graal.lir.cfg -> com.oracle.graal.nodes.cfg
Doug Simon <doug.simon@oracle.com>
parents:
6526
diff
changeset
|
34 import com.oracle.graal.nodes.cfg.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
35 import com.oracle.graal.nodes.java.*; |
6526
ee651c726397
split phases out of graal.phases project into graal.phases.common project
Doug Simon <doug.simon@oracle.com>
parents:
6525
diff
changeset
|
36 import com.oracle.graal.phases.common.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6360
diff
changeset
|
37 import com.oracle.graal.phases.schedule.*; |
11568
ae27f6ac3374
Avoid direct usage of CanonicalizerPhase.Instance in tests.
Roland Schatz <roland.schatz@oracle.com>
parents:
10088
diff
changeset
|
38 import com.oracle.graal.phases.tiers.*; |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
39 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
40 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7123
diff
changeset
|
41 * In the following tests, the scalar type system of the compiler should be complete enough to see |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7123
diff
changeset
|
42 * the relation between the different conditions. |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
43 */ |
5565
0083a59ced84
Renaming GraphTest => GraalCompilerTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5425
diff
changeset
|
44 public class TypeSystemTest extends GraalCompilerTest { |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
45 |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
46 @Test |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
47 public void test3() { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
48 test("test3Snippet", "referenceSnippet3"); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
49 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
50 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
51 public static int referenceSnippet3(Object o) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
52 if (o == null) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
53 return 1; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
54 } else { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
55 return 2; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
56 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
57 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
58 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
59 @SuppressWarnings("unused") |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
60 public static int test3Snippet(Object o) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
61 if (o == null) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
62 if (o != null) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
63 return 3; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
64 } else { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
65 return 1; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
66 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
67 } else { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
68 return 2; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
69 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
70 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
71 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
72 @Test |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
73 public void test4() { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
74 test("test4Snippet", "referenceSnippet3"); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
75 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
76 |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
77 @SuppressWarnings("unused") |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
78 public static int test4Snippet(Object o) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
79 if (o == null) { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
80 Object o2 = Integer.class; |
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
81 if (o == o2) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
82 return 3; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
83 } else { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
84 return 1; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
85 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
86 } else { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
87 return 2; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
88 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
89 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
90 |
5891
fd8832ae511d
removed artifacts of defunct type system
Lukas Stadler <lukas.stadler@jku.at>
parents:
5565
diff
changeset
|
91 @Test |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
92 public void test5() { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
93 test("test5Snippet", "referenceSnippet5"); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
94 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
95 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
96 public static int referenceSnippet5(Object o, Object a) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
97 if (o == null) { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
98 if (a == Integer.class || a == Double.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
99 return 1; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
100 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
101 } else { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
102 if (a == Double.class || a == Long.class) { |
7706
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
103 return 11; |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
104 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
105 } |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
106 if (a == Integer.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
107 return 3; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
108 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
109 return 5; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
110 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
111 |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
112 @SuppressWarnings("unused") |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
113 public static int test5Snippet(Object o, Object a) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
114 if (o == null) { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
115 if (a == Integer.class || a == Double.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
116 if (a == null) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
117 return 10; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
118 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
119 return 1; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
120 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
121 } else { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
122 if (a == Double.class || a == Long.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
123 if (a != null) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
124 return 11; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
125 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
126 return 2; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
127 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
128 } |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
129 if (a == Integer.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
130 return 3; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
131 } |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
132 if (a == Double.class) { |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
133 return 4; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
134 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
135 return 5; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
136 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
137 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
138 @Test |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
139 public void test6() { |
11633
a0566c8dcabf
removed IterableNodeType from some classes for which typed node iterators were never used or were only used in tests
Doug Simon <doug.simon@oracle.com>
parents:
11631
diff
changeset
|
140 testHelper("test6Snippet", CheckCastNode.class); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
141 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
142 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
143 public static int test6Snippet(int i) throws IOException { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
144 Object o = null; |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
145 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
146 if (i == 5) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
147 o = new FileInputStream("asdf"); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
148 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
149 if (i < 10) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
150 o = new ByteArrayInputStream(new byte[]{1, 2, 3}); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
151 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
152 if (i > 0) { |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
153 o = new BufferedInputStream(null); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
154 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
155 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
156 return ((InputStream) o).available(); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
157 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
158 |
15572
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
159 @Test |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
160 public void test7() { |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
161 test("test7Snippet", "referenceSnippet7"); |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
162 } |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
163 |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
164 public static int test7Snippet(int x) { |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
165 return ((x & 0xff) << 10) == ((x & 0x1f) + 1) ? 0 : x; |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
166 } |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
167 |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
168 public static int referenceSnippet7(int x) { |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
169 return x; |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
170 } |
01bce59c2749
test for integer stamp join
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15388
diff
changeset
|
171 |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
172 private void test(String snippet, String referenceSnippet) { |
16714
1668de777c42
renamed GraalCompilerTest.parse to GraalCompilerTest.parseEager and improved javadoc for all parse* methods
Doug Simon <doug.simon@oracle.com>
parents:
15572
diff
changeset
|
173 StructuredGraph graph = parseEager(snippet); |
7706
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
174 Debug.dump(graph, "Graph"); |
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
175 Assumptions assumptions = new Assumptions(false); |
15388
769fc3629f59
Add phase FlowSensitiveReductionPhase.
Miguel Garcia <miguel.m.garcia@oracle.com>
parents:
13694
diff
changeset
|
176 /* |
769fc3629f59
Add phase FlowSensitiveReductionPhase.
Miguel Garcia <miguel.m.garcia@oracle.com>
parents:
13694
diff
changeset
|
177 * When using FlowSensitiveReductionPhase instead of ConditionalEliminationPhase, |
769fc3629f59
Add phase FlowSensitiveReductionPhase.
Miguel Garcia <miguel.m.garcia@oracle.com>
parents:
13694
diff
changeset
|
178 * tail-duplication gets activated thus resulting in a graph with more nodes than the |
769fc3629f59
Add phase FlowSensitiveReductionPhase.
Miguel Garcia <miguel.m.garcia@oracle.com>
parents:
13694
diff
changeset
|
179 * reference graph. |
769fc3629f59
Add phase FlowSensitiveReductionPhase.
Miguel Garcia <miguel.m.garcia@oracle.com>
parents:
13694
diff
changeset
|
180 */ |
18487
0f4813e0b4a9
Use asConstant() instead of asJavaConstant() where possible.
Roland Schatz <roland.schatz@oracle.com>
parents:
17064
diff
changeset
|
181 new ConditionalEliminationPhase().apply(graph, new PhaseContext(getProviders(), assumptions)); |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
182 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions)); |
7706
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
183 // a second canonicalizer is needed to process nested MaterializeNodes |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
184 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions)); |
16714
1668de777c42
renamed GraalCompilerTest.parse to GraalCompilerTest.parseEager and improved javadoc for all parse* methods
Doug Simon <doug.simon@oracle.com>
parents:
15572
diff
changeset
|
185 StructuredGraph referenceGraph = parseEager(referenceSnippet); |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
186 new CanonicalizerPhase(true).apply(referenceGraph, new PhaseContext(getProviders(), assumptions)); |
7706
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
187 assertEquals(referenceGraph, graph); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
188 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
189 |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
190 @Override |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
191 protected void assertEquals(StructuredGraph expected, StructuredGraph graph) { |
12573
6332050441eb
fixed tests that need to take into account ConstantNodes not recording their usages (GRAAL-508)
Doug Simon <doug.simon@oracle.com>
parents:
12054
diff
changeset
|
192 if (getNodeCountExcludingUnusedConstants(expected) != getNodeCountExcludingUnusedConstants(graph)) { |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
193 Debug.dump(expected, "expected (node count)"); |
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
194 Debug.dump(graph, "graph (node count)"); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
195 Assert.fail("Graphs do not have the same number of nodes: " + expected.getNodeCount() + " vs. " + graph.getNodeCount()); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
196 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
197 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
198 |
6360
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
199 public static void outputGraph(StructuredGraph graph, String message) { |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
200 TTY.println("========================= " + message); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
201 SchedulePhase schedule = new SchedulePhase(); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
202 schedule.apply(graph); |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
203 for (Block block : schedule.getCFG().getBlocks()) { |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
204 TTY.print("Block " + block + " "); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
205 if (block == schedule.getCFG().getStartBlock()) { |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
206 TTY.print("* "); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
207 } |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
208 TTY.print("-> "); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
209 for (Block succ : block.getSuccessors()) { |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
210 TTY.print(succ + " "); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
211 } |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
212 TTY.println(); |
5248
066f1687ba24
rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents:
5085
diff
changeset
|
213 for (Node node : schedule.getBlockToNodesMap().get(block)) { |
6360
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
214 outputNode(node); |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
215 } |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
216 } |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
217 } |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
218 |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
219 private static void outputNode(Node node) { |
18969
14496953435e
Use Node#getUsageCount wherever possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18940
diff
changeset
|
220 TTY.print(" " + node + " (usage count: " + node.getUsageCount() + ") (inputs:"); |
6360
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
221 for (Node input : node.inputs()) { |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
222 TTY.print(" " + input.toString(Verbosity.Id)); |
6360
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
223 } |
9109
23c96de53386
Change severity of checkstyle problems from "warning" to "error". Fixed several System.out.print violations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9049
diff
changeset
|
224 TTY.println(")"); |
6360
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
225 if (node instanceof MergeNode) { |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
226 for (PhiNode phi : ((MergeNode) node).phis()) { |
e5203e5843fc
first prototype of new PartialEscapeAnalysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
6334
diff
changeset
|
227 outputNode(phi); |
5085
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
228 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
229 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
230 } |
5bdaa08ba96b
add and enable new PropagateTypeCachePhase, add type system tests
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
231 |
11633
a0566c8dcabf
removed IterableNodeType from some classes for which typed node iterators were never used or were only used in tests
Doug Simon <doug.simon@oracle.com>
parents:
11631
diff
changeset
|
232 private <T extends Node> void testHelper(String snippet, Class<T> clazz) { |
16714
1668de777c42
renamed GraalCompilerTest.parse to GraalCompilerTest.parseEager and improved javadoc for all parse* methods
Doug Simon <doug.simon@oracle.com>
parents:
15572
diff
changeset
|
233 StructuredGraph graph = parseEager(snippet); |
7706
9ea26951d826
fix TypeSystemTest, cleanup of ConditionalEliminationPhase, handle ObjectEqualsNode and MaterializeNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
234 Assumptions assumptions = new Assumptions(false); |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
235 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions)); |
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
236 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), assumptions)); |
13694
0e8c22aa6ec3
adapt tests for new IfNode and MergeNode simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents:
12573
diff
changeset
|
237 Debug.dump(graph, "Graph " + snippet); |
11633
a0566c8dcabf
removed IterableNodeType from some classes for which typed node iterators were never used or were only used in tests
Doug Simon <doug.simon@oracle.com>
parents:
11631
diff
changeset
|
238 Assert.assertFalse("shouldn't have nodes of type " + clazz, graph.getNodes().filter(clazz).iterator().hasNext()); |
4648
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
239 } |
83b4cc4df77a
experimental: added PiNode and PropagateTypesPhase
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
240 } |