skip to main content
research-article
Free Access

Snippets: Taking the High Road to a Low Level

Authors Info & Claims
Published:24 June 2015Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/320384.320418 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1297081.1297091 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Apache Software Foundation. 2011. Dynamic Runtime Layer Virtual Machine. Retrieved from http://harmony.apache.org/subcomponents/drlvm/.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/1167473.1167488 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/304065.304113 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1002/cpe.852 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/115372.115320 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/2542142.2542143 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1508293.1508305 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/143095.143114 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1369396.1370017 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  17. OpenJDK 2013. Graal Project. Retrieved from http://openjdk.java.net/projects/graal.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1016/j.scico.2004.08.007 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1176617.1176753 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/2048066.2048118 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Doug Simon. 2009. The Maxine Project: Snippets in the Maxine VM. Retrieved from https://wikis.oracle.com/display/MaxineVM/Snippets.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/1735997.1736005 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1094855.1094865 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/2400682.2400689 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1007/978-3-540-78791-4_13 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Snippets: Taking the High Road to a Low Level

          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

          Full Access

          • 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

            Copyright © 2015 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 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: 1 April 2015
            • Revised: 1 March 2015
            • Received: 1 November 2014
            Published in taco Volume 12, Issue 2

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article
            • Research
            • Refereed

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader