Dynamic Invocation Runs on OpenJDK
In the wee hours of this morning, the JVM has for the first time processed a full bootstrap cycle forThe 'invokedynamic' instruction is one of many efforts planned as part of the multi-language virtual machine dubbed the 'Da Vinci Machine'. All of the planned feature enhancements in Da Vinci are described on the sub-project section of the MLVM site. Dynamic invocation is also part of JSR-292, which has been previously discussed on InfoQ, and is an adaptation of some of the experimental Da Vinci work into the core Java VM. This announcement by John Rose is the first time that 'invokedynamic' has run on the OpenJDK hotspot virtual machine.
invokedynamicinstructions, linking the constant pool entries, creating the reified call site object, finding and calling the per-class bootstrap method, linking the reified call site to a method handle, and then calling the linked call site 999 more times through the method handle, at full speed. The method names mentioned by the caller and the callee were different, though the signatures were the same. The linkage was done by random, hand-written Java code inside the bootstrap method.
Dynamic invocation is one of the longest desired features by dynamic language developers for the JVM. Gilad Bracha previously discussed the theory behind dynamic invocation on InfoQ, and why it is felt as a necessary enhancement.
Charles Oliver Nutter, lead developer of JRuby, had this to say regarding John Rose's announcement:
Awesome...and with JRuby 1.1.4 coming out today or tomorrow I'll beGuillaume Laforge, project manager of Groovy, had more simple words of celebration, writing:
taking an invokdynamic vacation. Just in time to demo it for the fall
Champaign! :-)There is still a long road left for dynamic invocation, however. Of course, dynamic languages (such as JRuby and Groovy) must adapt to utilize the new instruction. Rose also details that there is still work to be done in the core implementation:
As for the JVM code, it only works on x86/32; the next step is to move the assembler code into the right files, and finish the support for x86/64 and SPARC.
Correction: I am not JRuby lead
Uwe Zdun, Rafael Capilla, Huy Tran, Olaf Zimmermann Mar 09, 2014
Olav Maassen, Liz Keogh & Chris Matts Mar 08, 2014