public abstract class BinaryNode extends FloatingNode implements Canonicalizable.Binary<ValueNode>
BinaryNode class is the base of arithmetic and logic operations with two inputs.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 |
|---|---|
static NodeClass<BinaryNode> |
TYPE |
protected ValueNode |
x |
protected ValueNode |
y |
EMPTY_ARRAY, stampNODE_LIST, NOT_ITERABLE, TRACK_CREATION_POSITION, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Modifier | Constructor and Description |
|---|---|
protected |
BinaryNode(NodeClass<? extends BinaryNode> c,
Stamp stamp,
ValueNode x,
ValueNode y)
Creates a new BinaryNode instance.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Stamp |
foldStamp(Stamp stampX,
Stamp stampY)
Compute an improved for this node using the passed in stamps.
|
ValueNode |
getX()
Gets the current value of the input, so that calling
Canonicalizable.Binary.canonical(CanonicalizerTool, Node, Node) with the value returned from this
method should behave exactly like Canonicalizable.canonical(CanonicalizerTool). |
ValueNode |
getY()
Gets the current value of the input, so that calling
Canonicalizable.Binary.canonical(CanonicalizerTool, Node, Node) with the value returned from this
method should behave exactly like Canonicalizable.canonical(CanonicalizerTool). |
boolean |
inferStamp()
This method can be overridden by subclasses of
ValueNode if they need to recompute
their stamp if their inputs change. |
void |
setX(ValueNode x) |
void |
setY(ValueNode y) |
asConstant, 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, waitcanonical, canonicalpublic static final NodeClass<BinaryNode> TYPE
protected ValueNode x
protected ValueNode y
protected BinaryNode(NodeClass<? extends BinaryNode> c, Stamp stamp, ValueNode x, ValueNode y)
stamp - the result type of this instructionx - the first input instructiony - the second input instructionpublic ValueNode getX()
Canonicalizable.BinaryCanonicalizable.Binary.canonical(CanonicalizerTool, Node, Node) with the value returned from this
method should behave exactly like Canonicalizable.canonical(CanonicalizerTool).getX in interface Canonicalizable.Binary<ValueNode>public ValueNode getY()
Canonicalizable.BinaryCanonicalizable.Binary.canonical(CanonicalizerTool, Node, Node) with the value returned from this
method should behave exactly like Canonicalizable.canonical(CanonicalizerTool).getY in interface Canonicalizable.Binary<ValueNode>public void setX(ValueNode x)
public void setY(ValueNode y)
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 abstract Stamp foldStamp(Stamp stampX, Stamp stampY)
BinaryNode.x and BinaryNode.y. This code is used to provide the
default implementation of BinaryNode.inferStamp() and may be used by external optimizations.stampX - stampY -