Inlining/Overhead implications of MethodHandle invoke() vs invokeExact()

Graves, Ian L ian.l.graves at intel.com
Fri Jun 10 19:00:32 UTC 2016


All,

I've been going through the docs and the code and was curious about the difference between invoke() and invokeExact() on a MethodHandle object on the back end.  Specifically its inlining and code-path-length characteristics.  Currently code snippets makes use of invokeExact, but there are some cases now where if we want to pass in arrays instead of objects, invokeExact is too restrictive and only invoke will work.  The work around is to create another code snippet that accepts the object of the correct type, but this seems a bit repetitive.  My gut tells me that the restrictiveness of invokeExact would come with positive back end tradeoffs, but I wanted to verify the nature of these tradeoffs with somebody in the know.  Does anybody know if, in the case of code snippets, one is more desirable than the other, or - what the overhead of invoke would be if used instead?

Thanks!

Ian


More information about the panama-dev mailing list