The following addition 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 in the Java 9 platform:
- 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)