IllegalArgumentException
if the created method handle's type
would have too many parameters.
Modifier and Type | Class and Description |
---|---|
public static class | MethodHandles.
A lookup object is a factory for creating method handles, when the creation requires access checking. |
Modifier and Type | Field and Description |
---|---|
private static final MethodHandle[] | |
pack-priv static final MemberName. | |
private static final MethodHandle[] |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
private static MethodHandle | argumentsWithCombiner(boolean filter, MethodHandle target, int position, MethodHandle combiner, int... argPositions)
|
private static Class | argumentsWithCombinerChecks(int position, boolean filter, MethodType targetType, MethodType combinerType, int... argPos)
|
public static MethodHandle | Returns: a method handle which can create arrays of the given typean array type arrayClass)Produces a method handle constructing arrays of a desired type,
as if by the |
public static MethodHandle | Returns: a method handle which can load values from the given array typean array type arrayClass)Produces a method handle giving read access to elements of an array,
as if by the |
public static MethodHandle | Returns: a method handle which can store values into the array typethe class of an array arrayClass)Produces a method handle giving write access to elements of an array,
as if by the |
public static VarHandle | Returns: a VarHandle giving access to elements of an arraythe class of an array, of type arrayClass)T[] Produces a VarHandle giving access to elements of an array of type
|
public static MethodHandle | Returns: a method handle which can retrieve the length of an array of the given array typean array type arrayClass)Produces a method handle returning the length of an array,
as if by the |
pack-priv static MethodHandle | |
private static List | buildCommonSuffix(List<MethodHandle> init, List<MethodHandle> step, List<MethodHandle> pred, List<MethodHandle> fini, int cpSize)
|
public static VarHandle | Returns: a VarHandle giving access to elements of abyte[] array
viewed as if elements corresponding to the components type of the view
array classthe view array class, with a component type of
type viewArrayClass, ByteOrder T the endianness of the view array elements, as
stored in the underlying byteOrder)byte arrayProduces a VarHandle giving access to elements of a |
public static VarHandle | Returns: a VarHandle giving access to elements of aByteBuffer
viewed as if elements corresponding to the components type of the view
array classthe view array class, with a component type of
type viewArrayClass, ByteOrder T the endianness of the view array elements, as
stored in the underlying byteOrder)ByteBuffer (Note this overrides the
endianness of a ByteBuffer )Produces a VarHandle giving access to elements of a |
public static MethodHandle | Returns: method handle which incorporates the specified try/catch logicmethod handle to call target, Class<? extends Throwable> the type of exception which the handler will catch exType, MethodHandle method handle to call if a matching exception is thrown handler)Makes a method handle which adapts a target method handle, by running it inside an exception handler. |
public static < the type to cast the class data object to T> T | Returns: the value of the class data if present in the lookup class; otherwisenull the lookup context describing the class performing the
operation (normally stacked by the JVM) caller,must be name, Class<T> ConstantDescs#DEFAULT_NAME
("_" )the type of the class data type)Returns the class data associated with the lookup class
of the given |
pack-priv static Object | |
public static < the type to cast the result object to T> T | Returns: the element at the given index in the class data if the class data is present; otherwisenull the lookup context describing the class performing the
operation (normally stacked by the JVM) caller,must be name, Class<T> java.
("_" )the type of the element at the given index in the class data type, int index of the element in the class data index)Returns the element at the specified index in the
class data,
if the class data associated with the lookup class
of the given |
public static MethodHandle | Returns: method handle which incorporates the specified argument subsequence filtering logicthe method handle to invoke after filtering the subsequence of arguments target, int the position of the first adapter argument to pass to the filter,
and/or the target argument which receives the result of the filter pos, MethodHandle method handle to call on the subsequence of arguments filter)Adapts a target method handle by pre-processing a sub-sequence of its arguments with a filter (another method handle). |
private static MethodType | |
public static VarHandle | Returns: an adapter var handle which filters the incoming coordinate values, before calling the target var handlethe var handle to invoke after the coordinates have been filtered target, int the position in the coordinate list of the target var handle where the filter is to be inserted pos, MethodHandle the filter method handle filter)Adapts a target var handle by pre-processing a sub-sequence of its coordinate values with a filter (a method handle). |
pack-priv static MethodHandle | Returns: the adapter method handlethe target method handle target, MethodHandle the filter method handle filter)Filter the return value of a target method handle with a filter function. |
public static MethodHandle | Returns: a method handle of the given return type and no arguments, which always returns the given valuethe return type of the desired method handle type, Object the value to return value)Produces a method handle of the requested return type which returns the given constant value every time it is invoked. |
public static MethodHandle | Returns: a method handle representing the loop.a non- iterations, MethodHandle null handle to return the number of iterations this loop should run. The handle's
result type must be int . See above for other constraints.optional initializer, providing the initial value of the loop variable.
May be init, MethodHandle null , implying a default initial value. See above for other constraints.body of the loop, which may not be body)null .
It controls the loop parameters and result type in the standard case (see above for details).
It must accept its own return type (if non-void) plus an int parameter (for the counter),
and may accept any number of additional types.
See above for other constraints.Constructs a loop that runs a given number of iterations. |
public static MethodHandle | Returns: a method handle representing the loop.a non- start, MethodHandle null handle to return the start value of the loop counter, which must be int .
See above for other constraints.a non- end, MethodHandle null handle to return the end value of the loop counter (the loop will run to
end-1 ). The result type must be int . See above for other constraints.optional initializer, providing the initial value of the loop variable.
May be init, MethodHandle null , implying a default initial value. See above for other constraints.body of the loop, which may not be body)null .
It controls the loop parameters and result type in the standard case (see above for details).
It must accept its own return type (if non-void) plus an int parameter (for the counter),
and may accept any number of additional types.
See above for other constraints.Constructs a loop that counts over a range of numbers. |
private static void | |
public static MethodHandle | Returns: a method handle implementing thewhile loop as described by the arguments.optional initializer, providing the initial value of the loop variable.
May be init, MethodHandle null , implying a default initial value. See above for other constraints.body of the loop, which may not be body, MethodHandle null . It controls the loop parameters and result type.
See above for other constraints.condition for the loop, which may not be pred)null . Its result type must be boolean . See
above for other constraints.Constructs a |
private static int | |
public static MethodHandle | Returns: a method handle which drops arguments of the given types, before calling the original method handlethe method handle to invoke after the arguments are dropped target, int position of first argument to drop (zero for the leftmost) pos, List<Class<?>> the type(s) of the argument(s) to drop valueTypes)Produces a method handle which will discard some dummy arguments before calling some other specified target method handle. |
public static MethodHandle | Returns: a method handle which drops arguments of the given types, before calling the original method handlethe method handle to invoke after the arguments are dropped target, int position of first argument to drop (zero for the leftmost) pos, Class<?>... the type(s) of the argument(s) to drop valueTypes)Produces a method handle which will discard some dummy arguments before calling some other specified target method handle. |
pack-priv static MethodHandle | |
pack-priv static MethodHandle | |
private static MethodHandle | dropArgumentsToMatch(MethodHandle target, int skip, Class<?>[] newTypes, int pos, boolean nullOnFailure)
|
public static MethodHandle | Returns: a possibly adapted method handlethe method handle to adapt target, int number of targets parameters to disregard (they will be unchanged) skip, List<Class<?>> the list of types to match newTypes, int target 's parameter type list toplace in pos)newTypes where the non-skipped target parameters must occurAdapts a target method handle to match the given parameter type list. |
pack-priv static MethodHandle | |
public static VarHandle | Returns: an adapter var handle which drops some dummy coordinates, before calling the target var handlethe var handle to invoke after the dummy coordinates are dropped target, int position of the first coordinate to drop (zero for the leftmost) pos, Class<?>... the type(s) of the coordinate(s) to drop valueTypes)Returns a var handle which will discard some dummy coordinates before delegating to the target var handle. |
public static MethodHandle | Returns: a possibly adapted method handlethe method handle to adapt target)Drop the return value of the target handle (if any). |
public static MethodHandle | Returns: a constant method handle of the given type, which returns a default value of the given return typethe type of the desired method handle type)Produces a method handle of the requested type which ignores any arguments, does nothing, and returns a suitable default depending on the return type. |
public static MethodHandle | Returns: a method handle suitable for invoking any method handle of the given typethe desired target type type)Produces a special invoker method handle which can be used to
invoke any method handle of the given type, as if by |
public static MethodHandle | Returns: a method handle which delegates to the target after performing any necessary argument conversions, and arranges for any necessary return value conversionsthe method handle to invoke after arguments are retyped target, MethodType the expected type of the new method handle newType)Produces a method handle which adapts the type of the given method handle to a new type by pairwise argument and return type conversion. |
private static void | |
private static List | |
pack-priv static MethodHandle | |
private static void | |
public static MethodHandle | Returns: method handle which incorporates the specified argument filtering logicthe method handle to invoke after arguments are filtered target, int the position of the first argument to filter pos, MethodHandle... method handles to call initially on filtered arguments filters)Adapts a target method handle by pre-processing one or more of its arguments, each with its own unary filter function, and then calling the target with each pre-processed argument replaced by the result of its corresponding filter function. |
private static void | |
pack-priv static MethodHandle | Returns: method handle which incorporates the specified argument folding logicthe method handle to invoke after arguments are combined target, int the position at which to start folding and at which to insert the folding result; if this is position, MethodHandle 0 , the effect is the same as for foldArguments(MethodHandle, MethodHandle) .method handle to call initially on the incoming arguments combiner, int... indexes of the target to pick arguments sent to the combiner from argPositions)Adapts a target method handle by pre-processing some of its arguments, then calling the target with the result of the pre-processing replacing the argument at the given position. |
public static VarHandle | Returns: an adapter var handle which accepts new coordinate types, applying the provided transformation to the new coordinate values.the target var handle target, int the position of the first coordinate to be transformed pos, MethodHandle... the unary functions which are used to transform coordinates starting at position filters)pos Adapts a target var handle by pre-processing incoming coordinate values using unary filter functions. |
private static MethodHandle | |
public static MethodHandle | Returns: method handle which incorporates the specified return value filtering logicthe method handle to invoke before filtering the return value target, MethodHandle method handle to call on the return value filter)Adapts a target method handle by post-processing its return value (if any) with a filter (another method handle). |
private static void | |
public static VarHandle | Returns: an adapter var handle which accepts a new type, performing the provided boxing/unboxing conversions.the target var handle target, MethodHandle a filter to convert some type filterToTarget, MethodHandle S into the type of target a filter to convert the type of filterFromTarget)target to some type S Adapts a target var handle by pre-processing incoming and outgoing values using a pair of filter functions. |
private static int | findFirstDupOrDrop(int[] reorder, int newArity)
Return an indication of any duplicate or omission in reorder. |
private static List | |
private static Class | |
public static MethodHandle | Returns: method handle which incorporates the specified argument folding logicthe method handle to invoke after arguments are combined target, MethodHandle method handle to call initially on the incoming arguments combiner)Adapts a target method handle by pre-processing some of its arguments, and then calling the target with the result of the pre-processing, inserted into the original sequence of arguments. |
public static MethodHandle | Returns: method handle which incorporates the specified argument folding logicthe method handle to invoke after arguments are combined target, int the position at which to start folding and at which to insert the folding result; if this is pos, MethodHandle 0 , the effect is the same as for foldArguments(MethodHandle, MethodHandle) .method handle to call initially on the incoming arguments combiner)Adapts a target method handle by pre-processing some of its arguments, starting at a given position, and then calling the target with the result of the pre-processing, inserted into the original sequence of arguments just before the folded arguments. |
pack-priv static MethodHandle | Returns: method handle which incorporates the specified argument folding logicthe method handle to invoke after arguments are combined target, int the position at which to start folding and at which to insert the folding result; if this is position, MethodHandle 0 , the effect is the same as for foldArguments(MethodHandle, MethodHandle) .method handle to call initially on the incoming arguments combiner, int... indexes of the target to pick arguments sent to the combiner from argPositions)Adapts a target method handle by pre-processing some of its arguments, calling the target with the result of the pre-processing inserted into the original sequence of arguments at the given position. |
public static MethodHandle | Returns: method handle which incorporates the specified if/then/else logicmethod handle used for test, must return boolean test, MethodHandle method handle to call if test passes target, MethodHandle method handle to call if test fails fallback)Makes a method handle which adapts a target method handle, by guarding it with a test, a boolean-valued method handle. |
public static MethodHandle | |
private static MethodHandle | |
private static BoundMethodHandle | |
public static MethodHandle | Returns: a method handle which inserts an additional argument, before calling the original method handlethe method handle to invoke after the argument is inserted target, int where to insert the argument (zero for the first) pos, Object... the series of arguments to insert values)Provides a target method handle with one or more bound arguments in advance of the method handle's invocation. |
private static Class | |
public static VarHandle | Returns: an adapter var handle which inserts additional coordinates, before calling the target var handlethe var handle to invoke after the bound coordinates are inserted target, int the position of the first coordinate to be inserted pos, Object... the series of bound coordinates to insert values)Provides a target var handle with one or more bound coordinates in advance of the var handle's invocation. |
public static MethodHandle | Returns: a method handle suitable for invoking any method handle convertible to the given typethe desired target type type)Produces a special invoker method handle which can be used to
invoke any method handle compatible with the given type, as if by |
public static MethodHandle | Returns: a method handle embodying the iteration loop functionality.an optional handle to return the iterator to start the loop.
If non- iterator, MethodHandle null , the handle must return java. or a subtype.
See above for other constraints.optional initializer, providing the initial value of the loop variable.
May be init, MethodHandle null , implying a default initial value. See above for other constraints.body of the loop, which may not be body)null .
It controls the loop parameters and result type in the standard case (see above for details).
It must accept its own return type (if non-void) plus a T parameter (for the iterated values),
and may accept any number of additional types.
See above for other constraints.Constructs a loop that ranges over the values produced by an |
private static Class | |
private static List | |
public static MethodHandles. | lookup()
Returns a |
private static MethodHandles. | |
public static MethodHandle | Returns: a method handle embodying the looping behavior as defined by the arguments.an array of arrays (4-tuples) of clauses)MethodHandle s adhering to the rules described above.Constructs a method handle representing a loop with several loop variables that are updated and checked upon each iteration. |
private static void | |
private static void | |
private static void | |
private static void | |
private static void | loopChecks2(List<MethodHandle> step, List<MethodHandle> pred, List<MethodHandle> fini, List<Class<?>> commonParameterSequence)
|
private static MethodHandle | |
private static MethodHandle | |
pack-priv static <T> RuntimeException | |
pack-priv static boolean | |
public static MethodHandle | Returns: a method handle which delegates to the target after it drops unused arguments and moves and/or duplicates the other argumentsthe method handle to invoke after arguments are reordered target, MethodType the expected type of the new method handle newType, int... an index array which controls the reordering reorder)Produces a method handle which adapts the calling sequence of the given method handle to a new type, by reordering the arguments. |
public static VarHandle | Returns: an adapter var handle which re-arranges the incoming coordinate values, before calling the target var handlethe var handle to invoke after the coordinates have been reordered target, List<Class<?>> the new coordinate types newCoordinates, int... an index array which controls the reordering reorder)Provides a var handle which adapts the coordinate values of the target var handle, by re-arranging them so that the new coordinates match the provided ones. |
public static MethodHandles. | Returns: a lookup object for the target class, with private accessthe target class targetClass, MethodHandles.the caller lookup object callerReturns a |
public static MethodHandles. | Returns: a lookup object which is trusted minimallyReturns a |
public static < the desired type of the result, either T extends Member> TMember or a subtype | Returns: a reference to the method, constructor, or field objecta class object representing the desired result type expected, MethodHandle T a direct method handle to crack into symbolic reference components target)Performs an unchecked "crack" of a direct method handle. |
private static synchronized MethodHandle | |
public static MethodHandle | Returns: a method handle suitable for invoking any method handle of the given typethe desired target type type, int number of fixed arguments, to be passed unchanged to the target leadingArgCount)Produces a method handle which will invoke any method handle of the
given |
pack-priv static MethodHandle | |
public static MethodHandle | Returns: the table switch method handle.the fallback method handle that is called when the selector is not
within the range fallback, MethodHandle... [0, N) .array of target method handles. targets)Creates a table switch method handle, which can be used to switch over a set of target method handles, based on a given target index, called selector. |
private static MethodType | |
public static MethodHandle | Returns: method handle which can throw the given exceptionsthe return type of the desired method handle returnType, Class<? extends Throwable> the parameter type of the desired method handle exType)Produces a method handle which will throw exceptions of the given |
public static MethodHandle | Returns: a method handle embodying thetry-finally block composed of the two arguments.the handle whose execution is to be wrapped in a target, MethodHandle try block.the handle that is invoked in the finally block. cleanup)Makes a method handle that adapts a |
private static void | |
public static MethodHandle | Returns: a method handle suitable for invoking an access mode method of any VarHandle whose access mode type is of the given type.the VarHandle access mode accessMode,the desired target type type)Produces a special invoker method handle which can be used to invoke a signature-polymorphic access mode method on any VarHandle whose associated access mode type is compatible with the given type. |
public static MethodHandle | Returns: a method handle suitable for invoking an access mode method of any VarHandle whose access mode type is convertible to the given type.the VarHandle access mode accessMode,the desired target type type)Produces a special invoker method handle which can be used to invoke a signature-polymorphic access mode method on any VarHandle whose associated access mode type is compatible with the given type. |
public static MethodHandle | Returns: a method handle implementing thewhile loop as described by the arguments.optional initializer, providing the initial value of the loop variable.
May be init, MethodHandle null , implying a default initial value. See above for other constraints.condition for the loop, which may not be pred, MethodHandle null . Its result type must be boolean . See
above for other constraints.body of the loop, which may not be body)null . It controls the loop parameters and result type.
See above for other constraints.Constructs a |
private static void | |
public static MethodHandle | Returns: a constant method handle that takes no arguments and returns the default value of the given type (or void, if the type is void)the expected return type of the desired method handle type)Produces a constant method handle of the requested return type which returns the default value for that type every time it is invoked. |
private static MethodHandle |