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

Cited By

View all
  • (2024)Efficient Data Exchange between WebAssembly ModulesFuture Internet10.3390/fi1609034116:9(341)Online publication date: 20-Sep-2024
  • (2024)Unimocg: Modular Call-Graph Algorithms for Consistent Handling of Language FeaturesProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652109(51-62)Online publication date: 11-Sep-2024
  • (2023)Towards Virtual Machine Support for Contextual Role-Oriented Programming LanguagesProceedings of the 15th ACM International Workshop on Context-Oriented Programming and Advanced Modularity10.1145/3605154.3605851(1-8)Online publication date: 17-Jul-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 October 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. bytecode
  2. combinator
  3. dynamic compilation
  4. invokedynamic
  5. method invocation

Qualifiers

  • Research-article

Conference

OOPSLA09
Sponsor:

Acceptance Rates

Overall Acceptance Rate 4 of 4 submissions, 100%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)14
  • Downloads (Last 6 weeks)0
Reflects downloads up to 28 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Efficient Data Exchange between WebAssembly ModulesFuture Internet10.3390/fi1609034116:9(341)Online publication date: 20-Sep-2024
  • (2024)Unimocg: Modular Call-Graph Algorithms for Consistent Handling of Language FeaturesProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652109(51-62)Online publication date: 11-Sep-2024
  • (2023)Towards Virtual Machine Support for Contextual Role-Oriented Programming LanguagesProceedings of the 15th ACM International Workshop on Context-Oriented Programming and Advanced Modularity10.1145/3605154.3605851(1-8)Online publication date: 17-Jul-2023
  • (2022)Guard the Cache: Dispatch Optimization in a Contextual Role-oriented LanguageProceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity10.1145/3570353.3570357(27-34)Online publication date: 7-Jun-2022
  • (2020)Efficient dispatch of multi-object polymorphic call sites in contextual role-oriented programming languagesProceedings of the 17th International Conference on Managed Programming Languages and Runtimes10.1145/3426182.3426186(52-62)Online publication date: 4-Nov-2020
  • (2019)Techniques and Analysis for Mixed-criticality Scheduling with Mode-dependent Server Execution BudgetsACM Transactions on Embedded Computing Systems10.1145/335823418:5s(1-23)Online publication date: 8-Oct-2019
  • (2019)CompActACM Transactions on Embedded Computing Systems10.1145/335817818:5s(1-24)Online publication date: 7-Oct-2019
  • (2019)Efficient late binding of dynamic function compositionsProceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3357766.3359543(141-151)Online publication date: 20-Oct-2019
  • (2017)Fusing method handle graphs for efficient dynamic JVM language implementationsProceedings of the 9th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages10.1145/3141871.3141874(18-27)Online publication date: 24-Oct-2017
  • (2017)Heaps don't lie: countering unsoundness with heap snapshotsProceedings of the ACM on Programming Languages10.1145/31338921:OOPSLA(1-27)Online publication date: 12-Oct-2017
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media