Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java @ 16235:0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Wed, 25 Jun 2014 18:47:41 +0200 |
parents | cc4b4fd5c484 |
children | 197ae7ce6bf8 |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
3733
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.java; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
15139
220dd370ef9b
Some simplifications around filter usages and node predicates
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14978
diff
changeset
|
25 import static com.oracle.graal.graph.iterators.NodePredicates.*; |
220dd370ef9b
Some simplifications around filter usages and node predicates
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14978
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:
15139
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.*; |
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
|
30 import com.oracle.graal.graph.spi.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
32 import com.oracle.graal.nodes.spi.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
33 import com.oracle.graal.nodes.type.*; |
6710
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
34 import com.oracle.graal.nodes.virtual.*; |
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 LoadFieldNode} represents a read of a static or instance field. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 */ |
5814
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5758
diff
changeset
|
39 @NodeInfo(nameTemplate = "LoadField#{p#field/s}") |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
40 public final class LoadFieldNode extends AccessFieldNode implements Canonicalizable, VirtualizableRoot { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
42 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 * Creates a new LoadFieldNode instance. |
14978
e302df8bf51c
separate subclasses for value and guard phis and proxies
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14018
diff
changeset
|
44 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 * @param object the receiver object |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 * @param field the compiler interface field |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 */ |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
48 public LoadFieldNode(ValueNode object, ResolvedJavaField field) { |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
49 super(createStamp(field), object, field); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
52 private static Stamp createStamp(ResolvedJavaField field) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5814
diff
changeset
|
53 Kind kind = field.getKind(); |
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5814
diff
changeset
|
54 if (kind == Kind.Object && field.getType() instanceof ResolvedJavaType) { |
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5814
diff
changeset
|
55 return StampFactory.declared((ResolvedJavaType) field.getType()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 return StampFactory.forKind(kind); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
58 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 } |
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 @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:
11652
diff
changeset
|
62 public Node canonical(CanonicalizerTool tool) { |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
63 if (usages().isEmpty() && !isVolatile() && (isStatic() || StampTool.isObjectNonNull(object().stamp()))) { |
13688
1e28a62e6031
remove LoadFieldNodes without usages
Lukas Stadler <lukas.stadler@jku.at>
parents:
12429
diff
changeset
|
64 return null; |
1e28a62e6031
remove LoadFieldNodes without usages
Lukas Stadler <lukas.stadler@jku.at>
parents:
12429
diff
changeset
|
65 } |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
66 MetaAccessProvider metaAccess = tool.getMetaAccess(); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
11959
diff
changeset
|
67 if (tool.canonicalizeReads() && metaAccess != null) { |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
68 ConstantNode constant = asConstant(metaAccess); |
10817
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
69 if (constant != null) { |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
70 return constant; |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
71 } |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
72 PhiNode phi = asPhi(metaAccess); |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
73 if (phi != null) { |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
74 return phi; |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
75 } |
10817
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
76 } |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
77 if (!isStatic() && object().isNullConstant()) { |
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
78 return graph().add(new DeoptimizeNode(DeoptimizationAction.None, DeoptimizationReason.NullCheckException)); |
13780
d6ac7ebead35
canonicalize a LoadField on a null constant object to deopt
Lukas Stadler <lukas.stadler@jku.at>
parents:
13688
diff
changeset
|
79 } |
10817
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
80 return this; |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
81 } |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
82 |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
83 /** |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
84 * Gets a constant value for this load if possible. |
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
85 */ |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
86 public ConstantNode asConstant(MetaAccessProvider metaAccess) { |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
87 Constant constant = null; |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
88 if (isStatic()) { |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
89 constant = field().readConstantValue(null); |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
90 } else if (object().isConstant() && !object().isNullConstant()) { |
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
91 constant = field().readConstantValue(object().asConstant()); |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
92 } |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
93 if (constant != null) { |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
94 return ConstantNode.forConstant(constant, metaAccess, graph()); |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
95 } |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
96 return null; |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
97 } |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
98 |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
99 private PhiNode asPhi(MetaAccessProvider metaAccess) { |
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
100 if (!isStatic() && field.isFinal() && object() instanceof ValuePhiNode && ((ValuePhiNode) object()).values().filter(isNotA(ConstantNode.class)).isEmpty()) { |
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
101 PhiNode phi = (PhiNode) object(); |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
102 Constant[] constants = new Constant[phi.valueCount()]; |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
103 for (int i = 0; i < phi.valueCount(); i++) { |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
104 Constant constantValue = field().readConstantValue(phi.valueAt(i).asConstant()); |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
105 if (constantValue == null) { |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
106 return null; |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
107 } |
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
108 constants[i] = constantValue; |
5473
c73882b7db10
runtime may be null in the canonicalizer (like target or assumptions)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5443
diff
changeset
|
109 } |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
110 PhiNode newPhi = graph().addWithoutUnique(new ValuePhiNode(stamp(), phi.merge())); |
10848
4da2141fc40f
Canonicalize final field loads from a phi of constant objects.
Andreas Woess <andreas.woess@jku.at>
parents:
10817
diff
changeset
|
111 for (int i = 0; i < phi.valueCount(); i++) { |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
112 newPhi.addInput(ConstantNode.forConstant(constants[i], metaAccess, graph())); |
5473
c73882b7db10
runtime may be null in the canonicalizer (like target or assumptions)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5443
diff
changeset
|
113 } |
16235
0aac7ed51b12
Temporarily back out faulty changeset cc4b4fd5c484
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16226
diff
changeset
|
114 return newPhi; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 } |
10817
2c9332a969d6
made it possible to use enum constants in snippets
Doug Simon <doug.simon@oracle.com>
parents:
9944
diff
changeset
|
116 return null; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 } |
6710
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
118 |
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
119 @Override |
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
120 public void virtualize(VirtualizerTool tool) { |
7394
94f032472c28
changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents:
6710
diff
changeset
|
121 State state = tool.getObjectState(object()); |
94f032472c28
changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents:
6710
diff
changeset
|
122 if (state != null && state.getState() == EscapeState.Virtual) { |
94f032472c28
changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents:
6710
diff
changeset
|
123 int fieldIndex = ((VirtualInstanceNode) state.getVirtualObject()).fieldIndex(field()); |
6710
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
124 if (fieldIndex != -1) { |
7394
94f032472c28
changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents:
6710
diff
changeset
|
125 tool.replaceWith(state.getEntry(fieldIndex)); |
6710
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
126 } |
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
127 } |
6db6881c1270
add Virtualizable and VirtualizerTool, refactor PEA to use it
Lukas Stadler <lukas.stadler@jku.at>
parents:
6539
diff
changeset
|
128 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 } |