Snippets: Taking the High Road to a Low Level

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.

[1]  Samuele Pedroni,et al.  PyPy's approach to virtual machine construction , 2006, OOPSLA '06.

[2]  Hanspeter Mössenböck,et al.  Graal IR : An Extensible Declarative Intermediate Representation , 2013 .

[3]  Bowen Alpern,et al.  Implementing jalapeño in Java , 1999, OOPSLA '99.

[4]  Perry Cheng,et al.  Demystifying magic: high-level low-level programming , 2009, VEE '09.

[5]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[6]  Jong-Deok Choi,et al.  The Jalape�o Dynamic Optimizing Compiler for JavaTM , 1999, JAVA '99.

[7]  Hanspeter Mössenböck,et al.  Visualization of Program Dependence Graphs , 2008, CC.

[8]  Hanspeter Mössenböck,et al.  An intermediate representation for speculative optimizations in a dynamic compiler , 2013, VMIL '13.

[9]  Thomas Würthinger,et al.  Improving compiler-runtime separation with XIR , 2010, VEE '10.

[10]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[11]  Stephen M. Blackburn,et al.  The Moxie JVM Experience , 2007 .

[12]  Mira Mezini,et al.  Da capo con scala: design and analysis of a scala benchmark suite for the java virtual machine , 2011, OOPSLA '11.

[13]  Davide Ancona,et al.  RPython: a step towards reconciling dynamically and statically typed OO languages , 2007, DLS '07.

[14]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[15]  Brian T. Lewis,et al.  The Open Runtime Platform: a flexible high‐performance managed runtime environment , 2005, Concurr. Pract. Exp..

[16]  Brian T. Lewis,et al.  LIL: An Architecture-Neutral Language for Virtual-Machine Stubs , 2004, Virtual Machine Research and Technology Symposium.

[17]  Michael Haupt,et al.  Maxine: An approachable virtual machine for, and in, java , 2013, TACO.

[18]  Cliff Click,et al.  The java hotspot TM server compiler , 2001 .

[19]  Hanspeter Mössenböck,et al.  Design of the Java HotSpot#8482; client compiler for Java 6 , 2008, TACO.

[20]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

[21]  Jan Vitek,et al.  Engineering a common intermediate representation for the Ovm framework , 2005, Sci. Comput. Program..

[22]  David M. Ungar,et al.  Constructing a metacircular Virtual machine in an exploratory programming environment , 2005, OOPSLA '05.