public final class TypeSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable
TypeSwitchNode performs a lookup based on the type of the input value. The type
comparison is an exact type comparison, not an instanceof.Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable| Modifier and Type | Field and Description |
|---|---|
protected ResolvedJavaType[] |
keys |
static NodeClass<TypeSwitchNode> |
TYPE |
keyProbabilities, keySuccessors, successors, valueNODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges| Constructor and Description |
|---|
TypeSwitchNode(ValueNode value,
AbstractBeginNode[] successors,
ResolvedJavaType[] keys,
double[] keyProbabilities,
int[] keySuccessors) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
assertKeys()
Don't allow duplicate keys.
|
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 index)
The key at the specified position, encoded in a Constant.
|
int |
keyCount()
The number of distinct keys in this switch.
|
void |
simplify(SimplifierTool tool)
Must be overridden by subclasses that implement
Simplifiable. |
ResolvedJavaType |
typeAt(int index) |
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<TypeSwitchNode> TYPE
protected final ResolvedJavaType[] keys
public TypeSwitchNode(ValueNode value, AbstractBeginNode[] successors, ResolvedJavaType[] keys, double[] keyProbabilities, int[] keySuccessors)
private boolean assertKeys()
public boolean isSorted()
isSorted in class SwitchNodepublic int keyCount()
SwitchNodekeyCount in class SwitchNodepublic JavaConstant keyAt(int index)
SwitchNodekeyAt in class SwitchNodepublic boolean equalKeys(SwitchNode switchNode)
SwitchNodeequalKeys in class SwitchNodepublic ResolvedJavaType typeAt(int index)
public void generate(NodeLIRBuilderTool gen)
generate in interface LIRLowerablepublic 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