public class PiNode extends FloatingGuardedNode implements LIRLowerable, Virtualizable, IterableNodeType, Canonicalizable, ValueProxy
PiNode
refines the type of a receiver during type-guarded inlining to be the type tested by the guard.
In contrast to a GuardedValueNode
, a PiNode
is useless as soon as the type of its
input is as narrow or narrower than the PiNode
's type. The PiNode
, and therefore
also the scheduling restriction enforced by the anchor, will go away.Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Canonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Unary<T extends Node>
Modifier and Type | Field and Description |
---|---|
(package private) ValueNode |
object |
protected Stamp |
piStamp |
static NodeClass<PiNode> |
TYPE |
guard
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Modifier | Constructor and Description |
---|---|
protected |
PiNode(NodeClass<? extends PiNode> c,
ValueNode object,
Stamp stamp) |
|
PiNode(ValueNode object,
ResolvedJavaType toType,
boolean exactType,
boolean nonNull) |
|
PiNode(ValueNode object,
Stamp stamp) |
|
PiNode(ValueNode object,
Stamp stamp,
ValueNode anchor) |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
asNonNullClass(Object object)
Casts an object to have an exact, non-null stamp representing
Class . |
private static Class<?> |
asNonNullClassIntrinsic(Object object,
Class<?> toType,
boolean exactType,
boolean nonNull) |
Node |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
void |
generate(NodeLIRBuilderTool generator) |
ValueNode |
getOriginalNode() |
boolean |
inferStamp()
This method can be overridden by subclasses of
ValueNode if they need to recompute
their stamp if their inputs change. |
ValueNode |
object() |
static Object |
piCast(Object object,
Class<?> toType,
boolean exactType,
boolean nonNull) |
static Object |
piCast(Object object,
Stamp stamp)
Changes the stamp of an object.
|
static Object |
piCast(Object object,
Stamp stamp,
GuardingNode anchor)
Changes the stamp of an object and ensures the newly stamped value does float above a given
anchor.
|
static Object |
piCastNonNull(Object object,
Class<?> toType)
Changes the stamp of an object to represent a given type and to indicate that the object is
not null.
|
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.
|
getGuard, setGuard
asNode
asConstant, asJavaConstant, getKind, graph, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStamp
acceptInputs, 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, simplify, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verify, verifyEdges, verifyInputs
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asNode
asNode
public PiNode(ValueNode object, ResolvedJavaType toType, boolean exactType, boolean nonNull)
public void generate(NodeLIRBuilderTool generator)
generate
in interface LIRLowerable
public boolean inferStamp()
ValueNode
ValueNode
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 ValueNode
public void virtualize(VirtualizerTool tool)
Virtualizable
virtualize
in interface Virtualizable
tool
- the tool used to describe the effects of this nodepublic Node canonical(CanonicalizerTool tool)
Canonicalizable
null
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 Canonicalizable
tool
- provides access to runtime interfaces like MetaAccessProvider
public ValueNode getOriginalNode()
getOriginalNode
in interface LimitedValueProxy
getOriginalNode
in interface Proxy
public static Class<?> asNonNullClass(Object object)
Class
.private static Class<?> asNonNullClassIntrinsic(Object object, Class<?> toType, boolean exactType, boolean nonNull)
public static Object piCast(Object object, Stamp stamp, GuardingNode anchor)
public static Object piCastNonNull(Object object, Class<?> toType)