Amalgamating different JIT compilations in a meta-tracing JIT compiler framework

Most virtual machines employ just-in-time (JIT) compilers to achieve high-performance. Trace-based compilation and method-based compilation are two major compilation strategies in JIT compilers. In general, the former excels in compiling programs with more in-depth method calls and more dynamic branches, while the latter is suitable for a wide range of programs. Some previous studies have suggested that each strategy has its advantages and disadvantages, and there is no clear winner. In this paper, we present a new approach, namely, the meta-hybrid JIT compilation strategy. It combines trace-based and method-based compilations to utilize the advantages of both strategies. Moreover, it is realized as a meta JIT compiler framework; thus, we can generate a VM with a hybrid JIT compiler that can apply different program parts by merely writing an interpreter with our framework. We chose to extend a meta-tracing JIT compiler and supported the two compilations on it. As a prototype, we implemented a simple meta-tracing JIT compiler framework called BacCaml based on the MinCaml compiler by following RPython’s architecture. We evaluated its performance by creating a small functional programming language with BacCaml and running microbenchmark programs. Furthermore, we performed a synthetic experiment to confirm that there are programs that run faster by hybrid compilation.

[1]  Christian Wimmer,et al.  Self-optimizing AST interpreters , 2012, DLS.

[2]  Robert Hirschfeld,et al.  GraalSqueak: toward a smalltalk-based tooling platform for polyglot programming , 2019, MPLR.

[3]  L. Peter Deutsch,et al.  Efficient implementation of the smalltalk-80 system , 1984, POPL.

[4]  Hidehiko Masuhara,et al.  Improving Sequential Performance of Erlang Based on a Meta-tracing Just-In-Time Compiler , 2016, TFP.

[5]  Carl Friedrich Bolz,et al.  Tracing the meta-level: PyPy's tracing JIT compiler , 2009, ICOOOLPS@ECOOP.

[6]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeño JVM , 2000, OOPSLA '00.

[7]  Michael Leuschel,et al.  Runtime feedback in a meta-tracing JIT for efficient dynamic languages , 2011, ICOOOLPS@ECOOP.

[8]  Hanspeter Mössenböck,et al.  Bringing low-level languages to the JVM: efficient execution of LLVM IR on Truffle , 2016, VMIL@SPLASH.

[9]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[10]  Michael Franz,et al.  HotpathVM: an effective JIT compiler for resource-constrained devices , 2006, VEE '06.

[11]  Sam Tobin-Hochstadt,et al.  Pycket: a tracing JIT for a functional language , 2015, ICFP.

[12]  Michael Haupt,et al.  The SOM family: virtual machines for teaching and research , 2010, ITiCSE '10.

[13]  Robert Hirschfeld,et al.  How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: An Experience Report of Using the RPython Toolchain , 2016, IWST.

[14]  Guilherme Ottoni,et al.  The hiphop virtual machine , 2014, OOPSLA.

[15]  Nikolai Tillmann,et al.  SPUR: a trace-based JIT compiler for CIL , 2010, OOPSLA.

[16]  Mason Chang,et al.  Trace-based just-in-time type specialization for dynamic languages , 2009, PLDI '09.

[17]  Eliot Miranda Context Management in VisualWorks 5i , 1999 .

[18]  Laurence Tratt,et al.  The impact of meta-tracing on VM design and implementation , 2015, Sci. Comput. Program..

[19]  Guilherme Ottoni,et al.  HHVM JIT: a profile-guided, region-based compiler for PHP and Hack , 2018, PLDI.

[20]  Stéphane Ducasse,et al.  Tracing vs. partial evaluation: comparing meta-compilation approaches for self-optimizing interpreters , 2015, OOPSLA.

[21]  Robert Hirschfeld,et al.  GraalSqueak: A Fast Smalltalk Bytecode Interpreter Written in an AST Interpreter Framework , 2018, ICOOOLPS@ECOOP.

[22]  Eijiro Sumii,et al.  MinCaml: a simple and efficient compiler for a minimal functional language , 2005, FDPE '05.

[23]  Toshio Nakatani,et al.  Improving the performance of trace-based systems by false loop filtering , 2011, ASPLOS XVI.

[24]  Toshio Nakatani,et al.  A trace-based Java JIT compiler retrofitted from a method-based compiler , 2011, International Symposium on Code Generation and Optimization (CGO 2011).

[25]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[26]  Marc Feeley,et al.  Simple and Effective Type Check Removal through Lazy Basic Block Versioning , 2015, ECOOP.

[27]  Christopher A. Vick,et al.  The Java HotSpotTM Server Compiler , 2001 .

[28]  Michael Leuschel,et al.  Allocation removal by partial evaluation in a tracing JIT , 2011, PEPM '11.