skip to main content
10.1145/1711506.1711508acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Bytecodes meet combinators: invokedynamic on the JVM

Published:25 October 2009Publication History

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.

References

  1. {Cangiano08} Antonio Cangiano. The Great Ruby Shootout. Dec. 2008. URL: http://antoniocangiano.com/2008/12/09/the-great-ruby-shootout-december-2008Google ScholarGoogle Scholar
  2. {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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. {Clerc09} Xavier Clerc. Ocaml-java project (ca. 2009). URL: http://ocamljava.x9c.frGoogle ScholarGoogle Scholar
  4. {Deutsch84} L. Peter Deutsch and Allan M. Schiffman. Efficient Implementation of the Smalltalk-80 System. POPL (1984) 297--302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. {DaVinci09} Da Vinci Machine project (ca. 2009). URL: http://openjdk.java.net/projects/mlvm/Google ScholarGoogle Scholar
  6. {Flanagan06} David Flanagan. JavaScript: the definitive guide. O'Reilly Media, Inc., Sebastopol, CA (2006), 21.8, p. 527. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. {Forax09} Rémi Forax. JSR 292 backport -- First release. July, 2009. URL: http://weblogs.java.net/blog/2009/07/01/jsr292-backport-first-releaseGoogle ScholarGoogle Scholar
  8. {Goldberg83} Adele Goldberg, David Robson. Smalltalk-80: The Language and Its Implementation. Addison-Wesley (1983). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. {Gosling95} James Gosling. Java intermediate bytecodes: ACM SIGPLAN workshop on intermediate representations (IR '95), San Francisco (1995), 111--118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. {Hickey09} Rich Hickey et al. Clojure project (ca. 2009). URL: http://clojure.org/Google ScholarGoogle Scholar
  11. {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 ScholarGoogle Scholar
  12. {Hugunin09} Jim Hugunin et al. Jython project (ca. 2009). URL: http://www.jython.orgGoogle ScholarGoogle Scholar
  13. {Kiczales91} Gregor Kiczales, Jim des Rivieres and Daniel G. Bobrow. The Art of the Metaobject Protocol. MIT Press (1991). Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. {Lindholm99} Tim Lindholm, Frank Yellin. Java Virtual Machine Specification, Addison-Wesley, Reading, MA (1999). URL: http://java.sun.com/docs/books/jvms/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. {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 ScholarGoogle Scholar
  16. {Meijer00} Erik Meijer, John Gough. Technical Overview of the Common Language Runtime. Microsoft (2000). URL: http://research.microsoft.com/~emeijer/Papers/CLR.pdfGoogle ScholarGoogle Scholar
  17. {Mozilla09} Mozilla Corp. Rhino: JavaScript for Java. URL: http://www.mozilla.org/rhino/.Google ScholarGoogle Scholar
  18. {Musch08} Radu Muschevici, Alex Potanin, Ewan Tempero, and James Noble. Multiple Dispatch in Practice. In OOPSLA, pages 563--582, Nashville, TN, USA (2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. {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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. {Nutter08} Charles Nutter. A First Taste of InvokeDynamic. Sept. 2008. URL: http://blog.headius.com/2008/09/first-taste-of-invokedynamic.htmlGoogle ScholarGoogle Scholar
  21. {Nutter09} Charles Nutter et al. JRuby project (ca. 2009). URL: http://kenai.com/projects/jruby/Google ScholarGoogle Scholar
  22. {Odersky04} Martin Odersky et al. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland (2004).Google ScholarGoogle Scholar
  23. {Ohloh09} Ohloh Company. Compare Languages Tool. (Retrieved 10/2009.) URL: http://www.ohloh.net/languages/compareGoogle ScholarGoogle Scholar
  24. {Öhrström09} Fredrik Öhrström. The JSR292 endgame. Oracle, May 11, 2009. URL: http://blogs.oracle.com/ohrstrom/2009/05/the_jsr292_endgame.htmlGoogle ScholarGoogle Scholar
  25. {Rose04} John Rose. Tuples in the VM. August, 2004. URL: http://blogs.sun.com/jrose/entry/tuples_in_the_vmGoogle ScholarGoogle Scholar
  26. {Rose08} John Rose. Symbolic Freedom in the VM. January 23, 2008. URL: http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vmGoogle ScholarGoogle Scholar
  27. {Schwaig09} Arnold Schwaighofer. Tail Call Optimization in the Java HotSpot VM. Master's thesis, Johannes Kepler University Linz, Austria (2009).Google ScholarGoogle Scholar
  28. {Stadler09} Lukas Stadler et al. Lazy Continuations for Java Virtual Machines. In Principles and Practice of Programming in Java, Calgary, Alberta, Canada (2009). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. {Steele96} James Gosling, Bill Joy, Guy L. Steele, The Java Language Specification, Addison-Wesley (1996). URL: http://java.sun.com/docs/books/jls/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. {Subram09} Suriya Subramanian, Michael Hicks and Kathryn S. McKinley. Dynamic software updates: a VM-centric approach. In PLDI, Dublin, Ireland (2009).Google ScholarGoogle Scholar
  31. {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 ScholarGoogle Scholar
  32. {TIOBE09} TIOBE Software BV. TIOBE Programming Community Index, Long Term Trends. (Retrieved 10/2009.) URL: http://www.tiobe.com/index.php/tiobe_indexGoogle ScholarGoogle Scholar
  33. {Tolksdorf09} Robert Tolksdorf. Programming languages for the Java Virtual Machine JVM. URL: http://www.is-research.de/info/vmlanguages/Google ScholarGoogle Scholar
  34. {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 ScholarGoogle Scholar

Index Terms

  1. Bytecodes meet combinators: invokedynamic on the JVM

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            VMIL '09: Proceedings of the Third Workshop on Virtual Machines and Intermediate Languages
            October 2009
            47 pages
            ISBN:9781605588742
            DOI:10.1145/1711506

            Copyright © 2009 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 25 October 2009

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate4of4submissions,100%

            Upcoming Conference

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader