The following additional combinations have been added to support the ease of use and optimizations for the MethodHandle, MethodHandles, and MethodHandles.Lookup classes of the java.lang.invoke package:
- Generic loop abstraction:
- MethodHandle loop(MethodHandle[] . . . clauses)
- While loops:
- MethodHandle whileLoop(MethodHandle init, MethodHandle pred, MethodHandle body)
- Do...while loops:
- MethodHandle doWhileLoop(MethodHandle init, MethodHandle body, MethodHandle pred)
- Counting loops:
- MethodHandle countedLoop(MethodHandle iterations, MethodHandle init, MethodHandle body)
- Data structure iteration:
- MethodHandle iteratedLoop(MethodHandle iterator, MethodHandle init, MethodHandle body)
- Try...finally blocks:
- MethodHandle tryFinally(MethodHandle target, MethodHandle cleanup)
- Argument handling:
- Argument spreading:
- MethodHandle asSpreader(int pos, Class<?> arrayType, int arrayLength)
- Argument collection:
- MethodHandle asCollector(int pos, Class<?> arrayType, int arrayLength)
- Argument folding:
- MethodHandle foldArguments(MethodHandle target, int pos, MethodHandle combiner)