Nashorn: Optimizing JavaScript on the JVM

There are many implementations of JavaScript, meant to run either on the JVM or standalone as native code. Both approaches have their respective pros and cons. The soon-to-be open sourced Oracle Nashorn JavaScript project is based on the former approach.

This presentation goes through the performance work that has gone on in Oracle’s Nashorn JavaScript project to date in order to make JavaScript-to-bytecode generation for execution on the JVM feasible. Aside from covering the Nashorn project itself, we show that the new invoke dynamic bytecode gets us part of the way there but may not quite be enough. Nashorn is also the first JavaScript runtime in the world to achieve 100% EcmaScript compliance. What other tricks did the Nashorn project use? The presentation also discusses future directions for increased performance for dynamic languages on the JVM, covering proposed enhancements to both the JVM itself and to the bytecode compiler.