Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java @ 17328:c9bb0da795d4
Backed out of changeset 17322:655f3e6b467b
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 03 Oct 2014 14:19:58 +0200 |
parents | 655f3e6b467b |
children | 45b45f902bed |
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.*; |
15198
2c0cfbf454b5
Move LIRTypeTool and Stamp to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15019
diff
changeset
|
28 import com.oracle.graal.compiler.common.type.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
29 import com.oracle.graal.graph.*; |
16841
cbd42807a31f
moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents:
16811
diff
changeset
|
30 import com.oracle.graal.nodeinfo.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.nodes.extended.*; |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
32 import com.oracle.graal.nodes.java.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
33 import com.oracle.graal.nodes.spi.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
34 import com.oracle.graal.nodes.util.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 * 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
|
38 */ |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
39 @NodeInfo(nameTemplate = "Invoke#{p#targetMethod/s}", allowedUsageTypes = {InputType.Memory}) |
16979
6e05e73c942c
InvokeNode does not need to implement IterableNodeType
Doug Simon <doug.simon@oracle.com>
parents:
16919
diff
changeset
|
40 public class InvokeNode extends AbstractMemoryCheckpoint implements Invoke, LIRLowerable, MemoryCheckpoint.Single { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 |
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
|
42 @Input(InputType.Extension) CallTargetNode callTarget; |
f90dcdbbb75e
switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
43 @OptionalInput(InputType.State) FrameState stateDuring; |
f90dcdbbb75e
switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
44 @OptionalInput(InputType.Guard) GuardingNode guard; |
17328
c9bb0da795d4
Backed out of changeset 17322:655f3e6b467b
Doug Simon <doug.simon@oracle.com>
parents:
17327
diff
changeset
|
45 protected final int bci; |
17276
ffb974bef674
moved Node valueNumber and valueEquals logic (optionally) to generated nodes
Doug Simon <doug.simon@oracle.com>
parents:
16979
diff
changeset
|
46 protected boolean polymorphic; |
ffb974bef674
moved Node valueNumber and valueEquals logic (optionally) to generated nodes
Doug Simon <doug.simon@oracle.com>
parents:
16979
diff
changeset
|
47 protected boolean useForInlining; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 * Constructs a new Invoke instruction. |
15001 | 51 * |
9784
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
52 * @param callTarget the target method being called |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 * @param bci the bytecode index of the original invoke (used for debug infos) |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 */ |
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
|
55 public static InvokeNode create(CallTargetNode callTarget, int bci) { |
16919
0fe4732e5181
made use of generated Node classes predicated on value of graal.useGeneratedNodes system property (default is false)
Doug Simon <doug.simon@oracle.com>
parents:
16897
diff
changeset
|
56 return USE_GENERATED_NODES ? new InvokeNodeGen(callTarget, bci) : new InvokeNode(callTarget, bci); |
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
|
57 } |
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
|
58 |
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
|
59 protected InvokeNode(CallTargetNode callTarget, int bci) { |
9784
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
60 this(callTarget, bci, callTarget.returnStamp()); |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
61 } |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
62 |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
63 /** |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
64 * Constructs a new Invoke instruction. |
15001 | 65 * |
9784
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
66 * @param callTarget the target method being called |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
67 * @param bci the bytecode index of the original invoke (used for debug infos) |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
68 * @param stamp the stamp to be used for this value |
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
69 */ |
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
|
70 public static InvokeNode create(CallTargetNode callTarget, int bci, Stamp stamp) { |
16919
0fe4732e5181
made use of generated Node classes predicated on value of graal.useGeneratedNodes system property (default is false)
Doug Simon <doug.simon@oracle.com>
parents:
16897
diff
changeset
|
71 return USE_GENERATED_NODES ? new InvokeNodeGen(callTarget, bci, stamp) : new InvokeNode(callTarget, bci, stamp); |
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
|
72 } |
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
|
73 |
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
|
74 protected InvokeNode(CallTargetNode callTarget, int bci, Stamp stamp) { |
9784
747b2517feae
use invoker's stamp if target's return stamp is of different type
twisti
parents:
9715
diff
changeset
|
75 super(stamp); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 this.callTarget = callTarget; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 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
|
78 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
|
79 this.useForInlining = true; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5822
diff
changeset
|
82 @Override |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5822
diff
changeset
|
83 public CallTargetNode callTarget() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 return callTarget; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 |
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
|
87 @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
|
88 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
|
89 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
|
90 } |
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
|
91 |
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
|
92 @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
|
93 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
|
94 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
|
95 } |
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
|
96 |
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
|
97 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
|
98 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
|
99 } |
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
|
100 |
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
|
101 @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
|
102 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
|
103 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
|
104 } |
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
|
105 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 @Override |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
107 public boolean isAllowedUsageType(InputType type) { |
15976
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
108 if (!super.isAllowedUsageType(type)) { |
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
109 if (getKind() != Kind.Void) { |
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
110 if (callTarget instanceof MethodCallTargetNode && ((MethodCallTargetNode) callTarget).targetMethod().getAnnotation(NodeIntrinsic.class) != null) { |
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
111 return true; |
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
112 } |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
113 } |
15976
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
114 return false; |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
115 } |
15976
1dcc7ae72723
InvokeNode: getAnnotation is dangerous
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15470
diff
changeset
|
116 return true; |
15002
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
117 } |
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
118 |
06e50d290784
isAllowedUsageType on Nodes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15001
diff
changeset
|
119 @Override |
5813
3b8bc07f8d17
Add ability to give an existing to getDebugProperties
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
120 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
|
121 Map<Object, Object> debugProperties = super.getDebugProperties(map); |
9699
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9251
diff
changeset
|
122 if (callTarget != null) { |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9251
diff
changeset
|
123 debugProperties.put("targetMethod", callTarget.targetName()); |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9251
diff
changeset
|
124 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 return debugProperties; |
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 @Override |
10090
ae6f0c381087
split MemoryCheckpoint interface into Single and Multi
Lukas Stadler <lukas.stadler@jku.at>
parents:
9795
diff
changeset
|
129 public LocationIdentity getLocationIdentity() { |
ae6f0c381087
split MemoryCheckpoint interface into Single and Multi
Lukas Stadler <lukas.stadler@jku.at>
parents:
9795
diff
changeset
|
130 return LocationIdentity.ANY_LOCATION; |
7864
b66a826acf4b
add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents:
7660
diff
changeset
|
131 } |
b66a826acf4b
add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents:
7660
diff
changeset
|
132 |
b66a826acf4b
add location identity to MemoryCheckpoint and let WriteNode implement MemoryCheckpoint
Lukas Stadler <lukas.stadler@jku.at>
parents:
7660
diff
changeset
|
133 @Override |
11579
ae619d70bf4b
Rename LoweringType to GuardsPhase and make it an attribute of StructuredGraphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11578
diff
changeset
|
134 public void lower(LoweringTool tool) { |
12045
0fc653a9e019
made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
135 tool.getLowerer().lower(this, tool); |
5802
93f6ad9a0596
added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
136 } |
93f6ad9a0596
added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
137 |
93f6ad9a0596
added null check for receiver of non-static invokes
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
138 @Override |
14950
d5a1206e1923
NodeLIRBuilderTool: fix typo in interface name.
Josef Eisl <josef.eisl@jku.at>
parents:
14888
diff
changeset
|
139 public void generate(NodeLIRBuilderTool gen) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 gen.emitInvoke(this); |
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 public String toString(Verbosity verbosity) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 if (verbosity == Verbosity.Long) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 return super.toString(Verbosity.Short) + "(bci=" + bci() + ")"; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 } 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
|
148 return "Invoke#" + (callTarget == null ? "null" : callTarget().targetName()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
150 return super.toString(verbosity); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 } |
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 public int bci() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 return bci; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 public void intrinsify(Node node) { |
15006
e60ea0bf468d
remove StampFactory.dependency/extension/condition
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15002
diff
changeset
|
160 assert !(node instanceof ValueNode) || node.isAllowedUsageType(InputType.Value) == isAllowedUsageType(InputType.Value) : "replacing " + this + " with " + node; |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5822
diff
changeset
|
161 CallTargetNode call = callTarget; |
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
|
162 FrameState currentStateAfter = stateAfter(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 if (node instanceof StateSplit) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 StateSplit stateSplit = (StateSplit) node; |
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
|
165 stateSplit.setStateAfter(currentStateAfter); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 } |
8537
da674936800c
InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents:
8394
diff
changeset
|
167 if (node instanceof FixedWithNextNode) { |
9602
19c5a07c7843
Introduce a graph() method that returns a StructuredGraph, to make many explicit casts unnecessary
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9526
diff
changeset
|
168 graph().replaceFixedWithFixed(this, (FixedWithNextNode) node); |
9337
e1200d5141fa
generalized invoke intrinsification when being replaced by a ControlSinkNode
Doug Simon <doug.simon@oracle.com>
parents:
9251
diff
changeset
|
169 } else if (node instanceof ControlSinkNode) { |
8537
da674936800c
InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents:
8394
diff
changeset
|
170 this.replaceAtPredecessor(node); |
da674936800c
InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents:
8394
diff
changeset
|
171 this.replaceAtUsages(null); |
da674936800c
InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents:
8394
diff
changeset
|
172 GraphUtil.killCFG(this); |
da674936800c
InvokeNode: remove dead code in intrinsify
Bernhard Urban <bernhard.urban@jku.at>
parents:
8394
diff
changeset
|
173 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
|
174 } else { |
9602
19c5a07c7843
Introduce a graph() method that returns a StructuredGraph, to make many explicit casts unnecessary
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9526
diff
changeset
|
175 graph().replaceFixed(this, node); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
176 } |
16189
7230e2f425f6
make Invoke nodes delete unused floating inputs and frame state when intrinsified
Doug Simon <doug.simon@oracle.com>
parents:
15976
diff
changeset
|
177 GraphUtil.killWithUnusedFloatingInputs(call); |
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
|
178 if (currentStateAfter.usages().isEmpty()) { |
f90dcdbbb75e
switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents:
16895
diff
changeset
|
179 GraphUtil.killWithUnusedFloatingInputs(currentStateAfter); |
4310
72d099e5be61
more CanonicalizerPhase simplifications, added Simplifiable interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
180 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 } |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
182 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
183 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
184 public boolean canDeoptimize() { |
9021
0524e6e34ad8
Revert earlier change that caused problems
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9017
diff
changeset
|
185 return true; |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
186 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
187 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
188 @Override |
14734
6ae9af961b7c
Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents:
14633
diff
changeset
|
189 public FrameState stateDuring() { |
14783
01786db19f7d
Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents:
14734
diff
changeset
|
190 return stateDuring; |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
191 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
192 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8537
diff
changeset
|
193 @Override |
14734
6ae9af961b7c
Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents:
14633
diff
changeset
|
194 public void setStateDuring(FrameState stateDuring) { |
14783
01786db19f7d
Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents:
14734
diff
changeset
|
195 updateUsages(this.stateDuring, stateDuring); |
01786db19f7d
Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents:
14734
diff
changeset
|
196 this.stateDuring = stateDuring; |
14734
6ae9af961b7c
Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents:
14633
diff
changeset
|
197 } |
6ae9af961b7c
Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents:
14633
diff
changeset
|
198 |
6ae9af961b7c
Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents:
14633
diff
changeset
|
199 @Override |
9646
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
200 public GuardingNode getGuard() { |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
201 return guard; |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
202 } |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
203 |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
204 @Override |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
205 public void setGuard(GuardingNode guard) { |
15007
9a73164832a9
add NodeInterface
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15006
diff
changeset
|
206 updateUsagesInterface(this.guard, guard); |
9646
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
207 this.guard = guard; |
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9602
diff
changeset
|
208 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
209 } |