invokedynamic call sites that implement
the selection functionality of the switch statement. The bootstraps
take additional static arguments corresponding to the case labels
of the switch, implicitly numbered sequentially from [0..N).
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| pack-priv static record |
| Modifier and Type | Field and Description |
|---|---|
| private static final ClassDesc | |
| private static final ClassDesc | |
| private static final MethodTypeDesc | |
| private static final MethodHandles. | |
| private static final MethodType | |
| private static final MethodType | |
| private static final MethodTypeDesc | |
| private static final MethodTypeDesc | |
| private static final boolean | |
| private static final Object | |
| private static final List | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <E extends Enum | |
| public static CallSite | Returns: aCallSite returning the first matching element as described abovethe full-privilege lookup context of the caller lookup,unused, invocationName, MethodType null is permittedThe invocation type of the invocationType, Object... CallSite with two parameters,
an enum type, an int, and int as a return type.case labels - labels)String constants and Class instances,
in any combinationBootstrap method for linking an |
| private static MethodHandle | |
| private static Consumer | |
| private static boolean | |
| private static <T extends Enum | mappedEnumSwitch(T value, int restartIndex, MethodHandles.
|
| private static boolean | needsExtraInfo(Class<?> selectorType, Object[] labelConstants)
Check if the labelConstants can be converted statically to bytecode, or whether we'll need to compute and pass in extra information at the call site. |
| public static CallSite | Returns: aCallSite returning the first matching element as described abovethe full-privilege lookup context of the caller lookup,unused, invocationName, MethodType null is permittedThe invocation type of the invocationType, Object... CallSite with two parameters,
a target type, an int, and int as a return type.case labels as described above labels)Bootstrap method for linking an |
| private static String | |
| private static boolean | |
| private static void |
| CD_BiPredicate | back to summary |
|---|---|
| private static final ClassDesc CD_BiPredicate | |
| CD_Objects | back to summary |
|---|---|
| private static final ClassDesc CD_Objects | |
| CHECK_INDEX_DESCRIPTOR | back to summary |
|---|---|
| private static final MethodTypeDesc CHECK_INDEX_DESCRIPTOR | |
| LOOKUP | back to summary |
|---|---|
| private static final MethodHandles. | |
| MT_TYPE_SWITCH | back to summary |
|---|---|
| private static final MethodType MT_TYPE_SWITCH | |
| MT_TYPE_SWITCH_EXTRA | back to summary |
|---|---|
| private static final MethodType MT_TYPE_SWITCH_EXTRA | |
| MTD_TYPE_SWITCH | back to summary |
|---|---|
| private static final MethodTypeDesc MTD_TYPE_SWITCH | |
| MTD_TYPE_SWITCH_EXTRA | back to summary |
|---|---|
| private static final MethodTypeDesc MTD_TYPE_SWITCH_EXTRA | |
| previewEnabled | back to summary |
|---|---|
| private static final boolean previewEnabled | |
| SENTINEL | back to summary |
|---|---|
| private static final Object SENTINEL | |
| TYPE_SWITCH_EXTRA_LOCALS | back to summary |
|---|---|
| private static final List<StackMapFrameInfo. | |
| TYPE_SWITCH_LOCALS | back to summary |
|---|---|
| private static final List<StackMapFrameInfo. | |
| SwitchBootstraps | back to summary |
|---|---|
| private SwitchBootstraps() | |
| convertEnumConstants | back to summary |
|---|---|
| private static <E extends Enum | |
| enumSwitch | back to summary |
|---|---|
| public static CallSite enumSwitch(MethodHandles. Bootstrap method for linking an
The returned
If the
If the
If for a given
The value of the API Note It is permissible for the
| |
| generateTypeSwitch | back to summary |
|---|---|
| private static MethodHandle generateTypeSwitch(MethodHandles. | |
| generateTypeSwitchSkeleton | back to summary |
|---|---|
| private static Consumer | |
| isNotValidPair | back to summary |
|---|---|
| private static boolean isNotValidPair(Class<?> selectorType, Object caseLabel) | |
| mappedEnumSwitch | back to summary |
|---|---|
| private static <T extends Enum | |
| needsExtraInfo | back to summary |
|---|---|
| private static boolean needsExtraInfo(Class<?> selectorType, Object[] labelConstants) Check if the labelConstants can be converted statically to bytecode, or whether we'll need to compute and pass in extra information at the call site. | |
| typeSwitch | back to summary |
|---|---|
| public static CallSite typeSwitch(MethodHandles. Bootstrap method for linking an
The type of the returned
If the
If the
If no element in the
The value of the
| |
| typeSwitchClassName | back to summary |
|---|---|
| private static String typeSwitchClassName(Class<?> targetClass) | |
| unconditionalExactnessCheck | back to summary |
|---|---|
| private static boolean unconditionalExactnessCheck(Class<?> selectorType, Class<?> targetType) | |
| verifyLabel | back to summary |
|---|---|
| private static void verifyLabel(Object label, Class<?> selectorType) | |
| Modifier and Type | Field and Description |
|---|---|
| public int[] | |
| public MethodHandle |
| Access | Constructor and Description |
|---|---|
| private |
| constantsMap | back to summary |
|---|---|
| public int[] constantsMap
| |
| generatedSwitch | back to summary |
|---|---|
| public MethodHandle generatedSwitch
| |
| MappedEnumCache | back to summary |
|---|---|
| private MappedEnumCache() | |
| Modifier and Type | Field and Description |
|---|---|
| private final Enum. | |
| private final MethodHandles. | |
| private final Object[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | test(Integer labelIndex, Object value)
Implements java. Evaluates this predicate on the given arguments. |
| enumDescs | back to summary |
|---|---|
| private final Enum. | |
| lookup | back to summary |
|---|---|
| private final MethodHandles. | |
| resolvedEnum | back to summary |
|---|---|
| private final Object[] resolvedEnum
| |
| ResolvedEnumLabels | back to summary |
|---|---|
| public ResolvedEnumLabels(MethodHandles. | |
| test | back to summary |
|---|---|
| public boolean test(Integer labelIndex, Object value) Implements java. Doc from java. Evaluates this predicate on the given arguments.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final MethodHandle |
| Access | Constructor and Description |
|---|---|
| private |
| MAPPED_ENUM_SWITCH | back to summary |
|---|---|
| private static final MethodHandle MAPPED_ENUM_SWITCH | |
| StaticHolders | back to summary |
|---|---|
| private StaticHolders() | |
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private final Class | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object other)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public Class | |
| public int | |
| public static Map | |
| public static SwitchBootstraps. | |
| public Class | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| from | back to summary |
|---|---|
| private final Class<?> from Record Component accessed by from(). | |
| to | back to summary |
|---|---|
| private final Class<?> to Record Component accessed by to(). | |
| typePairToName | back to summary |
|---|---|
| private static final Map<SwitchBootstraps. | |
| TypePairs | back to summary |
|---|---|
| pack-priv TypePairs(Class<?> from, Class<?> to) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| from | back to summary |
|---|---|
| public Class Record Component getter of from. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| initialize | back to summary |
|---|---|
| public static Map | |
| of | back to summary |
|---|---|
| public static SwitchBootstraps. | |
| to | back to summary |
|---|---|
| public Class Record Component getter of to. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |