Applying Optimizations for Dynamically-typed Languages to Java

Matthias Grimmer, Stefan Marr, Mario Kahlhofer, Christian Wimmer, Thomas Würthinger, Hanspeter Mössenböck

Research output: Chapter in Book/Report/Conference proceedingConference proceedingspeer-review

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.
Original languageEnglish
Title of host publicationProceeding ManLang 2017 Proceedings of the 14th International Conference on Managed Languages and Runtimes
Place of PublicationNew York
PublisherACM
Pages12-22
Number of pages11
ISBN (Print)978-1-4503-5340-3
DOIs
Publication statusPublished - Sept 2017

Fields of science

  • 102 Computer Sciences
  • 102009 Computer simulation
  • 102011 Formal languages
  • 102013 Human-computer interaction
  • 102022 Software development
  • 102024 Usability research
  • 102029 Practical computer science

JKU Focus areas

  • Computation in Informatics and Mathematics
  • Engineering and Natural Sciences (in general)

Cite this