Turbo-charging JDK 7 for multiple languages
By dannycoward on Feb 18, 2009
John's excellent post on invokedynamic is a reminder that tuning the JVM to turbo-charge multiple languages running thereon is not a task for the faint of heart.
This new bytecode instruction that compilers for other languages will be able to use in JDK 7 (and some have already experimented with in the early builds) is not the only technique that will likely make it as part of JSR 292. But this technique is the most promising: it allows programmatic control over the dynamic linking of a method invocation, which has many uses, but is particularly useful for dynamically typed languages where the type information is not held in the source code, so can only be calculated reliably at runtime.
And the DaVinci project is a breeding ground for experimentation and prototyping of this and a number of other techniques in the same vein: some of which require changes to the specifications, and some of which don't. Remi gave a nice talk on this earlier this month at FOSDEM. Those others that have a reasonable chance to making it into JSR 292, include lightweight method objects (useful for languages that have closures), and interface injection (useful for languages where types in a running JVM evolve synamically).