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, value
NODE_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, 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<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 SwitchNode
public int keyCount()
SwitchNode
keyCount
in class SwitchNode
public JavaConstant keyAt(int index)
SwitchNode
keyAt
in class SwitchNode
public boolean equalKeys(SwitchNode switchNode)
SwitchNode
equalKeys
in class SwitchNode
public ResolvedJavaType typeAt(int index)
public void generate(NodeLIRBuilderTool gen)
generate
in interface LIRLowerable
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