public final class IntegerSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable
IntegerSwitchNode
represents a switch on integer keys, with a sorted array of key
values. The actual implementation of the switch will be decided by the backend.Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Modifier and Type | Field and Description |
---|---|
protected int[] |
keys |
static NodeClass<IntegerSwitchNode> |
TYPE |
keyProbabilities, keySuccessors, successors, value
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
IntegerSwitchNode(ValueNode value,
AbstractBeginNode[] successors,
int[] keys,
double[] keyProbabilities,
int[] keySuccessors) |
IntegerSwitchNode(ValueNode value,
int successorCount,
int[] keys,
double[] keyProbabilities,
int[] keySuccessors) |
Modifier and Type | Method and Description |
---|---|
private boolean |
assertSorted() |
boolean |
equalKeys(SwitchNode switchNode)
Returns true if the switch has the same keys in the same order as this switch.
|
void |
generate(NodeLIRBuilderTool gen) |
boolean |
isSorted() |
JavaConstant |
keyAt(int i)
Gets the key at the specified index.
|
int |
keyCount()
The number of distinct keys in this switch.
|
void |
simplify(SimplifierTool tool)
Must be overridden by subclasses that implement
Simplifiable . |
AbstractBeginNode |
successorAtKey(int key) |
int |
successorIndexAtKey(int key) |
blockSuccessor, blockSuccessorCount, defaultSuccessor, defaultSuccessorIndex, getPrimarySuccessor, keyProbability, keySuccessor, keySuccessorIndex, killOtherSuccessors, probability, setBlockSuccessor, structureEquals, value
asConstant, asJavaConstant, getKind, graph, inferStamp, 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, successors, toString, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verifyEdges, verifyInputs
public static final NodeClass<IntegerSwitchNode> TYPE
protected final int[] keys
public IntegerSwitchNode(ValueNode value, AbstractBeginNode[] successors, int[] keys, double[] keyProbabilities, int[] keySuccessors)
public IntegerSwitchNode(ValueNode value, int successorCount, int[] keys, double[] keyProbabilities, int[] keySuccessors)
private boolean assertSorted()
public boolean isSorted()
isSorted
in class SwitchNode
public JavaConstant keyAt(int i)
keyAt
in class SwitchNode
i
- the indexpublic int keyCount()
SwitchNode
keyCount
in class SwitchNode
public boolean equalKeys(SwitchNode switchNode)
SwitchNode
equalKeys
in class SwitchNode
public void generate(NodeLIRBuilderTool gen)
generate
in interface LIRLowerable
public AbstractBeginNode successorAtKey(int key)
public int successorIndexAtKey(int key)
public void simplify(SimplifierTool tool)
Node
Simplifiable
. The implementation in
Node
exists to obviate the need to cast a node before invoking
Simplifiable.simplify(SimplifierTool)
.simplify
in interface Simplifiable
simplify
in class Node