Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java @ 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
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 15 Aug 2014 11:34:38 +0200 |
parents | 5d468add216f |
children | 06c15e88d383 |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
2 * Copyright (c) 2009, 2014, 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 |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5504
diff
changeset
|
25 import com.oracle.graal.api.meta.*; |
15198
2c0cfbf454b5
Move LIRTypeTool and Stamp to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
12045
diff
changeset
|
26 import com.oracle.graal.compiler.common.type.*; |
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
|
27 import com.oracle.graal.graph.spi.*; |
16841
cbd42807a31f
moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents:
16811
diff
changeset
|
28 import com.oracle.graal.nodeinfo.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
29 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.nodes.calc.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.nodes.spi.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 |
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 * The {@code InstanceOfNode} represents an instanceof test. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 */ |
16811
5d468add216f
added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents:
16421
diff
changeset
|
36 @NodeInfo |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
37 public class InstanceOfNode extends UnaryOpLogicNode implements Lowerable, Virtualizable { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
39 private final ResolvedJavaType type; |
9366
f1170c277b7b
Implement instanceof after instanceof swapping.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9360
diff
changeset
|
40 private JavaTypeProfile profile; |
4338 | 41 |
3733
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 * Constructs a new InstanceOfNode. |
15348
1c347436d596
added UnaryOpLogicNode base class, renamed BinaryLogicNode
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15261
diff
changeset
|
44 * |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
45 * @param type the target type of the instanceof check |
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
46 * @param object the object being tested by the instanceof |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 */ |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
48 public InstanceOfNode(ResolvedJavaType type, ValueNode object, JavaTypeProfile profile) { |
15348
1c347436d596
added UnaryOpLogicNode base class, renamed BinaryLogicNode
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15261
diff
changeset
|
49 super(object); |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
50 this.type = type; |
5370 | 51 this.profile = profile; |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
52 assert type != null; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 @Override |
11579
ae619d70bf4b
Rename LoweringType to GuardsPhase and make it an attribute of StructuredGraphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11409
diff
changeset
|
56 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
|
57 tool.getLowerer().lower(this, tool); |
6302
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5891
diff
changeset
|
58 } |
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5891
diff
changeset
|
59 |
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5891
diff
changeset
|
60 @Override |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
61 public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) { |
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
62 Stamp stamp = forValue.stamp(); |
11265 | 63 if (!(stamp instanceof ObjectStamp)) { |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
64 return this; |
11265 | 65 } |
66 ObjectStamp objectStamp = (ObjectStamp) stamp; | |
67 if (objectStamp.alwaysNull()) { | |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
68 return LogicConstantNode.contradiction(); |
10708
41e9c8845826
Improve instanceof canonicalization
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10693
diff
changeset
|
69 } |
41e9c8845826
Improve instanceof canonicalization
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10693
diff
changeset
|
70 |
11265 | 71 ResolvedJavaType stampType = objectStamp.type(); |
72 if (stampType != null) { | |
16420
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
73 ValueNode result = checkInstanceOf(forValue, stampType, objectStamp.nonNull(), objectStamp.isExactType()); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
74 if (result != null) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
75 return result; |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
76 } |
16421
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
77 if (tool.assumptions() != null && tool.assumptions().useOptimisticAssumptions()) { |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
78 ResolvedJavaType exact = stampType.findUniqueConcreteSubtype(); |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
79 if (exact != null) { |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
80 result = checkInstanceOf(forValue, exact, objectStamp.nonNull(), true); |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
81 if (result != null) { |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
82 tool.assumptions().recordConcreteSubtype(stampType, exact); |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
83 return result; |
c158f653275e
don't forget to record assumptions
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16420
diff
changeset
|
84 } |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
85 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 } |
16420
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
88 return this; |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
89 } |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
90 |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
91 private ValueNode checkInstanceOf(ValueNode forValue, ResolvedJavaType inputType, boolean nonNull, boolean exactType) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
92 boolean subType = type().isAssignableFrom(inputType); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
93 if (subType) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
94 if (nonNull) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
95 // the instanceOf matches, so return true |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
96 return LogicConstantNode.tautology(); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
97 } |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
98 } else { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
99 if (exactType) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
100 // since this type check failed for an exact type we know that it can never |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
101 // succeed at run time. we also don't care about null values, since they will |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
102 // also make the check fail. |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
103 return LogicConstantNode.contradiction(); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
104 } else { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
105 boolean superType = inputType.isAssignableFrom(type()); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
106 if (!superType && !inputType.isInterface() && !type().isInterface()) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
107 return LogicConstantNode.contradiction(); |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
108 } |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
109 // since the subtype comparison was only performed on a declared type we don't |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
110 // really know if it might be true at run time... |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
111 } |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
112 } |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
113 if (type().isAssignableFrom(inputType)) { |
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
114 if (!nonNull) { |
16211
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
115 // the instanceof matches if the object is non-null, so return true |
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
116 // depending on the null-ness. |
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
117 return new LogicNegationNode(new IsNullNode(forValue)); |
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
118 } |
a15b25626672
implement Canonicalizable.Unary in the UnaryOpLogicNode hierarchy
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16207
diff
changeset
|
119 } |
16420
e4ac25d4e13d
use findUniqueConcreteSubtype in InstanceOfNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16211
diff
changeset
|
120 return null; |
5370 | 121 } |
122 | |
123 /** | |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
124 * Gets the type being tested. |
5370 | 125 */ |
6647
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
126 public ResolvedJavaType type() { |
0b8410de1365
removed targetClassInstruction from InstanceOfNode
Doug Simon <doug.simon@oracle.com>
parents:
6548
diff
changeset
|
127 return type; |
5370 | 128 } |
129 | |
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
|
130 public JavaTypeProfile profile() { |
5370 | 131 return profile; |
132 } | |
6548
4dc9e468c8b0
The lowering currently does not support a FixedGuard as the usage of an InstanceOfNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6302
diff
changeset
|
133 |
9366
f1170c277b7b
Implement instanceof after instanceof swapping.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9360
diff
changeset
|
134 public void setProfile(JavaTypeProfile profile) { |
f1170c277b7b
Implement instanceof after instanceof swapping.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9360
diff
changeset
|
135 this.profile = profile; |
f1170c277b7b
Implement instanceof after instanceof swapping.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9360
diff
changeset
|
136 } |
f1170c277b7b
Implement instanceof after instanceof swapping.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9360
diff
changeset
|
137 |
6548
4dc9e468c8b0
The lowering currently does not support a FixedGuard as the usage of an InstanceOfNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6302
diff
changeset
|
138 @Override |
7011
09df32b1dff9
make InstanceOfNode Virtualizable
Lukas Stadler <lukas.stadler@jku.at>
parents:
6647
diff
changeset
|
139 public void virtualize(VirtualizerTool tool) { |
16207
df6f2365b153
rename of x() to getX(), y() to getY() and object() to getValue()
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15831
diff
changeset
|
140 State state = tool.getObjectState(getValue()); |
7394
94f032472c28
changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents:
7277
diff
changeset
|
141 if (state != null) { |
7767
4a6646d8eb87
separate BooleanNode and ConstantNode hierarchy, rename BooleanNode to LogicNode and LogicNode to BitLogicNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
142 tool.replaceWithValue(LogicConstantNode.forBoolean(type().isAssignableFrom(state.getVirtualObject().type()), graph())); |
7011
09df32b1dff9
make InstanceOfNode Virtualizable
Lukas Stadler <lukas.stadler@jku.at>
parents:
6647
diff
changeset
|
143 } |
09df32b1dff9
make InstanceOfNode Virtualizable
Lukas Stadler <lukas.stadler@jku.at>
parents:
6647
diff
changeset
|
144 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 } |