public final class ArrayLengthNode extends FixedWithNextNode implements Canonicalizable.Unary<ValueNode>, Lowerable, Virtualizable, MemoryAccess
ArrayLength
instruction gets the length of an array.Node.ConstantNodeParameter, Node.EdgeVisitor, Node.IndirectCanonicalization, Node.InjectedNodeParameter, Node.Input, Node.NodeInsertionStackTrace, Node.NodeIntrinsic, Node.NodeIntrinsicFactory, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Canonicalizable.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 |
---|---|
static NodeClass<ArrayLengthNode> |
TYPE |
next
EMPTY_ARRAY, stamp
NODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
ArrayLengthNode(ValueNode array) |
Modifier and Type | Method and Description |
---|---|
ValueNode |
array() |
static int |
arrayLength(Object array)
Returns the length of the given array.
|
ValueNode |
canonical(CanonicalizerTool tool,
ValueNode forValue)
Similar to
Canonicalizable.canonical(CanonicalizerTool) , except that
implementations should act as if the current input of the node was the given one, i.e.,
they should never look at the inputs via the this pointer. |
static ValueNode |
create(ValueNode forValue,
ConstantReflectionProvider constantReflection) |
org.graalvm.word.LocationIdentity |
getLocationIdentity() |
ValueNode |
getValue()
Gets the current value of the input, so that calling
Canonicalizable.Unary.canonical(CanonicalizerTool, Node) with the value returned from this method
should behave exactly like Canonicalizable.canonical(CanonicalizerTool) . |
static boolean |
intrinsify(GraphBuilderContext b,
ValueNode array) |
static ValueNode |
readArrayLength(ValueNode originalArray,
ConstantReflectionProvider constantReflection)
Gets the length of an array if possible.
|
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.
|
asFixedWithNextNode, next, setNext
asFixedNode, verify
asConstant, asJavaConstant, asNode, asSerializableConstant, checkReplaceAtUsagesInvariants, getStackKind, graph, hasUsagesOtherThan, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isDefaultConstant, isIllegalConstant, isJavaConstant, isNullConstant, isSerializableConstant, recursivelyDataFlowEqualsUpTo, setStamp, stamp, updateStamp, updateUsagesInterface
afterClone, 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, hasExactlyOneUsageOfType, 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, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePosition
clone, equals, getClass, notify, notifyAll, wait, wait, wait
canonical
getLastLocationAccess, setLastLocationAccess
asNode
asFixedNode
public static final NodeClass<ArrayLengthNode> TYPE
public ArrayLengthNode(ValueNode array)
public ValueNode array()
public ValueNode getValue()
Canonicalizable.Unary
Canonicalizable.Unary.canonical(CanonicalizerTool, Node)
with the value returned from this method
should behave exactly like Canonicalizable.canonical(CanonicalizerTool)
.getValue
in interface Canonicalizable.Unary<ValueNode>
public org.graalvm.word.LocationIdentity getLocationIdentity()
getLocationIdentity
in interface MemoryAccess
public static ValueNode create(ValueNode forValue, ConstantReflectionProvider constantReflection)
public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue)
Canonicalizable.Unary
Canonicalizable.canonical(CanonicalizerTool)
, except that
implementations should act as if the current input of the node was the given one, i.e.,
they should never look at the inputs via the this pointer.canonical
in interface Canonicalizable.Unary<ValueNode>
public static ValueNode readArrayLength(ValueNode originalArray, ConstantReflectionProvider constantReflection)
array
or null if it is not availablepublic static boolean intrinsify(GraphBuilderContext b, ValueNode array)
public static int arrayLength(Object array)
public void virtualize(VirtualizerTool tool)
Virtualizable
virtualize
in interface Virtualizable
tool
- the tool used to describe the effects of this node