grappa icon indicating copy to clipboard operation
grappa copied to clipboard

Version 2.x.*: investigate the use of `invokedynamic`

Open fge opened this issue 11 years ago • 0 comments

This opcode, new since Java 7, is among other things what is used by lambdas in Java 8 (see this video by Mr Goetz himself) but also all "dynamically typed" languages on the JVM, for instance JRuby (see this video by @headius, the author of JRuby).

From what I understood of this opcode so far (nicknamed "indy", which I'll use from now on), and this may not be accurate, it works as such:

  • you, the "indy client", create a bootstrap method; the API to do this in the JDK is MethodHandle;
  • indy asks this method where the bytecode is;
  • it inlines the bytecode and execution continues.

What I believe can be done here, but I'm not sure, is to replace ProxyMatcher with indy.

fge avatar May 20 '14 08:05 fge