annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java @ 8956:74725f2f6122

Add a deoptState for invokes so that they can loose their stateAfter
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 09 Apr 2013 16:27:59 +0200
parents 2c0c708a0ad6
children 055d555d5378
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.nodes;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5504
diff changeset
27 import com.oracle.graal.api.meta.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
28 import com.oracle.graal.graph.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
29 import com.oracle.graal.nodes.extended.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
30 import com.oracle.graal.nodes.java.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
31 import com.oracle.graal.nodes.spi.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
32 import com.oracle.graal.nodes.util.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 * The {@code InvokeNode} represents all kinds of method calls.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 */
5814
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5813
diff changeset
37 @NodeInfo(nameTemplate = "Invoke#{p#targetMethod/s}")
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7392
diff changeset
38 public final class InvokeNode extends AbstractStateSplit implements StateSplit, Node.IterableNodeType, Invoke, LIRLowerable, MemoryCheckpoint {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
40 @Input private final CallTargetNode callTarget;
8956
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
41 @Input private FrameState deoptState;
5299
0ebd9cfdc11f removed @Data annotation
Lukas Stadler <lukas.stadler@jku.at>
parents: 5129
diff changeset
42 private final int bci;
7017
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
43 private boolean polymorphic;
4472
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
44 private boolean useForInlining;
7391
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
45 private double inliningRelevance;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 * Constructs a new Invoke instruction.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7392
diff changeset
49 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 * @param bci the bytecode index of the original invoke (used for debug infos)
5711
4d7175cf3526 enabled Eclipse/JDT javadoc checking and fixed resulting warnings
Doug Simon <doug.simon@oracle.com>
parents: 5580
diff changeset
51 * @param callTarget the target method being called
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 */
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7530
diff changeset
53 public InvokeNode(CallTargetNode callTarget, int bci) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 super(callTarget.returnStamp());
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 this.callTarget = callTarget;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56 this.bci = bci;
7017
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
57 this.polymorphic = false;
4472
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
58 this.useForInlining = true;
7391
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
59 this.inliningRelevance = Double.NaN;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
62 @Override
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
63 public CallTargetNode callTarget() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 return callTarget;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66
5003
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
67 @Override
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
68 public MethodCallTargetNode methodCallTarget() {
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
69 return (MethodCallTargetNode) callTarget;
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
70 }
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
71
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
72 @Override
7017
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
73 public boolean isPolymorphic() {
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
74 return polymorphic;
5003
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
75 }
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
76
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
77 @Override
7017
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
78 public void setPolymorphic(boolean value) {
70bff0fa64b1 Rename Invoke.isMegamorphic to isPolymorphic since it's what it is actually used for.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6546
diff changeset
79 this.polymorphic = value;
5003
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
80 }
5e6f1026a63e fixes to vtable stub inlining: compute offset on demand, look out for interface methods
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
81
4472
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
82 public boolean useForInlining() {
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
83 return useForInlining;
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
84 }
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
85
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
86 @Override
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
87 public void setUseForInlining(boolean value) {
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
88 this.useForInlining = value;
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
89 }
63cd21fda79b hotspot gc bugfix, added possibility to fallback to invocation if type check is violated
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4310
diff changeset
90
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 @Override
7391
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
92 public double inliningRelevance() {
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
93 return inliningRelevance;
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
94 }
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
95
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
96 @Override
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
97 public void setInliningRelevance(double value) {
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
98 inliningRelevance = value;
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
99 }
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
100
36dafe48bc38 added relevance-based inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
101 @Override
5813
3b8bc07f8d17 Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5719
diff changeset
102 public Map<Object, Object> getDebugProperties(Map<Object, Object> map) {
3b8bc07f8d17 Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5719
diff changeset
103 Map<Object, Object> debugProperties = super.getDebugProperties(map);
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
104 if (callTarget instanceof MethodCallTargetNode && methodCallTarget().targetMethod() != null) {
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
105 debugProperties.put("targetMethod", methodCallTarget().targetMethod());
7324
9214756f9bbf Fix display of lowered invokes in visualizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7098
diff changeset
106 } else if (callTarget instanceof AbstractCallTargetNode) {
9214756f9bbf Fix display of lowered invokes in visualizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7098
diff changeset
107 debugProperties.put("targetMethod", ((AbstractCallTargetNode) callTarget).target());
4614
a3882fd1ae61 Make it possible to have multiple LoopEnds per LoopBegin
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4547
diff changeset
108 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 return debugProperties;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
110 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
111
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 @Override
8394
7aefc149c471 allow multiple identities in MemoryCheckpoint interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 7864
diff changeset
113 public Object[] getLocationIdentities() {
7aefc149c471 allow multiple identities in MemoryCheckpoint interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 7864
diff changeset
114 return new Object[]{LocationNode.ANY_LOCATION};
7864
b66a826acf4b add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents: 7660
diff changeset
115 }
b66a826acf4b add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents: 7660
diff changeset
116
b66a826acf4b add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents: 7660
diff changeset
117 @Override
5802
93f6ad9a0596 added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents: 5719
diff changeset
118 public void lower(LoweringTool tool) {
5822
ec65d0d0c873 moved HIR lowering of Invokes into HotspotRuntime
Doug Simon <doug.simon@oracle.com>
parents: 5816
diff changeset
119 tool.getRuntime().lower(this, tool);
5802
93f6ad9a0596 added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents: 5719
diff changeset
120 }
93f6ad9a0596 added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents: 5719
diff changeset
121
93f6ad9a0596 added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents: 5719
diff changeset
122 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
123 public void generate(LIRGeneratorTool gen) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124 gen.emitInvoke(this);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
126
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
127 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 public String toString(Verbosity verbosity) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 if (verbosity == Verbosity.Long) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 return super.toString(Verbosity.Short) + "(bci=" + bci() + ")";
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131 } else if (verbosity == Verbosity.Name) {
6546
79119bd2505a Call target can be null, so don't crash debug printer
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6439
diff changeset
132 return "Invoke#" + (callTarget == null ? "null" : callTarget().targetName());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
133 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
134 return super.toString(verbosity);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
135 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138 public int bci() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 return bci;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 public FixedNode node() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
144 return this;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
146
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
148 public FrameState stateDuring() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
149 FrameState stateAfter = stateAfter();
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
150 FrameState stateDuring = stateAfter.duplicateModified(bci(), stateAfter.rethrowException(), kind());
4678
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4653
diff changeset
151 stateDuring.setDuringCall(true);
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4653
diff changeset
152 return stateDuring;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 public void intrinsify(Node node) {
7098
e23980f4a890 Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7017
diff changeset
157 assert !(node instanceof ValueNode) || (((ValueNode) node).kind() == Kind.Void) == (kind() == Kind.Void);
6409
823a2978e7ba Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5822
diff changeset
158 CallTargetNode call = callTarget;
4310
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
159 FrameState stateAfter = stateAfter();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 if (node instanceof StateSplit) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 StateSplit stateSplit = (StateSplit) node;
4310
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
162 stateSplit.setStateAfter(stateAfter);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163 }
8537
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
164 if (node instanceof FixedWithNextNode) {
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
165 ((StructuredGraph) graph()).replaceFixedWithFixed(this, (FixedWithNextNode) node);
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
166 } else if (node instanceof DeoptimizeNode) {
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
167 this.replaceAtPredecessor(node);
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
168 this.replaceAtUsages(null);
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
169 GraphUtil.killCFG(this);
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
170 return;
4305
0768bf0a4898 move part of the cfg-modifying operations into one place (currently: StructuredGraph)
Lukas Stadler <lukas.stadler@jku.at>
parents: 4249
diff changeset
171 } else {
8537
da674936800c InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents: 8394
diff changeset
172 ((StructuredGraph) graph()).replaceFixed(this, node);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
173 }
4310
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
174 call.safeDelete();
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
175 if (stateAfter.usages().isEmpty()) {
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
176 stateAfter.safeDelete();
72d099e5be61 more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 4305
diff changeset
177 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
178 }
8892
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
179
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
180 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
181 public boolean canDeoptimize() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
182 return true;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
183 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
184
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
185 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
186 public DeoptimizationReason getDeoptimizationReason() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
187 return null;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
188 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
189
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
190 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
191 public FrameState getDeoptimizationState() {
8956
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
192 if (deoptState == null) {
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
193 FrameState stateDuring = stateDuring();
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
194 updateUsages(deoptState, stateDuring);
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
195 deoptState = stateDuring;
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
196 }
74725f2f6122 Add a deoptState for invokes so that they can loose their stateAfter
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
197 return deoptState;
8892
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
198 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
199
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
200 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
201 public void setDeoptimizationState(FrameState f) {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
202 throw new IllegalStateException();
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
203 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
204
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
205 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
206 public boolean isCallSiteDeoptimization() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
207 return true;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8537
diff changeset
208 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 }