annotate graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/EdgesTest.java @ 18120:86ec7f6f71b3

refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
author Doug Simon <doug.simon@oracle.com>
date Sat, 18 Oct 2014 00:08:19 +0200
parents 45b45f902bed
children c88ab4f1f04a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.replacements.test;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 import java.lang.reflect.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import org.junit.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.api.code.*;
18120
86ec7f6f71b3 refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents: 17450
diff changeset
30 import com.oracle.graal.api.meta.*;
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.compiler.test.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 import com.oracle.graal.graph.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33 import com.oracle.graal.graph.Edges.Type;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 import com.oracle.graal.nodeinfo.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.nodes.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 import com.oracle.graal.nodes.calc.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.nodes.java.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38 import com.oracle.graal.phases.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 import com.oracle.graal.phases.common.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40 import com.oracle.graal.phases.common.inlining.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41 import com.oracle.graal.phases.tiers.*;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43 public class EdgesTest extends GraalCompilerTest {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 @NodeInfo
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 static class TestNode extends Node {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 @Input NodeInputList<ValueNode> itail;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 @Input ConstantNode i1;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49 @Input FloatingNode i2;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51 public static TestNode create() {
17450
45b45f902bed removed Node generation (GRAAL-857)
Doug Simon <doug.simon@oracle.com>
parents: 17309
diff changeset
52 return new TestNode();
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 }
17309
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 17233
diff changeset
54
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 17233
diff changeset
55 protected TestNode() {
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 17233
diff changeset
56 // TODO Auto-generated constructor stub
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 17233
diff changeset
57 }
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 StructuredGraph graph = new StructuredGraph();
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 TestNode node;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 ConstantNode i1;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 ConstantNode i2;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 ConstantNode i3;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 ConstantNode i4;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 Edges inputs;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 public EdgesTest() {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
69 node = TestNode.create();
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 i1 = ConstantNode.forInt(1, graph);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 i2 = ConstantNode.forDouble(1.0d, graph);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 i3 = ConstantNode.forInt(4, graph);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 i4 = ConstantNode.forInt(14, graph);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74 node.itail = new NodeInputList<>(node, new ValueNode[]{i3, i4});
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 node.i1 = i1;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
76 node.i2 = i2;
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 graph.add(node);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 inputs = node.getNodeClass().getEdges(Type.Inputs);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81 /**
17233
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
82 * Checks that there are no checkcasts in the compiled version of
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
83 * {@link Edges#getNode(Node, int)}
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
84 */
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
85 @Test
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
86 public void test0() {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
87 testMethod(getMethod("getNode", Node.class, int.class), inputs, node, 0);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
88 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
89
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
90 /**
17233
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
91 * Checks that there are no checkcasts in the compiled version of
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
92 * {@link Edges#getNodeList(Node, int)}
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
93 */
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
94 @Test
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
95 public void test1() {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
96 testMethod(getMethod("getNodeList", Node.class, int.class), inputs, node, 2);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
97 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
98
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
99 /**
17233
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
100 * Checks that there are no checkcasts in the compiled version of
1278680407e7 moved intrinsifications for Edges back into EdgesSubstitutions
Doug Simon <doug.simon@oracle.com>
parents: 17231
diff changeset
101 * {@link Edges#setNode(Node, int, Node)}
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
102 */
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
103 @Test
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
104 public void test2() {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
105 testMethod(getMethod("setNode", Node.class, int.class, Node.class), inputs, node, 1, i2);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
106 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
107
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
108 private void testMethod(Method method, Object receiver, Object... args) {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
109 try {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
110 // Invoke the method to ensure it has a type profile
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
111 for (int i = 0; i < 5000; i++) {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
112 method.invoke(receiver, args);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
113 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
114 } catch (Exception e) {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
115 throw new RuntimeException(e);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
116 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
117
18120
86ec7f6f71b3 refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents: 17450
diff changeset
118 ResolvedJavaMethod javaMethod = getMetaAccess().lookupJavaMethod(method);
86ec7f6f71b3 refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents: 17450
diff changeset
119 StructuredGraph g = parseProfiled(javaMethod);
17231
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
120 Assumptions assumptions = new Assumptions(false);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
121 HighTierContext context = new HighTierContext(getProviders(), assumptions, null, getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
122 new InliningPhase(new CanonicalizerPhase(true)).apply(g, context);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
123 new CanonicalizerPhase(false).apply(g, context);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
124 Assert.assertTrue(g.getNodes().filter(CheckCastNode.class).isEmpty());
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
125 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
126
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
127 private static Method getMethod(final String name, Class<?>... parameters) {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
128 try {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
129 return Edges.class.getDeclaredMethod(name, parameters);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
130 } catch (NoSuchMethodException | SecurityException e) {
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
131 throw new RuntimeException(e);
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
132 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
133 }
58f1d1335ef4 force inline Fields.getObject(Object, int, Class) so that a constant value bound to its last parameter is connected with the DeferredPiNode used in Fields.getObject(Object, long, Class)
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
134 }