Nashorn: implementing a dynamic language runtime on JVM in 2014
summary
Nashorn compiles JavaScript to JVM bytecode, uses invoke dynamic, and ships as ECMAScript 5.1 in OpenJDK; it passes the 11,500‑test suite. It implements on-stack replacement and optimistic typing: it generates type-specialized variants (int/long/double/object), lazily compiles per-parameter shapes, deoptimizes by throwing and catching a rewrite exception, and synthesizes continuations to resume execution. Concrete results: large speedups over Rhino and big gains in number‑crunching workloads; the project aims to become a reusable dynamic‑language toolkit for the JVM.
AI-written summary · about
chapters (10)
- 0:00Introduction to Nashorn
- 1:10Nashorn architecture
- 4:40Performance and goals
- 8:05Type specialized compilation
- 18:11Arithmetic and property optimizations
- 21:42On-stack replacement
- 25:18De-optimization mechanism
- 29:32Type inference and lattice
- 34:26Static type analysis
- 40:51Future goals and library
related talks
57mNashorn War Stories: Dynamic Language Performance on the JVM
41mNashorn Under the Hood: Making This Rhinoceros Thunder
50mNashorn - what's all the fuss about
57mNashorn for Java 9
01h 01mNashorn ... In Enterprise Applications
01h 30mServer-side JavaScript with Nashorn and Spring
36mFast and Dynamic
28mdyn.js - 100% invokedynamic JavaScript implementation
