annotate graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java @ 19526:8fc336a04d77

Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Feb 2015 22:22:55 +0100
parents 2e91c189b0d8
children a4aa2116cfe0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
19396
7e2c87dae93e Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19384
diff changeset
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
11312
f0c8303cf88e Restructure Truffle API node intrinsics and introduce new intrinsics for type system modelling.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10484
diff changeset
23 package com.oracle.graal.truffle.nodes.frame;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 import com.oracle.graal.api.meta.*;
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
28 import com.oracle.graal.api.replacements.*;
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
29 import com.oracle.graal.api.runtime.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 15018
diff changeset
30 import com.oracle.graal.compiler.common.*;
15198
2c0cfbf454b5 Move LIRTypeTool and Stamp to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
31 import com.oracle.graal.compiler.common.type.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 import com.oracle.graal.graph.*;
11881
da9db8331658 moved Canonicalizable and Simplifiable to the com.oracle.graal.graph project (GRAAL-506)
Doug Simon <doug.simon@oracle.com>
parents: 11880
diff changeset
33 import com.oracle.graal.graph.spi.*;
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: 16822
diff changeset
34 import com.oracle.graal.nodeinfo.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.nodes.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 import com.oracle.graal.nodes.java.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.nodes.spi.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 import com.oracle.graal.nodes.util.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 import com.oracle.graal.nodes.virtual.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 import com.oracle.graal.truffle.*;
11312
f0c8303cf88e Restructure Truffle API node intrinsics and introduce new intrinsics for type system modelling.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10484
diff changeset
41 import com.oracle.graal.truffle.nodes.*;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 import com.oracle.truffle.api.frame.*;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 /**
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 * Intrinsic node representing the call for creating a frame in the {@link OptimizedCallTarget}
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 * class.
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 */
16822
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 15261
diff changeset
48 @NodeInfo
18998
ec0733b5a90a Allow final modifier on node subclasses and start adding the modifier to leaf classes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18937
diff changeset
49 public final class NewFrameNode extends FixedWithNextNode implements IterableNodeType, VirtualizableAllocation, Canonicalizable {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19437
diff changeset
51 public static final NodeClass<NewFrameNode> TYPE = NodeClass.create(NewFrameNode.class);
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
52 @Input ValueNode descriptor;
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
53 @Input ValueNode arguments;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
55 public NewFrameNode(Stamp stamp, ValueNode descriptor, ValueNode arguments) {
19396
7e2c87dae93e Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19384
diff changeset
56 super(TYPE, stamp);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 this.descriptor = descriptor;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 this.arguments = arguments;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
61 public NewFrameNode(ResolvedJavaType frameType, ValueNode descriptor, ValueNode arguments) {
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
62 this(StampFactory.exactNonNull(frameType), descriptor, arguments);
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
63 }
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
64
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 public ValueNode getDescriptor() {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 return descriptor;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 public ValueNode getArguments() {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 return arguments;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
73 private static SnippetReflectionProvider getSnippetReflection() {
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
74 /*
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
75 * This class requires access to the objects encapsulated in Constants, and therefore breaks
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
76 * the compiler-VM separation of object constants.
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
77 */
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
78 return Graal.getRequiredCapability(SnippetReflectionProvider.class);
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
79 }
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14991
diff changeset
80
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 private FrameDescriptor getConstantFrameDescriptor() {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 assert descriptor.isConstant() && !descriptor.isNullConstant();
18533
25a21e1794ec modified SnippetReflectionProvider to support both VM-side and compiler-side constants in a compilation replay context
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
83 return getSnippetReflection().asObject(FrameDescriptor.class, descriptor.asJavaConstant());
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 private int getFrameSize() {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 return getConstantFrameDescriptor().getSize();
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 private static ResolvedJavaField findField(ResolvedJavaField[] fields, String fieldName) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 for (ResolvedJavaField field : fields) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 if (field.getName().equals(fieldName)) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 return field;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 }
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
96 return null;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98
16898
Doug Simon <doug.simon@oracle.com>
parents: 16897 16869
diff changeset
99 @NodeInfo
18998
ec0733b5a90a Allow final modifier on node subclasses and start adding the modifier to leaf classes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18937
diff changeset
100 public static final class VirtualOnlyInstanceNode extends VirtualInstanceNode {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19437
diff changeset
102 public static final NodeClass<VirtualOnlyInstanceNode> TYPE = NodeClass.create(VirtualOnlyInstanceNode.class);
17276
ffb974bef674 moved Node valueNumber and valueEquals logic (optionally) to generated nodes
Doug Simon <doug.simon@oracle.com>
parents: 16919
diff changeset
103 protected boolean allowMaterialization;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
105 public VirtualOnlyInstanceNode(ResolvedJavaType type, ResolvedJavaField[] fields) {
19396
7e2c87dae93e Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19384
diff changeset
106 super(TYPE, type, fields, true);
16898
Doug Simon <doug.simon@oracle.com>
parents: 16897 16869
diff changeset
107 }
Doug Simon <doug.simon@oracle.com>
parents: 16897 16869
diff changeset
108
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 @Override
13554
83fd2094ff66 rework of monitorenter/exit (use MonitorIdNode)
Lukas Stadler <lukas.stadler@jku.at>
parents: 13206
diff changeset
110 public ValueNode getMaterializedRepresentation(FixedNode fixed, ValueNode[] entries, LockState locks) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
111 if (allowMaterialization) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 return super.getMaterializedRepresentation(fixed, entries, locks);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114 return getMaterializedRepresentationHelper(this, fixed);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
115 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117 public void setAllowMaterialization(boolean b) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118 this.allowMaterialization = b;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
119 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
120 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 public static ValueNode getMaterializedRepresentationHelper(VirtualObjectNode virtualNode, FixedNode fixed) {
16869
6754b5b64978 cover ForceMaterializeNode in NewFrameNode.getMaterializedRepresentationHelper()
Michael Haupt <michael.haupt@oracle.com>
parents: 16867
diff changeset
123 if (fixed instanceof MaterializeFrameNode || fixed instanceof AbstractEndNode || fixed instanceof ForceMaterializeNode) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124 // We need to conservatively assume that a materialization of a virtual frame can also
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125 // happen at a merge point.
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
126 return new AllocatedObjectNode(virtualNode);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
127 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 String escapeReason;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 if (fixed instanceof StoreFieldNode) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 escapeReason = "Must not store virtual frame object into a field.";
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131 } else if (fixed instanceof Invoke) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132 escapeReason = "Must not pass virtual frame object into an invoke that cannot be inlined.";
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
133 } else {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
134 escapeReason = "Must not let virtual frame object escape at node " + fixed + ".";
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
135 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 Throwable exception = new GraalInternalError(escapeReason +
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138 " Insert a call to VirtualFrame.materialize() to convert the instance to a materialized frame object (source position of following stack trace is approximate)");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 throw GraphUtil.approxSourceException(fixed, exception);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 @Override
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 public void virtualize(VirtualizerTool tool) {
13206
c2deb575483c do not attempt to virtualize NewFrame if frame descriptor is not constant.
Andreas Woess <andreas.woess@jku.at>
parents: 12556
diff changeset
144 if (!descriptor.isConstant()) {
c2deb575483c do not attempt to virtualize NewFrame if frame descriptor is not constant.
Andreas Woess <andreas.woess@jku.at>
parents: 12556
diff changeset
145 return;
c2deb575483c do not attempt to virtualize NewFrame if frame descriptor is not constant.
Andreas Woess <andreas.woess@jku.at>
parents: 12556
diff changeset
146 }
c2deb575483c do not attempt to virtualize NewFrame if frame descriptor is not constant.
Andreas Woess <andreas.woess@jku.at>
parents: 12556
diff changeset
147
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
148 int frameSize = getFrameSize();
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
149
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150 ResolvedJavaType frameType = stamp().javaType(tool.getMetaAccessProvider());
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151 ResolvedJavaField[] frameFields = frameType.getInstanceFields(true);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
152
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 ResolvedJavaField descriptorField = findField(frameFields, "descriptor");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154 ResolvedJavaField argumentsField = findField(frameFields, "arguments");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155 ResolvedJavaField localsField = findField(frameFields, "locals");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 ResolvedJavaField primitiveLocalsField = findField(frameFields, "primitiveLocals");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 ResolvedJavaField tagsField = findField(frameFields, "tags");
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
159 VirtualObjectNode virtualFrame = new VirtualOnlyInstanceNode(frameType, frameFields);
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 18533
diff changeset
160 VirtualObjectNode virtualFrameObjectArray = new VirtualArrayNode((ResolvedJavaType) localsField.getType().getComponentType(), frameSize);
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
161 VirtualObjectNode virtualFramePrimitiveArray = (primitiveLocalsField == null ? null : new VirtualArrayNode((ResolvedJavaType) primitiveLocalsField.getType().getComponentType(), frameSize));
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
162 VirtualObjectNode virtualFrameTagArray = (primitiveLocalsField == null ? null : new VirtualArrayNode((ResolvedJavaType) tagsField.getType().getComponentType(), frameSize));
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 ValueNode[] objectArrayEntryState = new ValueNode[frameSize];
18160
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
165 ValueNode[] primitiveArrayEntryState = new ValueNode[frameSize];
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166 ValueNode[] tagArrayEntryState = new ValueNode[frameSize];
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168 if (frameSize > 0) {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 FrameDescriptor frameDescriptor = getConstantFrameDescriptor();
18161
94f16a759646 Truffle: remove FrameTypeConversion interface
Andreas Woess <andreas.woess@jku.at>
parents: 18160
diff changeset
170 ConstantNode objectDefault = ConstantNode.forConstant(getSnippetReflection().forObject(frameDescriptor.getDefaultValue()), tool.getMetaAccessProvider(), graph());
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 ConstantNode tagDefault = ConstantNode.forByte((byte) 0, graph());
18109
b72ce1826bd0 Truffle: revert back to typed primitives, but make the primitive array an int[]
Andreas Woess <andreas.woess@jku.at>
parents: 17450
diff changeset
172 Arrays.fill(objectArrayEntryState, objectDefault);
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
173 if (virtualFrameTagArray != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
174 Arrays.fill(tagArrayEntryState, tagDefault);
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
175 }
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
176 if (virtualFramePrimitiveArray != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
177 for (int i = 0; i < frameSize; i++) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
178 primitiveArrayEntryState[i] = initialPrimitiveValue(frameDescriptor.getSlots().get(i).getKind());
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
179 }
18160
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
180 }
19250
8ab925a6f724 made Assumptions be part of a StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 18998
diff changeset
181 graph().getAssumptions().record(new AssumptionValidAssumption((OptimizedAssumption) frameDescriptor.getVersion()));
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
182 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
183
13554
83fd2094ff66 rework of monitorenter/exit (use MonitorIdNode)
Lukas Stadler <lukas.stadler@jku.at>
parents: 13206
diff changeset
184 tool.createVirtualObject(virtualFrameObjectArray, objectArrayEntryState, Collections.<MonitorIdNode> emptyList());
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
185 if (virtualFramePrimitiveArray != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
186 tool.createVirtualObject(virtualFramePrimitiveArray, primitiveArrayEntryState, Collections.<MonitorIdNode> emptyList());
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
187 }
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
188 if (virtualFrameTagArray != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
189 tool.createVirtualObject(virtualFrameTagArray, tagArrayEntryState, Collections.<MonitorIdNode> emptyList());
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
190 }
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
191
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
192 assert frameFields.length == 5 || frameFields.length == 3;
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
193 ValueNode[] frameEntryState = new ValueNode[frameFields.length];
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194 List<ResolvedJavaField> frameFieldList = Arrays.asList(frameFields);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195 frameEntryState[frameFieldList.indexOf(descriptorField)] = getDescriptor();
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
196 frameEntryState[frameFieldList.indexOf(argumentsField)] = getArguments();
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197 frameEntryState[frameFieldList.indexOf(localsField)] = virtualFrameObjectArray;
19384
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
198 if (primitiveLocalsField != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
199 frameEntryState[frameFieldList.indexOf(primitiveLocalsField)] = virtualFramePrimitiveArray;
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
200 }
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
201 if (tagsField != null) {
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
202 frameEntryState[frameFieldList.indexOf(tagsField)] = virtualFrameTagArray;
a1edf4524d84 Experiment with alternative frame implementation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19308
diff changeset
203 }
13571
1335577dc50c fix truffle compilation after monitorenter/exit changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 13554
diff changeset
204 tool.createVirtualObject(virtualFrame, frameEntryState, Collections.<MonitorIdNode> emptyList());
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 tool.replaceWithVirtual(virtualFrame);
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207
18160
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
208 private ValueNode initialPrimitiveValue(FrameSlotKind kind) {
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
209 Kind graalKind = null;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
210 switch (kind) {
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
211 case Boolean:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
212 case Byte:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
213 case Int:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
214 graalKind = Kind.Int;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
215 break;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
216 case Double:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
217 graalKind = Kind.Double;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
218 break;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
219 case Float:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
220 graalKind = Kind.Float;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
221 break;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
222 case Long:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
223 graalKind = Kind.Long;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
224 break;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
225 case Object:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
226 case Illegal:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
227 // won't be stored in the primitive array, so default to long
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
228 graalKind = Kind.Long;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
229 break;
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
230 default:
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
231 throw new IllegalStateException("Unexpected frame slot kind: " + kind);
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
232 }
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
233
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
234 return ConstantNode.defaultForKind(graalKind, graph());
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
235 }
30e03a7f9110 Truffle: revert to long[] in frame and initial value depending on frame slot kind
Andreas Woess <andreas.woess@jku.at>
parents: 18109
diff changeset
236
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
237 @Override
11880
9a747d8e0d0f broadened types in Canonicalizable interface so that it can be moved to the com.oracle.graal.graph project (GRAAL-506)
Doug Simon <doug.simon@oracle.com>
parents: 11710
diff changeset
238 public Node canonical(CanonicalizerTool tool) {
18937
ff232ff8d028 Add utility Node#hasNoUsages.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18847
diff changeset
239 if (hasNoUsages()) {
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 return null;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241 } else {
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
242 return this;
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
243 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
244 }
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
245
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
246 @NodeIntrinsic
19437
2e91c189b0d8 Introduce option TruffleUseFrameWithoutBoxing, default to true.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19403
diff changeset
247 public static native VirtualFrame allocate(@ConstantNodeParameter Class<? extends VirtualFrame> frameType, FrameDescriptor descriptor, Object[] args);
10484
0097fb11c16f Add basic version of Graal's Truffle runtime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
248 }