Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java @ 5831:ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Add inferstamp to Pi and CheckCast to propage nonNull/alwaysNull
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 13 Jul 2012 14:10:02 +0200 |
parents | b4c406861c33 |
children | fd8832ae511d |
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.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.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
26 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
27 import com.oracle.graal.nodes.calc.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
28 import com.oracle.graal.nodes.spi.*; |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
29 import com.oracle.graal.nodes.spi.types.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.nodes.type.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 |
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 * The {@code InstanceOfNode} represents an instanceof test. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 */ |
5370 | 35 public final class InstanceOfNode extends BooleanNode implements Canonicalizable, LIRLowerable, ConditionalTypeFeedbackProvider, TypeCanonicalizable { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 |
5370 | 37 @Input private ValueNode object; |
38 @Input private ValueNode targetClassInstruction; | |
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
|
39 private final ResolvedJavaType targetClass; |
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
|
40 private final 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. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 * @param targetClassInstruction the instruction which produces the target class of the instanceof check |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 * @param targetClass the class which is the target of the instanceof check |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 * @param object the instruction producing the object input to this instruction |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 */ |
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
|
49 public InstanceOfNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object) { |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
50 this(targetClassInstruction, targetClass, object, null); |
4430
be4914c1c799
add hints to InstanceOfNode and CheckCastNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
4338
diff
changeset
|
51 } |
be4914c1c799
add hints to InstanceOfNode and CheckCastNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
4338
diff
changeset
|
52 |
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
|
53 public InstanceOfNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object, JavaTypeProfile profile) { |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
54 super(StampFactory.condition()); |
5370 | 55 this.targetClassInstruction = targetClassInstruction; |
56 this.targetClass = targetClass; | |
57 this.object = object; | |
58 this.profile = profile; | |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 assert targetClass != null; |
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
63 public void generate(LIRGeneratorTool gen) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 } |
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 @Override |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
67 public ValueNode canonical(CanonicalizerTool tool) { |
4547
a3cdfa2be94e
Allow to intrinsify an invoke with a deoptimize node. Make debug output more relaxed wrt to null in FrameMap.method
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4435
diff
changeset
|
68 assert object() != null : this; |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
69 |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
70 ObjectStamp stamp = object().objectStamp(); |
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
|
71 ResolvedJavaType type = stamp.type(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
72 |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
73 if (stamp.isExactType()) { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
74 boolean subType = type.isSubtypeOf(targetClass()); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
75 |
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
76 if (subType) { |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
77 if (stamp.nonNull()) { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
78 // the instanceOf matches, so return true |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
79 return ConstantNode.forBoolean(true, graph()); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
80 } else { |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
81 // the instanceof matches if the object is non-null, so return true depending on the null-ness. |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
82 negateUsages(); |
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
83 return graph().unique(new IsNullNode(object())); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
84 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 } else { |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
86 // since this type check failed for an exact type we know that it can never succeed at run time. |
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
87 // we also don't care about null values, since they will also make the check fail. |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
88 return ConstantNode.forBoolean(false, graph()); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
89 } |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
90 } else if (type != null) { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
91 boolean subType = type.isSubtypeOf(targetClass()); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
92 |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
93 if (subType) { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
94 if (stamp.nonNull()) { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
95 // the instanceOf matches, so return true |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
96 return ConstantNode.forBoolean(true, graph()); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
97 } else { |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
98 // the instanceof matches if the object is non-null, so return true depending on the null-ness. |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
99 negateUsages(); |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
100 return graph().unique(new IsNullNode(object())); |
5338
17a84768b1cd
fix canonicalization of InstanceOfNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5320
diff
changeset
|
101 } |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
102 } else { |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5425
diff
changeset
|
103 // since the subtype comparison was only performed on a declared type we don't really know if it might be true at run time... |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
104 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 } |
5831
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5541
diff
changeset
|
106 if (object().objectStamp().alwaysNull()) { |
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5541
diff
changeset
|
107 return ConstantNode.forBoolean(false, graph()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 return this; |
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 |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
113 public void typeFeedback(TypeFeedbackTool tool) { |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
114 tool.addObject(object()).declaredType(targetClass(), true); |
5313
be1a8ff480db
Visualizer: display long properties correctly, "!InstanceOf" for negated InstanceOfNodes
Lukas Stadler <lukas.stadler@jku.at>
parents:
5299
diff
changeset
|
115 } |
be1a8ff480db
Visualizer: display long properties correctly, "!InstanceOf" for negated InstanceOfNodes
Lukas Stadler <lukas.stadler@jku.at>
parents:
5299
diff
changeset
|
116 |
be1a8ff480db
Visualizer: display long properties correctly, "!InstanceOf" for negated InstanceOfNodes
Lukas Stadler <lukas.stadler@jku.at>
parents:
5299
diff
changeset
|
117 @Override |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
118 public Result canonical(TypeFeedbackTool tool) { |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
119 ObjectTypeQuery query = tool.queryObject(object()); |
5538
e18ba36bfebc
Renamed RiConstant => Constant.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
120 if (query.constantBound(Condition.EQ, Constant.NULL_OBJECT)) { |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
121 return new Result(ConstantNode.forBoolean(false, graph()), query); |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
122 } else if (targetClass() != null) { |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
123 if (query.notDeclaredType(targetClass())) { |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
124 return new Result(ConstantNode.forBoolean(false, graph()), query); |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
125 } |
5538
e18ba36bfebc
Renamed RiConstant => Constant.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
126 if (query.constantBound(Condition.NE, Constant.NULL_OBJECT)) { |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
127 if (query.declaredType(targetClass())) { |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5370
diff
changeset
|
128 return new Result(ConstantNode.forBoolean(true, graph()), query); |
5083
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
129 } |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
130 } |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
131 } |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
132 return null; |
1093243c09ad
experimental type storage/query infrastructure, part 3:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
133 } |
5370 | 134 |
135 public ValueNode object() { | |
136 return object; | |
137 } | |
138 | |
139 public ValueNode targetClassInstruction() { | |
140 return targetClassInstruction; | |
141 } | |
142 | |
143 /** | |
144 * Gets the target class, i.e. the class being cast to, or the class being tested against. | |
145 * @return the target class | |
146 */ | |
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
|
147 public ResolvedJavaType targetClass() { |
5370 | 148 return targetClass; |
149 } | |
150 | |
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
|
151 public JavaTypeProfile profile() { |
5370 | 152 return profile; |
153 } | |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 } |