ABSTRACT
The Java Virtual Machine (JVM) has been widely adopted in part because of its classfile format, which is portable, compact, modular, verifiable, and reasonably easy to work with. However, it was designed for just one language---Java---and so when it is used to express programs in other source languages, there are often "pain points" which retard both development and execution. The most salient pain points show up at a familiar place, the method call site.
To generalize method calls on the JVM, the JSR 292 Expert Group has designed a new invokedynamic instruction that provides user-defined call site semantics. In the chosen design, invokedynamic serves as a hinge-point between two coexisting kinds of intermediate language: bytecode containing dynamic call sites, and combinator graphs specifying call targets. A dynamic compiler can traverse both representations simultaneously, producing optimized machine code which is the seamless union of both kinds of input. As a final twist, the user-defined linkage of a call site may change, allowing the code to adapt as the application evolves over time. The result is a system balancing the conciseness of bytecode with the dynamic flexibility of function pointers.
- {Cangiano08} Antonio Cangiano. The Great Ruby Shootout. Dec. 2008. URL: http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008Google Scholar
- {Chambers91} Craig Chambers, David Ungar, Elgin Lee. An Efficient Implementation of Self, a Dynamically-Typed Object-Oriented Language Based on Prototypes. In Lisp and Symbolic Computation 4, 3 (1991), 243--281. Also in OOPSLA '89 Conference Proceedings. Google ScholarDigital Library
- {Clerc09} Xavier Clerc. Ocaml-java project (ca. 2009). URL: http://ocamljava.x9c.frGoogle Scholar
- {Deutsch84} L. Peter Deutsch and Allan M. Schiffman. Efficient Implementation of the Smalltalk-80 System. POPL (1984) 297--302. Google ScholarDigital Library
- {DaVinci09} Da Vinci Machine project (ca. 2009). URL: http://openjdk.java.net/projects/mlvm/Google Scholar
- {Flanagan06} David Flanagan. JavaScript: the definitive guide. O'Reilly Media, Inc., Sebastopol, CA (2006), 21.8, p. 527. Google ScholarDigital Library
- {Forax09} Rémi Forax. JSR 292 backport -- First release. July, 2009. URL: http://weblogs.java.net/blog/2009/07/01/jsr292-backport-first-releaseGoogle Scholar
- {Goldberg83} Adele Goldberg, David Robson. Smalltalk-80: The Language and Its Implementation. Addison-Wesley (1983). Google ScholarDigital Library
- {Gosling95} James Gosling. Java intermediate bytecodes: ACM SIGPLAN workshop on intermediate representations (IR '95), San Francisco (1995), 111--118. Google ScholarDigital Library
- {Hickey09} Rich Hickey et al. Clojure project (ca. 2009). URL: http://clojure.org/Google Scholar
- {Hugunin07} Jim Hugunin. DLR Trees (Part 1). Microsoft, May 2007. URL: http://blogs.msdn.com/hugunin/archive/2007/05/15/dlr-trees-part-1.aspxGoogle Scholar
- {Hugunin09} Jim Hugunin et al. Jython project (ca. 2009). URL: http://www.jython.orgGoogle Scholar
- {Kiczales91} Gregor Kiczales, Jim des Rivieres and Daniel G. Bobrow. The Art of the Metaobject Protocol. MIT Press (1991). Google ScholarDigital Library
- {Lindholm99} Tim Lindholm, Frank Yellin. Java Virtual Machine Specification, Addison-Wesley, Reading, MA (1999). URL: http://java.sun.com/docs/books/jvms/ Google ScholarDigital Library
- {Lorimer09} R. J. Lorimer. Distilling JRuby: Method Dispatching 101. September, 2009. URL: http://www.realjenius.com/2009/09/16/distilling-jruby-method-dispatching-101/Google Scholar
- {Meijer00} Erik Meijer, John Gough. Technical Overview of the Common Language Runtime. Microsoft (2000). URL: http://research.microsoft.com/~emeijer/Papers/CLR.pdfGoogle Scholar
- {Mozilla09} Mozilla Corp. Rhino: JavaScript for Java. URL: http://www.mozilla.org/rhino/.Google Scholar
- {Musch08} Radu Muschevici, Alex Potanin, Ewan Tempero, and James Noble. Multiple Dispatch in Practice. In OOPSLA, pages 563--582, Nashville, TN, USA (2008). Google ScholarDigital Library
- {Nicoara08} Angela Nicoara, Gustavo Alonso and Timothy Roscoe. Controlled, systematic, and efficient code replacement for running java programs. In SIGOPS/EuroSys (Glasgow, Scotland UK, 2008). Google ScholarDigital Library
- {Nutter08} Charles Nutter. A First Taste of InvokeDynamic. Sept. 2008. URL: http://blog.headius.com/2008/09/first-taste-of-invokedynamic.htmlGoogle Scholar
- {Nutter09} Charles Nutter et al. JRuby project (ca. 2009). URL: http://kenai.com/projects/jruby/Google Scholar
- {Odersky04} Martin Odersky et al. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland (2004).Google Scholar
- {Ohloh09} Ohloh Company. Compare Languages Tool. (Retrieved 10/2009.) URL: http://www.ohloh.net/languages/compareGoogle Scholar
- {Öhrström09} Fredrik Öhrström. The JSR292 endgame. Oracle, May 11, 2009. URL: http://blogs.oracle.com/ohrstrom/2009/05/the_jsr292_endgame.htmlGoogle Scholar
- {Rose04} John Rose. Tuples in the VM. August, 2004. URL: http://blogs.sun.com/jrose/entry/tuples_in_the_vmGoogle Scholar
- {Rose08} John Rose. Symbolic Freedom in the VM. January 23, 2008. URL: http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vmGoogle Scholar
- {Schwaig09} Arnold Schwaighofer. Tail Call Optimization in the Java HotSpot VM. Master's thesis, Johannes Kepler University Linz, Austria (2009).Google Scholar
- {Stadler09} Lukas Stadler et al. Lazy Continuations for Java Virtual Machines. In Principles and Practice of Programming in Java, Calgary, Alberta, Canada (2009). Google ScholarDigital Library
- {Steele96} James Gosling, Bill Joy, Guy L. Steele, The Java Language Specification, Addison-Wesley (1996). URL: http://java.sun.com/docs/books/jls/ Google ScholarDigital Library
- {Subram09} Suriya Subramanian, Michael Hicks and Kathryn S. McKinley. Dynamic software updates: a VM-centric approach. In PLDI, Dublin, Ireland (2009).Google Scholar
- {Szegedi09} Attila Szegedi. Metaobject Protocol Meets Invokedynamic. JVM Language Summit, Santa Clara (2009). URL: http://wiki.jvmlangsummit.com/MOP_and_Invokedynamic Project URL: http://dynalang.sourceforge.net/Google Scholar
- {TIOBE09} TIOBE Software BV. TIOBE Programming Community Index, Long Term Trends. (Retrieved 10/2009.) URL: http://www.tiobe.com/index.php/tiobe_indexGoogle Scholar
- {Tolksdorf09} Robert Tolksdorf. Programming languages for the Java Virtual Machine JVM. URL: http://www.is-research.de/info/vmlanguages/Google Scholar
- {Wuerth09} Thomas Wuerthinger. Dynamic Code Evolution for the Java HotSpot Virtual Machine. April 1, 2009. URL: http://wikis.sun.com/download/attachments/172493511/wuerthinger-hotswap-20090401.pdfGoogle Scholar
Index Terms
- Bytecodes meet combinators: invokedynamic on the JVM
Recommendations
Bringing low-level languages to the JVM: efficient execution of LLVM IR on Truffle
VMIL 2016: Proceedings of the 8th International Workshop on Virtual Machines and Intermediate LanguagesAlthough the Java platform has been used as a multi-language platform, most of the low-level languages (such as C, Fortran, and C++) cannot be executed efficiently on the JVM. We propose Sulong, a system that can execute LLVM-based languages on the ...
Optimizing invokedynamic
PPPJ '10: Proceedings of the 8th International Conference on the Principles and Practice of Programming in JavaIn order to support the needs of non-Java languages, the JSR 292 Expert Group has designed a new bytecode "invokedynamic" which allows JVM bytecodes to contain call sites with pluggable, user-defined behavior. The bytecode is accompanied by a new data ...
Android 292: implementing invokedynamic in Android
JTRES '14: Proceedings of the 12th International Workshop on Java Technologies for Real-time and Embedded SystemsAndroid OS uses for its applicative part a Java-based virtual machine called Dalvik. Java 7 introduces a new instructions set as well as a new API specified by the JSR 292 [11] in order to improve and simplify the implementation of non-Java languages on ...
Comments