Why is "checkcast MethodHandle" necessary in methodHandleInvokeLinkerMethod?

John Rose john.r.rose at oracle.com
Mon Apr 9 20:32:25 UTC 2018


On Apr 9, 2018, at 1:17 PM, Ioi Lam <ioi.lam at oracle.com> wrote:
> 
> So why is this first argument not declared as a MethodHandle?
> 

The short answer is to simplify the plumbing of lambda forms.

Method handles are strongly typed but the underlying IR of
lambda forms is weakly typed.  This keeps the IR simple.
To make up the difference, casts are inserted where necessary.
Most (not all) uses of MHs are inlined and/or customized,
in which case the JIT simply drops the casts.

— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20180409/d78d7897/attachment.html>


More information about the mlvm-dev mailing list