public class PiNode extends FloatingGuardedNode implements LIRLowerable, Virtualizable, 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 guard, will go away.| Modifier and Type | Class and Description |
|---|---|
static class |
PiNode.IntrinsifyOp |
static class |
PiNode.Placeholder
A placeholder node in a snippet that will be replaced with a
PiNode when the snippet
is instantiated. |
static class |
PiNode.PlaceholderStamp
A stamp for
PiNode.Placeholder nodes which are only used in snippets. |
Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberableCanonicalizable.Binary<T extends Node>, Canonicalizable.BinaryCommutative<T extends Node>, Canonicalizable.Ternary<T extends Node>, Canonicalizable.Unary<T extends Node>| Modifier and Type | Field and Description |
|---|---|
protected Stamp |
piStamp |
static NodeClass<PiNode> |
TYPE |
guardEMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
PiNode(NodeClass<? extends PiNode> c,
ValueNode object,
Stamp stamp,
GuardingNode guard) |
|
PiNode(ValueNode object,
ResolvedJavaType toType,
boolean exactType,
boolean nonNull) |
|
PiNode(ValueNode object,
Stamp stamp) |
|
PiNode(ValueNode object,
Stamp stamp,
ValueNode guard) |
|
PiNode(ValueNode object,
ValueNode guard) |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
asNonNullClass(Object object)
Casts an object to have an exact, non-null stamp representing
Class. |
static Class<?> |
asNonNullObject(Object object)
Casts an object to have an exact, non-null stamp representing
Class. |
Node |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
static ValueNode |
canonical(ValueNode object,
Stamp piStamp,
GuardingNode guard,
PiNode self) |
static ValueNode |
create(ValueNode object,
Stamp stamp) |
static ValueNode |
create(ValueNode object,
Stamp stamp,
ValueNode guard) |
static ValueNode |
create(ValueNode object,
ValueNode guard) |
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. |
static boolean |
intrinsify(GraphBuilderContext b,
ValueNode object,
ResolvedJavaType toType,
boolean exactType,
boolean nonNull) |
static boolean |
intrinsify(GraphBuilderContext b,
ValueNode input,
ValueNode guard,
PiNode.IntrinsifyOp intrinsifyOp) |
ValueNode |
object() |
static Object |
piCast(Object object,
ResolvedJavaType toType,
boolean exactType,
boolean nonNull) |
static Object |
piCastNonNull(Object object,
GuardingNode guard)
Changes the stamp of an object and ensures the newly stamped value is non-null and does not
float above a given guard.
|
static Object |
piCastNonNull(Object object,
ResolvedJavaType toType)
Changes the stamp of an object to represent a given type and to indicate that the object is
not null.
|
static Class<?> |
piCastNonNullClass(Class<?> type,
GuardingNode guard)
Changes the stamp of an object and ensures the newly stamped value is non-null and does not
float above a given guard.
|
static int |
piCastNonZero(int value,
GuardingNode guard) |
static long |
piCastNonZero(long value,
GuardingNode guard) |
static int |
piCastPositive(int value,
GuardingNode guard)
Changes the stamp of a primitive value and ensures the newly stamped value is positive and
does not float above a given guard.
|
static Object |
piCastToSnippetReplaceeStamp(Object object)
Changes the stamp of an object inside a snippet to be the stamp of the node replaced by the
snippet.
|
Stamp |
piStamp()
A stamp expressing the property that is proved by the guard, but not
more.
|
void |
setOriginalNode(ValueNode newNode) |
void |
strengthenPiStamp(Stamp newPiStamp) |
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, setGuardasConstant, asJavaConstant, asNode, asSerializableConstant, checkReplaceAtUsagesInvariants, getStackKind, graph, hasUsagesOtherThan, isAllowedUsageType, isConstant, isConstantPredicate, isDefaultConstant, isIllegalConstant, isJavaConstant, isNullConstant, isSerializableConstant, recursivelyDataFlowEqualsUpTo, setStamp, stamp, updateStamp, updateUsagesInterfaceafterClone, applyInputs, applySuccessors, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearNodeSourcePosition, clearSuccessors, copyWithInputs, copyWithInputs, dataFlowEquals, dynamicNodeSizeEstimate, estimatedNodeCycles, estimatedNodeSize, fail, formatTo, getCreationPosition, getDebug, getDebugProperties, getDebugProperties, getInsertionPosition, getNodeClass, getNodeSourcePosition, getOptions, getUsageCount, hasExactlyOneUsage, hashCode, hasMoreThanOneUsage, hasNoUsages, hasOnlyUsagesOfType, hasUsages, hasUsagesOfType, inputPositions, inputs, isAlive, isDeleted, isUnregistered, markDeleted, maybeNotifyZeroUsages, modCount, predecessor, pushInputs, removeUsage, replaceAllInputs, replaceAndDelete, replaceAtAllUsages, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceAtUsagesAndDelete, replaceAtUsagesAndDelete, replaceFirstInput, replaceFirstSuccessor, safeDelete, setCreationPosition, setInsertionPosition, setNodeSourcePosition, singleUsage, successorPositions, successors, toString, toString, updateNodeSourcePosition, updatePredecessor, updateUsages, usages, valueEquals, verify, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionclone, equals, getClass, notify, notifyAll, wait, wait, waitgetGuardasNodeprotected PiNode(NodeClass<? extends PiNode> c, ValueNode object, Stamp stamp, GuardingNode guard)
public PiNode(ValueNode object, ResolvedJavaType toType, boolean exactType, boolean nonNull)
public ValueNode object()
public static boolean intrinsify(GraphBuilderContext b, ValueNode input, ValueNode guard, PiNode.IntrinsifyOp intrinsifyOp)
public static boolean intrinsify(GraphBuilderContext b, ValueNode object, ResolvedJavaType toType, boolean exactType, boolean nonNull)
public final Stamp piStamp()
x >= 0 on an int value, then the
PiNode.piStamp() should be StampFactory.positiveInt(). If the input value's stamp
is constrained, e.g., [-100 - 100], then this pi's overall ValueNode.stamp(NodeView)
will be [0 - 100], computed as the join of the PiNode.piStamp() and the input's
stamp.public void strengthenPiStamp(Stamp newPiStamp)
public void generate(NodeLIRBuilderTool generator)
generate in interface LIRLowerablepublic 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 void virtualize(VirtualizerTool tool)
Virtualizablevirtualize in interface Virtualizabletool - the tool used to describe the effects of this nodepublic static ValueNode canonical(ValueNode object, Stamp piStamp, GuardingNode guard, PiNode self)
public 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 MetaAccessProviderpublic ValueNode getOriginalNode()
getOriginalNode in interface LimitedValueProxygetOriginalNode in interface Proxypublic void setOriginalNode(ValueNode newNode)
public static Class<?> asNonNullClass(Object object)
Class.public static Class<?> asNonNullObject(Object object)
Class.public static Object piCastToSnippetReplaceeStamp(Object object)
public static int piCastPositive(int value,
GuardingNode guard)
value - an arbitrary int valueguard - a node proving that value >= 0 holds at some point in the graphvalue with its stamp clamped to exclude negative values, guarded by
guardpublic static int piCastNonZero(int value,
GuardingNode guard)
public static long piCastNonZero(long value,
GuardingNode guard)
public static Object piCastNonNull(Object object, GuardingNode guard)
public static Class<?> piCastNonNullClass(Class<?> type, GuardingNode guard)
public static Object piCastNonNull(Object object, ResolvedJavaType toType)