public class CheckCastNode extends FixedWithNextNode implements Canonicalizable, Simplifiable, Lowerable, Virtualizable, ValueProxy
Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberableCanonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Unary<T extends Node>| Modifier and Type | Field and Description |
|---|---|
protected boolean |
forStoreCheck
Determines the exception thrown by this node if the check fails:
ClassCastException
if false; ArrayStoreException if true. |
protected ValueNode |
object |
protected JavaTypeProfile |
profile |
protected ResolvedJavaType |
type |
static NodeClass<CheckCastNode> |
TYPE |
nextNODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
CheckCastNode(NodeClass<? extends CheckCastNode> c,
ResolvedJavaType type,
ValueNode object,
JavaTypeProfile profile,
boolean forStoreCheck) |
|
CheckCastNode(ResolvedJavaType type,
ValueNode object,
JavaTypeProfile profile,
boolean forStoreCheck) |
| Modifier and Type | Method and Description |
|---|---|
Node |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
static ValueNode |
create(ResolvedJavaType inputType,
ValueNode object,
JavaTypeProfile profile,
boolean forStoreCheck,
Assumptions assumptions) |
protected static ValueNode |
findSynonym(ResolvedJavaType type,
ValueNode object) |
ValueNode |
getOriginalNode() |
boolean |
inferStamp()
This method can be overridden by subclasses of
ValueNode if they need to recompute
their stamp if their inputs change. |
boolean |
isForStoreCheck() |
void |
lower(LoweringTool tool)
Lowers a
CheckCastNode. |
ValueNode |
object() |
JavaTypeProfile |
profile() |
void |
simplify(SimplifierTool tool)
Must be overridden by subclasses that implement
Simplifiable. |
TriState |
tryFold(Stamp testStamp) |
ResolvedJavaType |
type()
Gets the type being cast to.
|
void |
virtualize(VirtualizerTool tool)
A node class can implement this method to convey information about what its effect would be
if some of its inputs were virtualized.
|
asNode, next, setNextasConstant, asJavaConstant, getKind, graph, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStampacceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearSuccessors, copyWithInputs, copyWithInputs, equals, fail, formatTo, getDebugProperties, getDebugProperties, getId, getNodeClass, getUsageAt, getUsageCount, hashCode, hasNoUsages, hasUsages, inputs, isAlive, isDeleted, markDeleted, modCount, newIdentityMap, newIdentityMap, newIdentityMap, newMap, newMap, newMap, newSet, newSet, predecessor, pushInputs, removeUsage, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceFirstInput, replaceFirstSuccessor, safeDelete, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputspublic static final NodeClass<CheckCastNode> TYPE
protected final ResolvedJavaType type
protected final JavaTypeProfile profile
protected final boolean forStoreCheck
ClassCastException
if false; ArrayStoreException if true.public CheckCastNode(ResolvedJavaType type, ValueNode object, JavaTypeProfile profile, boolean forStoreCheck)
protected CheckCastNode(NodeClass<? extends CheckCastNode> c, ResolvedJavaType type, ValueNode object, JavaTypeProfile profile, boolean forStoreCheck)
public static ValueNode create(ResolvedJavaType inputType, ValueNode object, JavaTypeProfile profile, boolean forStoreCheck, Assumptions assumptions)
public boolean isForStoreCheck()
public void lower(LoweringTool tool)
CheckCastNode. That is:
1: A a = ... 2: B b = (B) a;is lowered to:
1: A a = ... 2: B b = guardingPi(a == null || a instanceof B, a, stamp(B))or if a is known to be non-null:
1: A a = ... 2: B b = guardingPi(a instanceof B, a, stamp(B, non-null))Note: we use
Graph.addWithoutUnique(T) as opposed to Graph.unique(T) for the new
InstanceOfNode to maintain the invariant checked by
LoweringPhase.checkUsagesAreScheduled().public boolean inferStamp()
ValueNodeValueNode if they need to recompute
their stamp if their inputs change. A typical implementation will compute the stamp and pass
it to ValueNode.updateStamp(Stamp), whose return value can be used as the result of this
method.inferStamp in class ValueNodepublic Node canonical(CanonicalizerTool tool)
Canonicalizablenull will delete the current node and replace it with null at
all usages. Note that it is not necessary to delete floating nodes that have no more usages
this way - they will be deleted automatically.canonical in interface Canonicalizabletool - provides access to runtime interfaces like MetaAccessProviderprotected static ValueNode findSynonym(ResolvedJavaType type, ValueNode object)
public void simplify(SimplifierTool tool)
NodeSimplifiable. The implementation in
Node exists to obviate the need to cast a node before invoking
Simplifiable.simplify(SimplifierTool).simplify in interface Simplifiablesimplify in class Nodepublic ResolvedJavaType type()
public JavaTypeProfile profile()
public void virtualize(VirtualizerTool tool)
Virtualizablevirtualize in interface Virtualizabletool - the tool used to describe the effects of this nodepublic ValueNode getOriginalNode()
getOriginalNode in interface LimitedValueProxygetOriginalNode in interface Proxy