by
Yusuke Izawa,
Hidehiko Masuhara and Carl Friedrich Bolz-Tereick
Abstract:
Meta-compiler frameworks, such as RPython and Graal/Truffle, generate high-performance virtual machines (VMs) from interpreter definitions. Although they generate VMs with high-quality just-intime (JIT) compilers, they still lack an important feature that dedicated VMs (i.e., VMs that are developed for specific languages) have, namely multi-tier compilation. Multi-tier compilation uses light-weight compilers at early stages and highly optimizing compilers at later stages in order to balance between compilation overheads and code quality. We propose a novel approach to enabling multi-tier compilation in the VMs generated by a meta-compiler framework. Instead of extending the JIT compiler backend of the framework, our approach drives an existing (heavyweight) compiler backend in the framework to quickly generate unoptimized native code by merely embedding directives and compile-time operations into interpreter definitions. As a validation of the approach, we developed 2SOM, a Simple Object Machine with a two-tier JIT compiler based on RPython. 2SOM first applies the tier-1 threaded code generator that is generated by our proposed technique, then, to the loops that exceed a threshold, applies the tier-2 tracing JIT compiler that is generated by the original RPython framework. Our performance evaluation that runs a program with a realistic workload showed that 2SOM improved, when compared against an RPython-based VM, warm-up performance by 15%, with merely a 5% reduction in peak performance.
Reference:
A Lightweight Method for Generating Multi-Tier JIT Compilation Virtual Machine in a Meta-Tracing Compiler Framework (Yusuke Izawa, Hidehiko Masuhara and Carl Friedrich Bolz-Tereick), In Proceedings of of European Conference on Object-Oriented Programming (ECOOP 2025) (Alexandra Silva, Jonathan Aldrich, eds.), Schloss Dagstuhl: Leibniz-Zentrum für Informatik, 2025. (to appear)
Bibtex Entry:
@inproceedings{izawa2025ecoop,
author = {Yusuke Izawa and Hidehiko Masuhara and {Carl Friedrich} Bolz-Tereick},
title = {A Lightweight Method for Generating Multi-Tier {JIT} Compilation Virtual Machine in a Meta-Tracing Compiler Framework},
booktitle = {Proceedings of of European Conference on Object-Oriented Programming (ECOOP 2025)},
year = 2025,
editor = {Alexandra Silva and Jonathan Aldrich},
optvolume = {.},
location = {Bergen, Norway},
optnumber = {.},
series = {Leibniz International Proceedings in Informatics (LIPICS)},
url = {https://2025.ecoop.org/info/accepted-papers},
optpages = {.},
month = jul,
pdf = {ecoop2025.pdf},
publisher = {Schloss Dagstuhl: Leibniz-Zentrum f\"ur Informatik},
note = {to appear},
doi = {10.4230/LIPIcs.ECOOP.2025.8},
abstract = {Meta-compiler frameworks, such as RPython and Graal/Truffle, generate high-performance virtual
machines (VMs) from interpreter definitions. Although they generate VMs with high-quality just-intime
(JIT) compilers, they still lack an important feature that dedicated VMs (i.e., VMs that are
developed for specific languages) have, namely multi-tier compilation. Multi-tier compilation uses
light-weight compilers at early stages and highly optimizing compilers at later stages in order to
balance between compilation overheads and code quality.
We propose a novel approach to enabling multi-tier compilation in the VMs generated by a
meta-compiler framework. Instead of extending the JIT compiler backend of the framework, our
approach drives an existing (heavyweight) compiler backend in the framework to quickly generate
unoptimized native code by merely embedding directives and compile-time operations into interpreter
definitions.
As a validation of the approach, we developed 2SOM, a Simple Object Machine with a two-tier JIT
compiler based on RPython. 2SOM first applies the tier-1 threaded code generator that is generated
by our proposed technique, then, to the loops that exceed a threshold, applies the tier-2 tracing JIT
compiler that is generated by the original RPython framework. Our performance evaluation that
runs a program with a realistic workload showed that 2SOM improved, when compared against an
RPython-based VM, warm-up performance by 15\%, with merely a 5\% reduction in peak performance.}
}