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 jdk.internal.jvmci.meta.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,
jdk.internal.jvmci.meta.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() |
jdk.internal.jvmci.meta.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) |
jdk.internal.jvmci.meta.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 jdk.internal.jvmci.meta.ResolvedJavaType[] keys
public TypeSwitchNode(ValueNode value, AbstractBeginNode[] successors, jdk.internal.jvmci.meta.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 jdk.internal.jvmci.meta.JavaConstant keyAt(int index)
SwitchNode
keyAt
in class SwitchNode
public boolean equalKeys(SwitchNode switchNode)
SwitchNode
equalKeys
in class SwitchNode
public jdk.internal.jvmci.meta.ResolvedJavaType typeAt(int index)
public void generate(NodeLIRBuilderTool gen)
generate
in interface LIRLowerable
public void simplify(SimplifierTool tool)
simplify
in interface Simplifiable
simplify
in class Node