| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | MethodHandleNatives.
Compile-time constants go here. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static native void | copyOutBootstrapArguments(Class<?> caller, int[] indexInfo, int start, int end, Object[] buf, int pos, boolean resolve, Object ifNotAvailable)
|
| pack-priv static native void | |
| pack-priv static MethodType | |
| private static MethodType | |
| private static String | |
| pack-priv static char | |
| pack-priv static native Object | |
| private static native int | |
| pack-priv static String | |
| pack-priv static native void | |
| pack-priv static <E extends Error> E | initCauseFrom(E err, Exception ex)
Use best possible cause for err.initCause(), substituting the cause for err itself if the cause has the same (or better) type. |
| pack-priv static boolean | |
| pack-priv static boolean | isPullModeBSM(MethodHandle bsm)
A BSM runs in pull-mode if and only if its sole arguments are (Lookup, BootstrapCallInfo), or can be converted pairwise to those types, and it is not of variable arity. |
| pack-priv static MemberName | |
| pack-priv static MemberName | linkCallSiteImpl(Class<?> caller, MethodHandle bootstrapMethod, String name, MethodType type, Object staticArguments, Object[] appendixResult)
|
| pack-priv static MemberName | linkCallSiteTracing(Class<?> caller, MethodHandle bootstrapMethod, String name, MethodType type, Object staticArguments, Object[] appendixResult)
|
| pack-priv static Object | |
| pack-priv static Object | linkDynamicConstantImpl(Class<?> caller, MethodHandle bootstrapMethod, String name, Class<?> type, Object staticArguments)
|
| pack-priv static Object | linkDynamicConstantTracing(Class<?> caller, MethodHandle bootstrapMethod, String name, Class<?> type, Object staticArguments)
|
| pack-priv static MemberName | |
| pack-priv static MethodHandle | linkMethodHandleConstant(Class<?> callerClass, int refKind, Class<?> defc, String name, Object type)
The JVM is resolving a CONSTANT_MethodHandle CP entry. |
| pack-priv static MemberName | |
| pack-priv static MemberName | |
| pack-priv static LinkageError | mapLookupExceptionToError(ReflectiveOperationException ex)
Map a reflective exception to a linkage error. |
| pack-priv static NoSuchMethodError | |
| pack-priv static native long | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static boolean | |
| pack-priv static String | |
| private static native void | |
| pack-priv static native MemberName | |
| pack-priv static native void | setCallSiteTargetNormal(CallSite site, MethodHandle target)
Tell the JVM that we need to change the target of a CallSite. |
| pack-priv static native void | |
| private static String | |
| pack-priv static boolean | staticArgumentsPulled(Object staticArguments)
The JVM is requesting pull-mode bootstrap when it provides a tuple of the form int[]{ argc, vmindex }. |
| pack-priv static native Object | |
| pack-priv static native long | |
| private static MemberName | varHandleOperationLinkerMethod(String name, MethodType mtype, Object[] appendixResult)
Obtain the method to link to the VarHandle operation. |
| pack-priv static boolean |
| MethodHandleNatives | back to summary |
|---|---|
| private MethodHandleNatives() | |
| canBeCalledVirtual | back to summary |
|---|---|
| pack-priv static boolean canBeCalledVirtual(MemberName mem) | |
| canBeCalledVirtual | back to summary |
|---|---|
| pack-priv static boolean canBeCalledVirtual(MemberName symbolicRef, Class<?> definingClass) | |
| copyOutBootstrapArguments | back to summary |
|---|---|
| pack-priv static native void copyOutBootstrapArguments(Class<?> caller, int[] indexInfo, int start, int end, Object[] buf, int pos, boolean resolve, Object ifNotAvailable) | |
| expand | back to summary |
|---|---|
| pack-priv static native void expand(MemberName self) | |
| findMethodHandleType | back to summary |
|---|---|
| pack-priv static MethodType findMethodHandleType(Class<?> rtype, Class<?>[] ptypes) The JVM wants a pointer to a MethodType. Oblige it by finding or creating one. | |
| fixMethodType | back to summary |
|---|---|
| private static MethodType fixMethodType(Class<?> callerClass, Object type) | |
| getCallerInfo | back to summary |
|---|---|
| private static String getCallerInfo(Class<?> caller) Return a human-readable description of the caller. Something like
"java.base/java.security.Security. | |
| getCharType | back to summary |
|---|---|
| pack-priv static char getCharType(Class<?> pt) | |
| getMemberVMInfo | back to summary |
|---|---|
| pack-priv static native Object getMemberVMInfo(MemberName self) | |
| getNamedCon | back to summary |
|---|---|
| private static native int getNamedCon(int which, Object[] name) | |
| getVarHandleGuardMethodName | back to summary |
|---|---|
| pack-priv static String getVarHandleGuardMethodName(MethodType guardType) | |
| init | back to summary |
|---|---|
| pack-priv static native void init(MemberName self, Object ref) | |
| initCauseFrom | back to summary |
|---|---|
| pack-priv static <E extends Error> E initCauseFrom(E err, Exception ex) Use best possible cause for err.initCause(), substituting the cause for err itself if the cause has the same (or better) type. | |
| isCallerSensitive | back to summary |
|---|---|
| pack-priv static boolean isCallerSensitive(MemberName mem) Is this method a caller-sensitive method? I.e., does it call Reflection.getCallerClass or a similar method to ask about the identity of its caller? | |
| isPullModeBSM | back to summary |
|---|---|
| pack-priv static boolean isPullModeBSM(MethodHandle bsm) A BSM runs in pull-mode if and only if its sole arguments are (Lookup, BootstrapCallInfo), or can be converted pairwise to those types, and it is not of variable arity. Excluding error cases, we can just test that the arity is a constant 2. Note This method currently returns false, since pulling is not currently exposed to a BSM. When pull mode is supported the method block will be replaced with currently commented out code. | |
| linkCallSite | back to summary |
|---|---|
| pack-priv static MemberName linkCallSite(Object callerObj, Object bootstrapMethodObj, Object nameObj, Object typeObj, Object staticArguments, Object[] appendixResult) The JVM is linking an invokedynamic instruction. Create a reified call site for it. | |
| linkCallSiteImpl | back to summary |
|---|---|
| pack-priv static MemberName linkCallSiteImpl(Class<?> caller, MethodHandle bootstrapMethod, String name, MethodType type, Object staticArguments, Object[] appendixResult) | |
| linkCallSiteTracing | back to summary |
|---|---|
| pack-priv static MemberName linkCallSiteTracing(Class<?> caller, MethodHandle bootstrapMethod, String name, MethodType type, Object staticArguments, Object[] appendixResult) | |
| linkDynamicConstant | back to summary |
|---|---|
| pack-priv static Object linkDynamicConstant(Object callerObj, Object bootstrapMethodObj, Object nameObj, Object typeObj, Object staticArguments) | |
| linkDynamicConstantImpl | back to summary |
|---|---|
| pack-priv static Object linkDynamicConstantImpl(Class<?> caller, MethodHandle bootstrapMethod, String name, Class<?> type, Object staticArguments) | |
| linkDynamicConstantTracing | back to summary |
|---|---|
| pack-priv static Object linkDynamicConstantTracing(Class<?> caller, MethodHandle bootstrapMethod, String name, Class<?> type, Object staticArguments) | |
| linkMethod | back to summary |
|---|---|
| pack-priv static MemberName linkMethod(Class<?> callerClass, int refKind, Class<?> defc, String name, Object type, Object[] appendixResult) The JVM wants to link a call site that requires a dynamic type check. Name is a type-checking invoker, invokeExact or invoke. Return a JVM method (MemberName) to handle the invoking. The method assumes the following arguments on the stack: 0: the method handle being invoked 1-N: the arguments to the method handle invocation N+1: an optional, implicitly added argument (typically the given MethodType)
The nominal method at such a call site is an instance of
a signature-polymorphic method (see @PolymorphicSignature).
Such method instances are user-visible entities which are
"split" from the generic placeholder method in
The JVM is allowed to reify this method as instance metadata.
For example,
Linker methods are allowed to be weakly typed, with any or
all references rewritten to
The JVM does not inspect the appendix, other than to pass
it verbatim to the linker method at every call.
This means that the JDK runtime has wide latitude
for choosing the shape of each linker method and its
corresponding appendix.
Linker methods should be generated from
The
If the JVM does not reify a method at a call site, but instead
calls | |
| linkMethodHandleConstant | back to summary |
|---|---|
| pack-priv static MethodHandle linkMethodHandleConstant(Class<?> callerClass, int refKind, Class<?> defc, String name, Object type) The JVM is resolving a CONSTANT_MethodHandle CP entry. And it wants our help. It will make an up-call to this method. (Do not change the name or signature.) The type argument is a Class for field requests and a MethodType for non-fields. Recent versions of the JVM may also pass a resolved MemberName for the type. In that case, the name is ignored and may be null. | |
| linkMethodImpl | back to summary |
|---|---|
| pack-priv static MemberName linkMethodImpl(Class<?> callerClass, int refKind, Class<?> defc, String name, Object type, Object[] appendixResult) | |
| linkMethodTracing | back to summary |
|---|---|
| pack-priv static MemberName linkMethodTracing(Class<?> callerClass, int refKind, Class<?> defc, String name, Object type, Object[] appendixResult) | |
| mapLookupExceptionToError | back to summary |
|---|---|
| pack-priv static LinkageError mapLookupExceptionToError(ReflectiveOperationException ex) Map a reflective exception to a linkage error. | |
| newNoSuchMethodErrorOnVarHandle | back to summary |
|---|---|
| pack-priv static NoSuchMethodError newNoSuchMethodErrorOnVarHandle(String name, MethodType mtype) | |
| objectFieldOffset | back to summary |
|---|---|
| pack-priv static native long objectFieldOffset(MemberName self) | |
| refKindDoesDispatch | back to summary |
|---|---|
| pack-priv static boolean refKindDoesDispatch(byte refKind) | |
| refKindHasReceiver | back to summary |
|---|---|
| pack-priv static boolean refKindHasReceiver(byte refKind) | |
| refKindIsConstructor | back to summary |
|---|---|
| pack-priv static boolean refKindIsConstructor(byte refKind) | |
| refKindIsField | back to summary |
|---|---|
| pack-priv static boolean refKindIsField(byte refKind) | |
| refKindIsGetter | back to summary |
|---|---|
| pack-priv static boolean refKindIsGetter(byte refKind) | |
| refKindIsMethod | back to summary |
|---|---|
| pack-priv static boolean refKindIsMethod(byte refKind) | |
| refKindIsSetter | back to summary |
|---|---|
| pack-priv static boolean refKindIsSetter(byte refKind) | |
| refKindIsStatic | back to summary |
|---|---|
| pack-priv static boolean refKindIsStatic(byte refKind) | |
| refKindIsValid | back to summary |
|---|---|
| pack-priv static boolean refKindIsValid(int refKind) | |
| refKindName | back to summary |
|---|---|
| pack-priv static String refKindName(byte refKind) | |
| registerNatives | back to summary |
|---|---|
| private static native void registerNatives() | |
| resolve | back to summary |
|---|---|
| pack-priv static native MemberName resolve(MemberName self, Class<?> caller, int lookupMode, boolean speculativeResolve) throws LinkageError, ClassNotFoundException | |
| setCallSiteTargetNormal | back to summary |
|---|---|
| pack-priv static native void setCallSiteTargetNormal(CallSite site, MethodHandle target) Tell the JVM that we need to change the target of a CallSite. | |
| setCallSiteTargetVolatile | back to summary |
|---|---|
| pack-priv static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target) | |
| staticArglistForTrace | back to summary |
|---|---|
| private static String staticArglistForTrace(Object staticArguments) | |
| staticArgumentsPulled | back to summary |
|---|---|
| pack-priv static boolean staticArgumentsPulled(Object staticArguments) The JVM is requesting pull-mode bootstrap when it provides a tuple of the form int[]{ argc, vmindex }. The BSM is expected to call back to the JVM using the caller class and vmindex to resolve the static arguments. | |
| staticFieldBase | back to summary |
|---|---|
| pack-priv static native Object staticFieldBase(MemberName self) | |
| staticFieldOffset | back to summary |
|---|---|
| pack-priv static native long staticFieldOffset(MemberName self) | |
| varHandleOperationLinkerMethod | back to summary |
|---|---|
| private static MemberName varHandleOperationLinkerMethod(String name, MethodType mtype, Object[] appendixResult) Obtain the method to link to the VarHandle operation. This method is located here and not in Invokers to avoid initializing that and other classes early on in VM bootup. | |
| verifyConstants | back to summary |
|---|---|
| pack-priv static boolean verifyConstants() | |
verifyConstants()).
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | ACCESS_VM_ANNOTATIONS
Flags for Lookup.ClassOptions |
| pack-priv static final int | HIDDEN_CLASS
Flags for Lookup.ClassOptions |
| pack-priv static final int | LM_MODULE
Lookup modes |
| pack-priv static final int | LM_TRUSTED
Lookup modes |
| pack-priv static final int | LM_UNCONDITIONAL
Lookup modes |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | NESTMATE_CLASS
Flags for Lookup.ClassOptions |
| pack-priv static final byte | REF_getField
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_getStatic
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_invokeInterface
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_invokeSpecial
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_invokeStatic
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_invokeVirtual
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_LIMIT
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_newInvokeSpecial
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_NONE
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_putField
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final byte | REF_putStatic
Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. |
| pack-priv static final int | STRONG_LOADER_LINK
Flags for Lookup.ClassOptions |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| ACCESS_VM_ANNOTATIONS | back to summary |
|---|---|
| pack-priv static final int ACCESS_VM_ANNOTATIONS Flags for Lookup.ClassOptions | |
| HIDDEN_CLASS | back to summary |
|---|---|
| pack-priv static final int HIDDEN_CLASS Flags for Lookup.ClassOptions | |
| LM_MODULE | back to summary |
|---|---|
| pack-priv static final int LM_MODULE Lookup modes | |
| LM_TRUSTED | back to summary |
|---|---|
| pack-priv static final int LM_TRUSTED Lookup modes | |
| LM_UNCONDITIONAL | back to summary |
|---|---|
| pack-priv static final int LM_UNCONDITIONAL Lookup modes | |
| MN_CALLER_SENSITIVE | back to summary |
|---|---|
| pack-priv static final int MN_CALLER_SENSITIVE | |
| MN_HIDDEN_MEMBER | back to summary |
|---|---|
| pack-priv static final int MN_HIDDEN_MEMBER | |
| MN_IS_CONSTRUCTOR | back to summary |
|---|---|
| pack-priv static final int MN_IS_CONSTRUCTOR | |
| MN_IS_FIELD | back to summary |
|---|---|
| pack-priv static final int MN_IS_FIELD | |
| MN_IS_METHOD | back to summary |
|---|---|
| pack-priv static final int MN_IS_METHOD | |
| MN_IS_TYPE | back to summary |
|---|---|
| pack-priv static final int MN_IS_TYPE | |
| MN_REFERENCE_KIND_MASK | back to summary |
|---|---|
| pack-priv static final int MN_REFERENCE_KIND_MASK | |
| MN_REFERENCE_KIND_SHIFT | back to summary |
|---|---|
| pack-priv static final int MN_REFERENCE_KIND_SHIFT | |
| MN_TRUSTED_FINAL | back to summary |
|---|---|
| pack-priv static final int MN_TRUSTED_FINAL | |
| NESTMATE_CLASS | back to summary |
|---|---|
| pack-priv static final int NESTMATE_CLASS Flags for Lookup.ClassOptions | |
| REF_getField | back to summary |
|---|---|
| pack-priv static final byte REF_getField Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_getStatic | back to summary |
|---|---|
| pack-priv static final byte REF_getStatic Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_invokeInterface | back to summary |
|---|---|
| pack-priv static final byte REF_invokeInterface Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_invokeSpecial | back to summary |
|---|---|
| pack-priv static final byte REF_invokeSpecial Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_invokeStatic | back to summary |
|---|---|
| pack-priv static final byte REF_invokeStatic Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_invokeVirtual | back to summary |
|---|---|
| pack-priv static final byte REF_invokeVirtual Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_LIMIT | back to summary |
|---|---|
| pack-priv static final byte REF_LIMIT Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_newInvokeSpecial | back to summary |
|---|---|
| pack-priv static final byte REF_newInvokeSpecial Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_NONE | back to summary |
|---|---|
| pack-priv static final byte REF_NONE Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_putField | back to summary |
|---|---|
| pack-priv static final byte REF_putField Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| REF_putStatic | back to summary |
|---|---|
| pack-priv static final byte REF_putStatic Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. | |
| STRONG_LOADER_LINK | back to summary |
|---|---|
| pack-priv static final int STRONG_LOADER_LINK Flags for Lookup.ClassOptions | |
| Constants | back to summary |
|---|---|
| pack-priv Constants() | |