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

pack-priv final Class MethodTypeForm

extends Object
Class Inheritance
Imports
sun.invoke.util.Wrapper, java.lang.ref.SoftReference

Shared information for a group of method types, which differ only by reference types, and therefore share a common erasure and wrapping.

For an empirical discussion of the structure of method types, see the thread "Avoiding Boxing" on jvm-languages. There are approximately 2000 distinct erased method types in the JDK. There are a little over 10 times that number of unerased types. No more than half of these are likely to be loaded at once.

Author
John Rose

Field Summary

Modifier and TypeField and Description
pack-priv final MethodType
public static final int
pack-priv final MethodType
private SoftReference<MemberName>
private final SoftReference<LambdaForm>[]
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
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
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
private final SoftReference<MethodHandle>[]
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv final short
pack-priv final short
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected
MethodTypeForm(MethodType erasedType)

Build an MTF for a given type, which must have all references erased to Object.

Method Summary

Modifier and TypeMethod and Description
public MethodType
basicType()

Return the basic type derived from the erased type of this MT-form.

public MemberName
public LambdaForm
cachedLambdaForm(int which)

public MethodHandle
cachedMethodHandle(int which)

public static MethodType
canonicalize(MethodType mt, int how)

Canonicalize the types in the given method type.

pack-priv static Class<?>
canonicalize(Class<?> t, int how)

Canonicalize the given return or param type.

pack-priv static Class<?>[]
canonicalizeAll(Class<?>[] ts, int how)

Canonicalize each param type in the given array.

public MethodType
erasedType()

Return the type corresponding uniquely (1-1) to this MT-form.

pack-priv static MethodTypeForm
public boolean
public int
public int
public synchronized MemberName
public synchronized LambdaForm
public synchronized MethodHandle
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

basicTypeback to summary
pack-priv final MethodType basicType
ERASEback to summary
public static final int ERASE

Codes for canonicalize(java.lang.Class, int). ERASE means change every reference to Object. WRAP means convert primitives (including void to their corresponding wrapper types. UNWRAP means the reverse of WRAP.

erasedTypeback to summary
pack-priv final MethodType erasedType
interpretEntryback to summary
private SoftReference<MemberName> interpretEntry
lambdaFormsback to summary
private final SoftReference<LambdaForm>[] lambdaForms
LF_COLLECTORback to summary
pack-priv static final int LF_COLLECTOR
LF_CS_LINKERback to summary
pack-priv static final int LF_CS_LINKER
LF_DELEGATEback to summary
pack-priv static final int LF_DELEGATE
LF_DELEGATE_BLOCK_INLININGback to summary
pack-priv static final int LF_DELEGATE_BLOCK_INLINING
LF_EX_INVOKERback to summary
pack-priv static final int LF_EX_INVOKER
LF_EX_LINKERback to summary
pack-priv static final int LF_EX_LINKER
LF_GEN_INVOKERback to summary
pack-priv static final int LF_GEN_INVOKER
LF_GEN_LINKERback to summary
pack-priv static final int LF_GEN_LINKER
LF_GWCback to summary
pack-priv static final int LF_GWC
LF_GWTback to summary
pack-priv static final int LF_GWT
LF_INVINTERFACEback to summary
pack-priv static final int LF_INVINTERFACE
LF_INVNATIVEback to summary
pack-priv static final int LF_INVNATIVE
LF_INVSPECIALback to summary
pack-priv static final int LF_INVSPECIAL
LF_INVSPECIAL_IFCback to summary
pack-priv static final int LF_INVSPECIAL_IFC
LF_INVSTATICback to summary
pack-priv static final int LF_INVSTATIC
LF_INVSTATIC_INITback to summary
pack-priv static final int LF_INVSTATIC_INIT
LF_INVVIRTUALback to summary
pack-priv static final int LF_INVVIRTUAL
LF_LIMITback to summary
pack-priv static final int LF_LIMIT
LF_LOOPback to summary
pack-priv static final int LF_LOOP
LF_MH_LINKERback to summary
pack-priv static final int LF_MH_LINKER
LF_NEWINVSPECIALback to summary
pack-priv static final int LF_NEWINVSPECIAL
LF_REBINDback to summary
pack-priv static final int LF_REBIND
LF_TFback to summary
pack-priv static final int LF_TF
LF_VH_EX_INVOKERback to summary
pack-priv static final int LF_VH_EX_INVOKER
LF_VH_GEN_INVOKERback to summary
pack-priv static final int LF_VH_GEN_INVOKER
LF_VH_GEN_LINKERback to summary
pack-priv static final int LF_VH_GEN_LINKER
methodHandlesback to summary
private final SoftReference<MethodHandle>[] methodHandles
MH_BASIC_INVback to summary
pack-priv static final int MH_BASIC_INV
MH_LIMITback to summary
pack-priv static final int MH_LIMIT
MH_NF_INVback to summary
pack-priv static final int MH_NF_INV
MH_UNINIT_CSback to summary
pack-priv static final int MH_UNINIT_CS
parameterSlotCountback to summary
pack-priv final short parameterSlotCount
primitiveCountback to summary
pack-priv final short primitiveCount
UNWRAPback to summary
public static final int UNWRAP

Codes for canonicalize(java.lang.Class, int). ERASE means change every reference to Object. WRAP means convert primitives (including void to their corresponding wrapper types. UNWRAP means the reverse of WRAP.

WRAPback to summary
public static final int WRAP

Codes for canonicalize(java.lang.Class, int). ERASE means change every reference to Object. WRAP means convert primitives (including void to their corresponding wrapper types. UNWRAP means the reverse of WRAP.

Constructor Detail

MethodTypeFormback to summary
protected MethodTypeForm(MethodType erasedType)

Build an MTF for a given type, which must have all references erased to Object. This MTF will stand for that type and all un-erased variations. Eagerly compute some basic properties of the type, common to all variations.

Annotations
@SuppressWarnings:rawtypes, unchecked

Method Detail

basicTypeback to summary
public MethodType basicType()

Return the basic type derived from the erased type of this MT-form. A basic type is erased (all references Object) and also has all primitive types (except int, long, float, double, void) normalized to int. Such basic types correspond to low-level JVM calling sequences.

cachedInterpretEntryback to summary
public MemberName cachedInterpretEntry()
cachedLambdaFormback to summary
public LambdaForm cachedLambdaForm(int which)
cachedMethodHandleback to summary
public MethodHandle cachedMethodHandle(int which)
canonicalizeback to summary
public static MethodType canonicalize(MethodType mt, int how)

Canonicalize the types in the given method type. If any types change, intern the new type, and return it. Otherwise return null.

canonicalizeback to summary
pack-priv static Class<?> canonicalize(Class<?> t, int how)

Canonicalize the given return or param type. Return null if the type is already canonicalized.

canonicalizeAllback to summary
pack-priv static Class<?>[] canonicalizeAll(Class<?>[] ts, int how)

Canonicalize each param type in the given array. Return null if all types are already canonicalized.

erasedTypeback to summary
public MethodType erasedType()

Return the type corresponding uniquely (1-1) to this MT-form. It might have any primitive returns or arguments, but will have no references except Object.

findFormback to summary
pack-priv static MethodTypeForm findForm(MethodType mt)
hasPrimitivesback to summary
public boolean hasPrimitives()
parameterCountback to summary
public int parameterCount()
parameterSlotCountback to summary
public int parameterSlotCount()
setCachedInterpretEntryback to summary
public synchronized MemberName setCachedInterpretEntry(MemberName mn)
setCachedLambdaFormback to summary
public synchronized LambdaForm setCachedLambdaForm(int which, LambdaForm form)
setCachedMethodHandleback to summary
public synchronized MethodHandle setCachedMethodHandle(int which, MethodHandle mh)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override