Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3132190.3132202acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmanlangConference Proceedingsconference-collections
research-article

Applying Optimizations for Dynamically-typed Languages to Java

Published: 27 September 2017 Publication History

Abstract

While Java is a statically-typed language, some of its features make it behave like a dynamically-typed language at run time. This includes Java's boxing of primitive values as well as generics, which rely on type erasure.
This paper investigates how runtime technology for dynamically-typed languages such as JavaScript and Python can be used for Java bytecode. Using optimistic optimizations, we specialize bytecode instructions that access references in such a way, that they can handle primitive data directly and also specialize data structures in order to avoid boxing for primitive types. Our evaluation shows that these optimizations can be successfully applied to a statically-typed language such as Java and can also improve performance significantly. With this approach, we get an efficient implementation of Java's generics, avoid changes to the Java language, and maintain backwards compatibility, allowing existing code to benefit from our optimization transparently.

References

[1]
John Aycock. 2003. A Brief History of Just-In-Time. ACM Comput. Surv. 35, 2 (June 2003), 97--113.
[2]
Carl Friedrich Bolz, Lukas Diekmann, and Laurence Tratt. 2013. Storage Strategies for Collections in Dynamically Typed Languages. In Proc. OOPSLA. 167--182.
[3]
Carl Friedrich Bolz and Laurence Tratt. 2013. The Impact of Meta-Tracing on VM Design and Implementation. Science of Computer Programming (2013).
[4]
Craig Chambers, David Ungar, and Elgin Lee. 1989. An Efficient Implementation of SELF a Dynamically-Typed Object-Oriented Language Based on Prototypes. In Proceedings on Object-Oriented Programming Systems, Languages and Applications (OOPSLA). ACM, 49--70.
[5]
Maxime Chevalier-Boisvert and Marc Feeley. 2016. Interprocedural Type Specialization of JavaScript Programs Without Type Analysis. In 30th European Conference on Object-Oriented Programming (ECOOP 2016) (Leibniz International Proceedings in Informatics (LIPIcs)), Vol. 56. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 7:1--7:24.
[6]
Daniel Clifford, Hannes Payer, Michael Stanton, and Ben L. Titzer. 2015. Memento Mori: Dynamic Allocation-site-based Optimizations. In Proceedings of the 2015 International Symposium on Memory Management (ISMM '15). ACM, 105--117.
[7]
Benoit Daloze, Stefan Marr, Daniele Bonetta, and Hanspeter Mössenböck. 2016. Efficient and Thread-Safe Objects for Dynamically-Typed Languages. In Proceedings of the 2016 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '16). ACM, 18.
[8]
Mattias De Wael, Stefan Marr, Joeri De Koster, Jennifer B. Sartor, and Wolfgang De Meuter. 2015. Just-in-Time Data Structures. In Proceedings of the 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! '15). ACM, 61--75.
[9]
Gilles Duboscq, Thomas Würthinger, and Hanspeter Mössenböck. 2014. Speculation Without Regret: Reducing Deoptimization Meta-data in the Graal Compiler. In Proceedings of the 2014 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools (PPPJ '14). ACM, 187--193.
[10]
Gilles Duboscq, Thomas Würthinger, Lukas Stadler, Christian Wimmer, Doug Simon, and Hanspeter Mössenböck. 2013. An Intermediate Representation for Speculative Optimizations in a Dynamic Compiler. In Proceedings of the 7th ACM Workshop on Virtual Machines and Intermediate Languages (VMIL '13). ACM, 1--10.
[11]
Philip J. Fleming and John J. Wallace. 1986. How Not to Lie with Statistics: The Correct Way to Summarize Benchmark Results. Commun. ACM 29, 3 (March 1986), 218--221.
[12]
Matthias Grimmer, Manuel Rigger, Lukas Stadler, Roland Schatz, and Hanspeter Mössenböck. 2013. An Efficient Native Function Interface for Java. In Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools (PPPJ '13). ACM, 35--44.
[13]
Matthias Grimmer, Chris Seaton, Roland Schatz, Würthinger, and Hanspeter Mössenböck. 2015. High-Performance Cross-Language Interoperability in a Multi-Language Runtime. In Proceedings of the 11th Symposium on Dynamic Languages (DLS '15). ACM.
[14]
Matthias Grimmer, Chris Seaton, Thomas Würthinger, and Hanspeter Mössenböck. 2015. Dynamically Composing Languages in a Modular Way: Supporting C Extensions for Dynamic Languages. In Proceedings of the 14th International Conference on Modularity (MODULARITY 2015). ACM, 1--13.
[15]
Urs Hölzle, Craig Chambers, and David Ungar. 1992. Debugging Optimized Code with Dynamic Deoptimization. In Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation (PLDI '92). ACM, 32--43.
[16]
Bill Joy, Guy Steele, James Gosling, and Gilad Bracha. 2000. The Java language specification. (2000), 768 pages.
[17]
Tomas Kalibera and Richard Jones. 2013. Rigorous Benchmarking in Reasonable Time. In Proceedings of the 2013 ACM SIGPLAN International Symposium on Memory Management (ISMM).
[18]
Stefan Marr, Benoit Daloze, and Hanspeter Mössenböck. 2016. Cross-Language Compiler Benchmarking---Are We Fast Yet?. In Proceedings of the 12th Symposium on Dynamic Languages (DLS'16). ACM, 12.
[19]
Stefan Marr and Stephane Ducasse. {n. d.}. Tracing vs. Partial Evaluation: Comparing Meta-Compilation Approaches for Self-Optimizing Interpreters. In Proceedings of the 2015 ACM International Conference on Object Oriented Programming Systems Languages; Applications (OOPSLA '15). ACM.
[20]
Jerome Miecznikowski and Laurie Hendren. 2002. Decompiling Java bytecode: Problems, traps and pitfalls. In International Conference on Compiler Construction. Springer, 111--127.
[21]
Michael Paleczny, Christopher Vick, and Cliff Click. 2001. The Java Hotspot(TM) Server Compiler. In JVM'01:Proceedings of the 2001 Symposium on Java TM Virtual Machine Research and Technology Symposium. USENIX Association, 12.
[22]
Manuel Rigger, Matthias Grimmer, Christian Wimmer, Thomas Würthinger, and Hanspeter Mössenböck. 2016. Bringing Low-Level Languages to the JVM: Efficient Execution of LLVM IR on Truffle. In Proceedings of Workshop on Virtual Machines and Intermediate Languages (VMIL '16). 10.
[23]
Ohad Shacham, Martin Vechev, and Eran Yahav. 2009. Chameleon: Adaptive Selection of Collections. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '09), Vol. 44. 408--418.
[24]
Lukas Stadler, Gilles Duboscq, Hanspeter Mössenböck, and Thomas Würthinger. 2012. Compilation Queuing and Graph Caching for Dynamic Compilers. In Proceedings of the Sixth ACM Workshop on Virtual Machines and Intermediate Languages (VMIL '12). ACM, 49--58.
[25]
Lukas Stadler, Gilles Duboscq, Hanspeter Mössenböck, Thomas Würthinger, and Doug Simon. 2013. An Experimental Study of the Influence of Dynamic Compiler Optimizations on Scala Performance. In Proceedings of the 4th Workshop on Scala (SCALA '13). ACM, Article 9, 8 pages.
[26]
Lukas Stadler, Thomas Würthinger, and Hanspeter Mössenböck. 2014. Partial Escape Analysis and Scalar Replacement for Java. In Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization (CGO '14). ACM, Article 165, 10 pages.
[27]
David Ungar and Randall B. Smith. 1987. Self: The Power of Simplicity. In Conference Proceedings on Object-oriented Programming Systems, Languages and Applications (OOPSLA '87). ACM, 227--242.
[28]
Vlad Ureche, Cristian Talau, and Martin Odersky. 2013. Miniboxing: Improving the Speed to Code Size Tradeoff in Parametric Polymorphism Translations. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '13). ACM, 73--92.
[29]
Andreas Wöß, Christian Wirth, Daniele Bonetta, Chris Seaton, Christian Humer, and Hanspeter Mössenböck. 2014. An Object Storage Model for the Truffle Language Implementation Framework. In Proceedings of the 2014 International Conference on Principles and Practices of Programming on the Java Platform:Virtual Machines, Languages, and Tools (PPPJ '14). ACM, 133--144.
[30]
Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. 2017. Practical Partial Evaluation for High-performance Dynamic Language Runtimes. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, 662--676.
[31]
Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon, and Mario Wolczko. 2013. One VM to Rule Them All. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! 2013). ACM, 187--204.
[32]
Thomas Würthinger, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Doug Simon, and Christian Wimmer. 2012. Self-optimizing AST Interpreters. In Proceedings of the 8th Symposium on Dynamic Languages (DLS '12). ACM, 73--82.
[33]
Guoqing Xu. 2013. CoCo: Sound and Adaptive Replacement of Java Collections. In ECOOP 2013 -- Object-Oriented Programming: 27th European Conference, Montpellier, France, July 1-5, 2013. Proceedings, Giuseppe Castagna (Ed.). Springer, 1--26.

Cited By

View all
  • (2022)Dynamic Taint Analysis with Label-Defined SemanticsProceedings of the 19th International Conference on Managed Programming Languages and Runtimes10.1145/3546918.3546927(64-84)Online publication date: 14-Sep-2022
  • (2021)Low-overhead multi-language dynamic taint analysis on managed runtimes through speculative optimizationProceedings of the 18th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3475738.3480939(70-87)Online publication date: 29-Sep-2021
  • (2020)Toward presizing and pretransitioning strategies for GraalPythonCompanion Proceedings of the 4th International Conference on Art, Science, and Engineering of Programming10.1145/3397537.3397564(41-45)Online publication date: 23-Mar-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
ManLang 2017: Proceedings of the 14th International Conference on Managed Languages and Runtimes
September 2017
125 pages
ISBN:9781450353403
DOI:10.1145/3132190
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]

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 27 September 2017

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java
  2. bytecode interpreter
  3. dynamic compilation
  4. language implementation
  5. optimization
  6. virtual machine

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

ManLang 2017

Acceptance Rates

Overall Acceptance Rate 12 of 25 submissions, 48%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)1
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2022)Dynamic Taint Analysis with Label-Defined SemanticsProceedings of the 19th International Conference on Managed Programming Languages and Runtimes10.1145/3546918.3546927(64-84)Online publication date: 14-Sep-2022
  • (2021)Low-overhead multi-language dynamic taint analysis on managed runtimes through speculative optimizationProceedings of the 18th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3475738.3480939(70-87)Online publication date: 29-Sep-2021
  • (2020)Toward presizing and pretransitioning strategies for GraalPythonCompanion Proceedings of the 4th International Conference on Art, Science, and Engineering of Programming10.1145/3397537.3397564(41-45)Online publication date: 23-Mar-2020
  • (2019)Supporting on-stack replacement in unstructured languages by loop reconstruction and extractionProceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3357390.3361030(1-13)Online publication date: 21-Oct-2019
  • (2018)Cross-Language Interoperability in a Multi-Language RuntimeACM Transactions on Programming Languages and Systems10.1145/320189840:2(1-43)Online publication date: 28-May-2018

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media