grappa
grappa copied to clipboard
Version 2.x.*: investigate the use of `invokedynamic`
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.