public class ArrayRegionCompareToNode extends FixedWithNextNode implements Canonicalizable, LIRLowerable, MemoryAccess, ConstantReflectionUtil.ArrayBaseOffsetProvider
JavaKind.Byte, JavaKind.Char and JavaKind.Int. The first array's stride
must be greater or equal to the second array's stride. Array strides are not required to match
the respective array's element sizes, e.g. this node can also read char values from byte
arrays. If strideA is greater than strideB, elements read from arrayB are
zero-extended to match strideA for the comparison.
This node differs from ArrayCompareToNode in the following features:
length parameter denotes the length of the region to be compared instead of the
full array length. The region given by the respective array offset and the region length must be
inside the array's bounds.arrayA[i] - arrayB[i] at the first index i where
arrayA[i] != arrayB[i]. If no such index exists, returns 0.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 ValueNode |
arrayA
Pointer to the first array object.
|
protected ValueNode |
arrayB
Pointer to the second array object.
|
protected ValueNode |
dynamicStrides
Optional argument for dispatching to any combination of strides at runtime, as described in
StrideUtil. |
protected MemoryKill |
lastLocationAccess |
protected ValueNode |
length
Length of the array region (as number of array elements).
|
protected org.graalvm.word.LocationIdentity |
locationIdentity |
protected ValueNode |
offsetA
Byte offset to be added to the first array pointer.
|
protected ValueNode |
offsetB
Byte offset to be added to the second array pointer.
|
protected JavaKind |
strideA
JavaKind of the arrays to compare. |
protected JavaKind |
strideB |
static NodeClass<ArrayRegionCompareToNode> |
TYPE |
nextEMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
ArrayRegionCompareToNode(NodeClass<? extends ArrayRegionCompareToNode> c,
ValueNode arrayA,
ValueNode offsetA,
ValueNode arrayB,
ValueNode offsetB,
ValueNode length,
ValueNode dynamicStrides,
JavaKind strideA,
JavaKind strideB,
org.graalvm.word.LocationIdentity locationIdentity) |
|
ArrayRegionCompareToNode(ValueNode arrayA,
ValueNode offsetA,
ValueNode arrayB,
ValueNode offsetB,
ValueNode length,
JavaKind strideA,
JavaKind strideB) |
|
ArrayRegionCompareToNode(ValueNode arrayA,
ValueNode offsetA,
ValueNode arrayB,
ValueNode offsetB,
ValueNode length,
JavaKind strideA,
JavaKind strideB,
org.graalvm.word.LocationIdentity locationIdentity) |
|
ArrayRegionCompareToNode(ValueNode arrayA,
ValueNode offsetA,
ValueNode arrayB,
ValueNode offsetB,
ValueNode length,
ValueNode dynamicStrides) |
|
ArrayRegionCompareToNode(ValueNode arrayA,
ValueNode offsetA,
ValueNode arrayB,
ValueNode offsetB,
ValueNode length,
ValueNode dynamicStrides,
org.graalvm.word.LocationIdentity locationIdentity) |
| Modifier and Type | Method and Description |
|---|---|
ValueNode |
canonical(CanonicalizerTool tool)
Implementations of this method can provide local optimizations like constant folding and
strength reduction.
|
static int |
compare(Object arrayA,
long offsetA,
Object arrayB,
long offsetB,
int length,
int stride) |
static int |
compare(Object arrayA,
long offsetA,
Object arrayB,
long offsetB,
int length,
JavaKind strideA,
JavaKind strideB) |
void |
generate(NodeLIRBuilderTool gen) |
protected void |
generateArrayCompare(NodeLIRBuilderTool gen) |
ValueNode |
getArrayA() |
ValueNode |
getArrayB() |
int |
getArrayBaseOffset(MetaAccessProvider metaAccess,
ValueNode array,
JavaKind elementKind) |
int |
getDirectStubCallIndex() |
MemoryKill |
getLastLocationAccess() |
ValueNode |
getLength() |
org.graalvm.word.LocationIdentity |
getLocationIdentity() |
ValueNode |
getOffsetA() |
ValueNode |
getOffsetB() |
JavaKind |
getStrideA() |
JavaKind |
getStrideB() |
void |
setLastLocationAccess(MemoryKill lla) |
asFixedWithNextNode, next, setNextasFixedNode, verifyasConstant, asJavaConstant, asNode, asSerializableConstant, checkReplaceAtUsagesInvariants, getStackKind, graph, hasUsagesOtherThan, inferStamp, 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, verifyEdges, verifyInputs, verifySourcePosition, withNodeSourcePositionclone, equals, getClass, notify, notifyAll, wait, wait, waitasNodeasFixedNodepublic static final NodeClass<ArrayRegionCompareToNode> TYPE
protected final JavaKind strideA
JavaKind of the arrays to compare.protected final JavaKind strideB
protected final org.graalvm.word.LocationIdentity locationIdentity
protected ValueNode arrayA
protected ValueNode offsetA
protected ValueNode arrayB
protected ValueNode offsetB
protected ValueNode length
protected ValueNode dynamicStrides
StrideUtil.protected MemoryKill lastLocationAccess
public ArrayRegionCompareToNode(ValueNode arrayA, ValueNode offsetA, ValueNode arrayB, ValueNode offsetB, ValueNode length, JavaKind strideA, JavaKind strideB, org.graalvm.word.LocationIdentity locationIdentity)
public ArrayRegionCompareToNode(ValueNode arrayA, ValueNode offsetA, ValueNode arrayB, ValueNode offsetB, ValueNode length, ValueNode dynamicStrides, org.graalvm.word.LocationIdentity locationIdentity)
public ArrayRegionCompareToNode(ValueNode arrayA, ValueNode offsetA, ValueNode arrayB, ValueNode offsetB, ValueNode length, ValueNode dynamicStrides)
public ArrayRegionCompareToNode(ValueNode arrayA, ValueNode offsetA, ValueNode arrayB, ValueNode offsetB, ValueNode length, JavaKind strideA, JavaKind strideB)
protected ArrayRegionCompareToNode(NodeClass<? extends ArrayRegionCompareToNode> c, ValueNode arrayA, ValueNode offsetA, ValueNode arrayB, ValueNode offsetB, ValueNode length, ValueNode dynamicStrides, JavaKind strideA, JavaKind strideB, org.graalvm.word.LocationIdentity locationIdentity)
public static int compare(Object arrayA, long offsetA, Object arrayB, long offsetB, int length, JavaKind strideA, JavaKind strideB)
public static int compare(Object arrayA, long offsetA, Object arrayB, long offsetB, int length, int stride)
public ValueNode getArrayA()
public ValueNode getOffsetA()
public ValueNode getArrayB()
public ValueNode getOffsetB()
public JavaKind getStrideA()
public JavaKind getStrideB()
public ValueNode getLength()
public int getDirectStubCallIndex()
public void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablepublic int getArrayBaseOffset(MetaAccessProvider metaAccess,
ValueNode array,
JavaKind elementKind)
getArrayBaseOffset in interface ConstantReflectionUtil.ArrayBaseOffsetProviderprotected void generateArrayCompare(NodeLIRBuilderTool gen)
public org.graalvm.word.LocationIdentity getLocationIdentity()
getLocationIdentity in interface MemoryAccesspublic MemoryKill getLastLocationAccess()
getLastLocationAccess in interface MemoryAccesspublic void setLastLocationAccess(MemoryKill lla)
setLastLocationAccess in interface MemoryAccesslla - the MemoryKill that represents the last kill of the
LocationIdentity returned by MemoryAccess.getLocationIdentity()public ValueNode 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 MetaAccessProvider