Method handle invocation

Method handles have several modes of invocation, involving various degrees of type checking and conversion.

Every method handle invocation takes into account two independent sources of type information.  The caller (whose call site is invoking the method handle) specifies the caller method type implicitly by the choice of the call descriptor in the call site bytecode.  The callee (i.e., the method handle being invoked) has its own callee method type, which is simply its MethodHandle.type property.

The possible modes of method handle invocation include:

In addition, method handles can be viewed by various transforms that change their apparent type, and hence their acceptable invocation types and modes:

Exact invocation

discuss

Generic invocation

discuss

Varargs invocation

discuss

Basic invocation

discuss