[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Snippets: Taking the High Road to a Low Level

Published: 24 June 2015 Publication History

Abstract

When building a compiler for a high-level language, certain intrinsic features of the language must be expressed in terms of the resulting low-level operations. Complex features are often expressed by explicitly weaving together bits of low-level IR, a process that is tedious, error prone, difficult to read, difficult to reason about, and machine dependent. In the Graal compiler for Java, we take a different approach: we use snippets of Java code to express semantics in a high-level, architecture-independent way. Two important restrictions make snippets feasible in practice: they are compiler specific, and they are explicitly prepared and specialized. Snippets make Graal simpler and more portable while still capable of generating machine code that can compete with other compilers of the Java HotSpot VM.

Supplementary Material

TACO1202-20 (taco1202-20.pdf)
Slide deck associated with this paper

References

[1]
B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P.Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. 2000. The Jalapeño virtual machine. IBM Systems Journal 39, 1 (2000), 211--238.
[2]
Bowen Alpern, C. R. Attanasio, Anthony Cocchi, Susan Flynn Hummel, Derek Lieber, Mark Mergen, Janice C. Shepherd, and Stephen Smith. 1999. Implementing Jalapeño in Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, 314--324.
[3]
Davide Ancona, Massimo Ancona, Antonio Cuni, and Nicholas D. Matsakis. 2007. RPython: A step towards reconciling dynamically and statically typed OO languages. In Proceedings of the Dynamic Languages Symposium. ACM, 53--64.
[4]
Apache Software Foundation. 2011. Dynamic Runtime Layer Virtual Machine. Retrieved from http://harmony.apache.org/subcomponents/drlvm/.
[5]
S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM, 169--190.
[6]
Stephen M. Blackburn, Sergey I. Salishev, Mikhail Danilov, Oleg A. Mokhovikov, Anton A. Nashatyrev, Peter A. Novodvorsky, Vadim I. Bogdanov, Xiao Feng Li, and Dennis Ushakov. 2008. The Moxie JVM Experience. Technical Report TR-CS-08-01. Department of Computer Science, Australian National University.
[7]
Michael G. Burke, Jong-Deok Choi, Stephen J. Fink, David Grove, Michael Hind, Vivek Sarkar, Mauricio J. Serrano, V. C. Sreedhar, Harini Srinivasan, and John Whaley. 1999. The Jalapeño dynamic optimizing compiler for Java. In Proceedings of the ACM Conference on Java Grande. ACM, 129--141.
[8]
Michal Cierniak, Marsha Eng, Neal Glew, Brian T. Lewis, and James M. Stichnoth. 2005. The open runtime platform: A flexible high-performance managed runtime environment. Concurrency and Computation: Practice and Experience 17, 5--6 (2005), 617--637.
[9]
Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. 1991. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13, 4 (1991), 451--490.
[10]
Gilles Duboscq, Lukas Stadler, Thomas Würthinger, Doug Simon, Christian Wimmer, and Hanspeter Mössenböck. 2013a. Graal IR: An extensible declarative intermediate representation. In Proceedings of the Asia-Pacific Programming Languages and Compilers Workshop.
[11]
Gilles Duboscq, Thomas Würthinger, Lukas Stadler, Christian Wimmer, Doug Simon, and Hanspeter Mössenböck. 2013b. An intermediate representation for speculative optimizations in a dynamic compiler. In Proceedings of the ACM Workshop on Virtual Machines and Intermediate Languages. ACM, 1--10.
[12]
Daniel Frampton, Stephen M. Blackburn, Perry Cheng, Robin J. Garner, David Grove, J. Eliot B. Moss, and Sergey I. Salishev. 2009. Demystifying magic: High-level low-level programming. In Proceedings of the International Conference on Virtual Execution Environments. ACM, 81--90.
[13]
Neal Glew, Spyridon Triantafyllis, Michał Clerniak, Marsha Eng, Brian Lewis, and James Stichnoth. 2004. LIL: An architecture-neutral language for virtual-machine stubs. In Proceedings of the Virtual Machine Research and Technology Symposium. USENIX Association, 111--125.
[14]
Urs Hölzle, Craig Chambers, and David Ungar. 1992. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 32--43.
[15]
Thomas Kotzmann, Christian Wimmer, Hanspeter Mössenböck, Thomas Rodriguez, Kenneth Russell, and David Cox. 2008. Design of the Java HotSpot™client compiler for Java 6. ACM Transactions on Architecture and Code Optimization 5, 1 (2008), Article 7.
[16]
Bernd Mathiske. 2008. Systems Programming in the Maxine VM: How to Enable It and How to Get Around It. Retrieved from http://www.agentgroup.unimo.it/pppj08/invtalk1.html.
[17]
OpenJDK 2013. Graal Project. Retrieved from http://openjdk.java.net/projects/graal.
[18]
Krzysztof Palacz, Jason Baker, Chapman Flack, Christian Grothoff, Hiroshi Yamauchi, and Jan Vitek. 2005. Engineering a common intermediate representation for the OVM framework. Science of Computer Programming 57, 3 (2005), 357--378.
[19]
Michael Paleczny, Christopher Vick, and Cliff Click. 2001. The Java HotSpot™ server compiler. In Proceedings of the Symposium on Java Virtual Machine Research and Technology. USENIX, 1--12.
[20]
Armin Rigo and Samuele Pedroni. 2006. PyPy’s approach to virtual machine construction. In Companion to the ACM SIGPLAN Conference on Object Oriented Programming Systems, Languages, and Applications. ACM, 944--953.
[21]
Ian Rogers and Dave Grove. 2009. The strength of metacircular virtual machines: Jikes RVM. In Beautiful Architecture, Diomidis Spinellis and Georgios Gousios (Eds.). O’Reilly, Chapter 10.
[22]
Andreas Sewe, Mira Mezini, Aibek Sarimbekov, and Walter Binder. 2011. Da Capo con Scala: Design and analysis of a Scala benchmark suite for the Java virtual machine. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications. ACM Press, 657--676.
[23]
Doug Simon. 2009. The Maxine Project: Snippets in the Maxine VM. Retrieved from https://wikis.oracle.com/display/MaxineVM/Snippets.
[24]
Ben L. Titzer, Thomas Würthinger, Doug Simon, and Marcelo Cintra. 2010. Improving compiler-runtime separation with XIR. In Proceedings of the International Conference on Virtual Execution Environments. ACM, 39--50.
[25]
David Ungar, Adam Spitz, and Alex Ausch. 2005. Constructing a metacircular virtual machine in an exploratory programming environment. In Companion to the ACM SIGPLAN Conference on Object Oriented Programming Systems, Languages, and Applications. ACM, 11--20.
[26]
Christian Wimmer, Michael Haupt, Michael L. Van De Vanter, Mick Jordan, Laurent Daynès, and Douglas Simon. 2013. Maxine: An approachable virtual machine for, and in, Java. ACM Transactions on Architecture and Code Optimization 9, 4 (2013), Article 30, 24 pages.
[27]
Thomas Würthinger, Christian Wimmer, and Hanspeter Mössenböck. 2008. Visualization of program dependence graphs. In Proceedings of the International Conference on Compiler Construction. Springer-Verlag, 193--196.

Cited By

View all
  • (2023)Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot CodeACM Transactions on Programming Languages and Systems10.1145/361293745:4(1-64)Online publication date: 13-Sep-2023
  • (2023)Optimization-Aware Compiler-Level Event ProfilingACM Transactions on Programming Languages and Systems10.1145/359147345:2(1-50)Online publication date: 26-Jun-2023
  • (2022)AmaruProceedings of the Genetic and Evolutionary Computation Conference Companion10.1145/3520304.3534016(1930-1937)Online publication date: 9-Jul-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Architecture and Code Optimization
ACM Transactions on Architecture and Code Optimization  Volume 12, Issue 2
July 2015
410 pages
ISSN:1544-3566
EISSN:1544-3973
DOI:10.1145/2775085
Issue’s Table of Contents
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 the author(s) 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: 24 June 2015
Accepted: 01 April 2015
Revised: 01 March 2015
Received: 01 November 2014
Published in TACO Volume 12, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Graal
  2. Java
  3. compiler
  4. dynamic compilation
  5. just-in-time compilation
  6. snippet

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)125
  • Downloads (Last 6 weeks)14
Reflects downloads up to 19 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot CodeACM Transactions on Programming Languages and Systems10.1145/361293745:4(1-64)Online publication date: 13-Sep-2023
  • (2023)Optimization-Aware Compiler-Level Event ProfilingACM Transactions on Programming Languages and Systems10.1145/359147345:2(1-50)Online publication date: 26-Jun-2023
  • (2022)AmaruProceedings of the Genetic and Evolutionary Computation Conference Companion10.1145/3520304.3534016(1930-1937)Online publication date: 9-Jul-2022
  • (2022)Enabling pipeline parallelism in heterogeneous managed runtime environments via batch processingProceedings of the 18th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments10.1145/3516807.3516821(58-71)Online publication date: 25-Feb-2022
  • (2021)Automatically exploiting the memory hierarchy of GPUs through just-in-time compilationProceedings of the 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments10.1145/3453933.3454014(57-70)Online publication date: 7-Apr-2021
  • (2020)Integrating heuristiclab with compilers and interpreters for non-functional code optimizationProceedings of the 2020 Genetic and Evolutionary Computation Conference Companion10.1145/3377929.3398103(1580-1588)Online publication date: 8-Jul-2020
  • (2018)Using compiler snippets to exploit parallelism on heterogeneous hardware: a Java reduction case studyProceedings of the 10th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages10.1145/3281287.3281292(16-25)Online publication date: 4-Nov-2018
  • (2018)Towards a framework for stochastic performance optimizations in compilers and interpretersProceedings of the 15th International Conference on Managed Languages & Runtimes10.1145/3237009.3237024(1-7)Online publication date: 12-Sep-2018
  • (2018)Debugging native extensions of dynamic languagesProceedings of the 15th International Conference on Managed Languages & Runtimes10.1145/3237009.3237017(1-7)Online publication date: 12-Sep-2018
  • (2018)Parallel trace register allocationProceedings of the 15th International Conference on Managed Languages & Runtimes10.1145/3237009.3237010(1-7)Online publication date: 12-Sep-2018
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media