Home » openjdk-7 » java.lang.invoke » [javadoc | source]
java.lang.invoke
class: MethodTypeForm [javadoc | source]
java.lang.Object
   java.lang.invoke.MethodTypeForm
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.

Field Summary
final  int[] argToSlotTable     
final  int[] slotToArgTable     
final  long argCounts     
final  long primCounts     
final  int vmslots     
final  MethodType erasedType     
 MethodType primsAsBoxes     
 MethodType primArgsAsBoxes     
 MethodType primsAsInts     
 MethodType primsAsLongs     
 MethodType primsAtEnd     
 ToGeneric toGeneric     
 FromGeneric fromGeneric     
 SpreadGeneric[] spreadGeneric     
 FilterGeneric filterGeneric     
 MethodHandle genericInvoker     
public static final  int NO_CHANGE    Codes for #canonicalize(java.lang.Class, int) . ERASE means change every reference to {@code Object}. WRAP means convert primitives (including {@code void} to their corresponding wrapper types. UNWRAP means the reverse of WRAP. INTS means convert all non-void primitive types to int or long, according to size. LONGS means convert all non-void primitives to long, regardless of size. RAW_RETURN means convert a type (assumed to be a return type) to int if it is smaller than an int, or if it is void. 
public static final  int ERASE     
public static final  int WRAP     
public static final  int UNWRAP     
public static final  int INTS     
public static final  int LONGS     
public static final  int RAW_RETURN     
Constructor:
 protected MethodTypeForm(MethodType erasedType) 
Method from java.lang.invoke.MethodTypeForm Summary:
argSlotToParameter,   canonicalize,   canonicalize,   canonicalizes,   erasedType,   findForm,   hasLongPrimitives,   hasPrimitives,   longPrimitiveParameterCount,   longPrimitiveReturnCount,   notifyGenericMethodType,   parameterCount,   parameterSlotCount,   parameterToArgSlot,   primArgsAsBoxes,   primitiveParameterCount,   primitiveReturnCount,   primsAsBoxes,   primsAsInts,   primsAsLongs,   primsAtEnd,   primsAtEndOrder,   reorderParameters,   returnCount,   returnSlotCount,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.invoke.MethodTypeForm Detail:
 public int argSlotToParameter(int argSlot) 
 static Class<?> canonicalize(Class<?> t,
    int how) 
    Canonicalize the given return or param type. Return null if the type is already canonicalized.
 public static MethodType canonicalize(MethodType mt,
    int howRet,
    int howArgs) 
    Canonicalize the types in the given method type. If any types change, intern the new type, and return it. Otherwise return null.
 static Class<?>[] canonicalizes(Class<?>[] ts,
    int how) 
    Canonicalize each param type in the given array. Return null if all types are already canonicalized.
 public MethodType erasedType() 
 static MethodTypeForm findForm(MethodType mt) 
 public boolean hasLongPrimitives() 
 public boolean hasPrimitives() 
 public int longPrimitiveParameterCount() 
 public int longPrimitiveReturnCount() 
  void notifyGenericMethodType() 
 public int parameterCount() 
 public int parameterSlotCount() 
 public int parameterToArgSlot(int i) 
 public MethodType primArgsAsBoxes() 
    Turn all primitive argument types to corresponding wrapper types. Subword and void return types are promoted to int.
 public int primitiveParameterCount() 
 public int primitiveReturnCount() 
 public MethodType primsAsBoxes() 
    Turn all primitive types to corresponding wrapper types.
 public MethodType primsAsInts() 
    Turn all primitive types to either int or long. Floating point return types are not changed, because they may require special calling sequences. A void return value is turned to int.
 public MethodType primsAsLongs() 
    Turn all primitive types to either int or long. Floating point return types are not changed, because they may require special calling sequences. A void return value is turned to int.
 public MethodType primsAtEnd() 
    Stably sort parameters into 3 buckets: ref, int, long.
 public static int[] primsAtEndOrder(MethodType mt) 
    Compute a new ordering of parameters so that all references are before all ints or longs, and all ints are before all longs. For this ordering, doubles count as longs, and all other primitive values count as ints. As a special case, if the parameters are already in the specified order, this method returns a null reference, rather than an array specifying a null permutation.

    For example, the type {@code (int,boolean,int,Object,String)void} produces the order {@code {3,4,0,1,2}}, the type {@code (long,int,String)void} produces {@code {2,1,2}}, and the type {@code (Object,int)Object} produces {@code null}.

 public static MethodType reorderParameters(MethodType mt,
    int[] newParamOrder,
    Class<?>[] moreParams) 
    Put the existing parameters of mt into a new order, given by newParamOrder. The third argument is logically appended to mt.parameterArray, so that elements of newParamOrder can index either pre-existing or new parameter types.
 public int returnCount() 
 public int returnSlotCount() 
 public String toString()