MethodHandle for indirect/vtable call?
Jorn Vernee
jorn.vernee at oracle.com
Wed Dec 16 17:52:50 UTC 2020
Thanks for bringing this up.
We've talked about it a few times in the past, but no issue was filed
yet. I've filled: https://bugs.openjdk.java.net/browse/JDK-8258516
Doing this is technically possible, and I think it should optimize just
as well as the current scheme. (WRT data motion, we have the liberty of
passing the address in a non-ABI register, so I'm not worried about
that). We can build the current implementation, where the address is
fixed, on top of the version where the address is passed dynamically.
Jorn
On 11/12/2020 16:16, Nikita Nemkin wrote:
> Hi all,
>
> It seems that there's no native MethodHandle variant that takes a
> function pointer in addition to function arguments. I expected such
> method handles to be available for implementing indirect/vtable call
> sites. Without them, MethodHandles can't be cached statically per
> method (or per signature), since the target of each call could be
> different.
>
> Isn't static caching of method handles necessary for optimization?
> What's the best practice for indirect calls?
>
> This is important for wrapping Windows platform APIs, many of which
> are COM-based.
More information about the panama-dev
mailing list