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, valueNODE_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, valueasConstant, asJavaConstant, getKind, graph, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStampacceptInputs, 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, verifyInputspublic 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 SwitchNodepublic JavaConstant keyAt(int i)
keyAt in class SwitchNodei - the indexpublic int keyCount()
SwitchNodekeyCount in class SwitchNodepublic boolean equalKeys(SwitchNode switchNode)
SwitchNodeequalKeys in class SwitchNodepublic void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablepublic AbstractBeginNode successorAtKey(int key)
public int successorIndexAtKey(int key)
public void simplify(SimplifierTool tool)
NodeSimplifiable. The implementation in
Node exists to obviate the need to cast a node before invoking
Simplifiable.simplify(SimplifierTool).simplify in interface Simplifiablesimplify in class Node