APIdia Launch Partner
Top Inners Fields Constructors Methods
java.lang.invoke

pack-priv final Class BootstrapMethodInvoker

extends Object
Class Inheritance
Imports
sun.invoke.util.Wrapper, java.lang.invoke.AbstractConstantGroup.BSCIWithCache, java.util.Arrays

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
private static class
BootstrapMethodInvoker.VM_BSCI<T>

Canonical VM-aware implementation of BootstrapCallInfo.

Field Summary

Modifier and TypeField and Description
private static final MethodType
private static final MethodType
private static final MethodType
private static final MethodType

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static <
the expected return type
T
>
T

Returns:

the expected value, either a CallSite or a constant value
invoke
(Class<T>
the expected return type (either CallSite or a constant type)
resultType
,
MethodHandle
the BSM to call
bootstrapMethod
,
String
the method name or constant name
name
,
Object
the method type or constant type
type
,
Object
information passed up from the JVM, to derive static arguments
info
,
Class<?>
the class containing the resolved method call or constant load
callerClass
)

Factored code for invoking a bootstrap method for invokedynamic or a dynamic constant.

private static Object
invokeWithManyArguments(MethodHandle bootstrapMethod, MethodHandles.Lookup caller, String name, Object type, Object[] argv)

private static boolean
private static boolean
private static boolean
private static boolean
private static Object
maybeReBox(Object x)

The JVM produces java.lang.Integer values to box CONSTANT_Integer boxes but does not intern them.

private static void
pack-priv static MethodHandle
pushMePullYou(MethodHandle bsm, boolean goToPushMode)

Given a push-mode BSM (taking one argument) convert it to a pull-mode BSM (taking N pre-resolved arguments).

pack-priv static <T> T
widenAndCast(Object result, Class<T> resultType)

If resultType is a reference type, do Class::cast on the result through an identity function of that type, as-type converted to return the corresponding reference wrapper type for resultType.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LMF_ALT_MTback to summary
private static final MethodType LMF_ALT_MT
LMF_INDY_MTback to summary
private static final MethodType LMF_INDY_MT
OBJECT_METHODS_MTback to summary
private static final MethodType OBJECT_METHODS_MT
SCF_MTback to summary
private static final MethodType SCF_MT

Constructor Detail

BootstrapMethodInvokerback to summary
pack-priv BootstrapMethodInvoker()

Method Detail

invokeback to summary
pack-priv static <T> T invoke(Class<T> resultType, MethodHandle bootstrapMethod, String name, Object type, Object info, Class<?> callerClass)

Factored code for invoking a bootstrap method for invokedynamic or a dynamic constant.

Parameters
<T>
the expected return type
resultType:Class<T>

the expected return type (either CallSite or a constant type)

bootstrapMethod:MethodHandle

the BSM to call

name:String

the method name or constant name

type:Object

the method type or constant type

info:Object

information passed up from the JVM, to derive static arguments

callerClass:Class<?>

the class containing the resolved method call or constant load

Returns:T

the expected value, either a CallSite or a constant value

invokeWithManyArgumentsback to summary
private static Object invokeWithManyArguments(MethodHandle bootstrapMethod, MethodHandles.Lookup caller, String name, Object type, Object[] argv) throws Throwable
isLambdaMetafactoryAltMetafactoryBSMback to summary
private static boolean isLambdaMetafactoryAltMetafactoryBSM(MethodType bsmType)
Returns:boolean

true iff the BSM method type exactly matches java.lang.invoke.LambdaMetafactory#altMetafactory( MethodHandles.Lookup, String, MethodType, Object[])

isLambdaMetafactoryIndyBSMback to summary
private static boolean isLambdaMetafactoryIndyBSM(MethodType bsmType)
Returns:boolean

true iff the BSM method type exactly matches java.lang.invoke.LambdaMetafactory#metafactory( MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)

isObjectMethodsBootstrapBSMback to summary
private static boolean isObjectMethodsBootstrapBSM(MethodType bsmType)
Returns:boolean

true iff the BSM method type exactly matches java.lang.runtime.ObjectMethods#bootstrap( MethodHandles.Lookup, String, TypeDescriptor, Class, String, MethodHandle[])

isStringConcatFactoryBSMback to summary
private static boolean isStringConcatFactoryBSM(MethodType bsmType)
Returns:boolean

true iff the BSM method type exactly matches java.lang.invoke.StringConcatFactory#makeConcatWithConstants(MethodHandles.Lookup, String, MethodType, String, Object...)

maybeReBoxback to summary
private static Object maybeReBox(Object x)

The JVM produces java.lang.Integer values to box CONSTANT_Integer boxes but does not intern them. Let's intern them. This is slightly wrong for a CONSTANT_Dynamic which produces an un-interned integer (e.g., new Integer(0)).

maybeReBoxElementsback to summary
private static void maybeReBoxElements(Object[] xa)
pushMePullYouback to summary
pack-priv static MethodHandle pushMePullYou(MethodHandle bsm, boolean goToPushMode)

Given a push-mode BSM (taking one argument) convert it to a pull-mode BSM (taking N pre-resolved arguments). This method is used when, in fact, the JVM is passing up pre-resolved arguments, but the BSM is expecting lazy stuff. Or, when goToPushMode is true, do the reverse transform. (The two transforms are exactly inverse.)

widenAndCastback to summary
pack-priv static <T> T widenAndCast(Object result, Class<T> resultType) throws Throwable

If resultType is a reference type, do Class::cast on the result through an identity function of that type, as-type converted to return the corresponding reference wrapper type for resultType. Works like MethodHandles.identity(resultType).invoke((Object)result). This utility function enforces type correctness of bootstrap method results. It is also used to enforce type correctness in other dependently-typed methods, such as classData.

java.lang.invoke back to summary

pack-priv final Class BootstrapMethodInvoker.PullAdapter

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final MethodHandle

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MH_pullFromBootstrapMethodback to summary
pack-priv static final MethodHandle MH_pullFromBootstrapMethod

Constructor Detail

PullAdapterback to summary
pack-priv PullAdapter()

Method Detail

pullFromBootstrapMethodback to summary
pack-priv static Object pullFromBootstrapMethod(MethodHandle pushModeBSM, MethodHandles.Lookup lookup, BootstrapCallInfo<?> bsci) throws Throwable
java.lang.invoke back to summary

pack-priv final Class BootstrapMethodInvoker.PushAdapter

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final MethodHandle

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object
pushToBootstrapMethod(MethodHandle pullModeBSM, MethodHandles.Lookup lookup, String name, Object type, Object... arguments)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MH_pushToBootstrapMethodback to summary
pack-priv static final MethodHandle MH_pushToBootstrapMethod

Constructor Detail

PushAdapterback to summary
pack-priv PushAdapter()

Method Detail

pushToBootstrapMethodback to summary
pack-priv static Object pushToBootstrapMethod(MethodHandle pullModeBSM, MethodHandles.Lookup lookup, String name, Object type, Object... arguments) throws Throwable
java.lang.invoke back to summary

private final Class BootstrapMethodInvoker.VM_BSCI<T>

extends AbstractConstantGroup.BSCIWithCache<T>
Class Inheritance

Canonical VM-aware implementation of BootstrapCallInfo. Knows how to dig into the JVM for lazily resolved (pull-mode) constants.

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final int[]
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv
VM_BSCI(MethodHandle bsm, String name, T type, MethodHandles.Lookup lookup, int[] indexInfo)

Method Summary

Modifier and TypeMethod and Description
public int
copyConstants(int start, int end, Object[] buf, int pos)

Overrides default java.lang.invoke.ConstantGroup.copyConstants.

Copy a sequence of constant values into a given buffer.

pack-priv Object
fillCache(int i)

Overrides java.lang.invoke.AbstractConstantGroup.WithCache.fillCache.

hook for local subclasses

private void
maybePrefetchIntoCache(int i, boolean bulk)

private void
prefetchIntoCache(int i, int pfLimit)

Inherited from java.lang.invoke.AbstractConstantGroup.BSCIWithCache:
bootstrapMethodinvocationNameinvocationTypetoString

Field Detail

callerback to summary
private final Class<?> caller
indexInfoback to summary
private final int[] indexInfo
MIN_PFback to summary
private static final int MIN_PF

Constructor Detail

VM_BSCIback to summary
pack-priv VM_BSCI(MethodHandle bsm, String name, T type, MethodHandles.Lookup lookup, int[] indexInfo)

Method Detail

copyConstantsback to summary
public int copyConstants(int start, int end, Object[] buf, int pos)

Overrides default java.lang.invoke.ConstantGroup.copyConstants.

Doc from java.lang.invoke.ConstantGroup.copyConstants.

Copy a sequence of constant values into a given buffer. This is equivalent to end-offset separate calls to get, for each index in the range from offset up to but not including end. For the first constant that cannot be resolved, a LinkageError is thrown, but only after preceding constant value have been stored.

Annotations
@Override
fillCacheback to summary
pack-priv Object fillCache(int i)

Overrides java.lang.invoke.AbstractConstantGroup.WithCache.fillCache.

Doc from java.lang.invoke.AbstractConstantGroup.WithCache.fillCache.

hook for local subclasses

Annotations
@Override
maybePrefetchIntoCacheback to summary
private void maybePrefetchIntoCache(int i, boolean bulk)
prefetchIntoCacheback to summary
private void prefetchIntoCache(int i, int pfLimit)