A Lightweight Method for Generating Multi-Tier JIT Compilation Virtual Machine with a Meta-Tracing Compiler Framework

Jun 30, 2025·
Yusuke Izawa and Hidehiko Masuhara and Carl Friedrich Bolz-Tereick
· 0 min read
Abstract
Meta-compiler frameworks can generate high-performance virtual machines (VMs) from interpreter definitions. Despite the success of frameworks such as RPython and Graal/Truffle, creating multi-tier JIT compilation VMs within these frameworks remains challenging. Traditional high-performance VMs address this by using multiple compilers that are optimized for different trade-offs between compilation speed and code quality. Replicating this structure in meta-compiler frameworks, however, involves substantial development effort. We propose an approach, in the context of a meta-compiler framework, to adding a lightweight compiler that takes a different compilation strategy from an existing heavyweight compiler without requiring a new JIT compiler backend. By treating interpreter definitions as not only specifications for language semantics but also as compilation strategies, our approach enables RPython to generate the essential components for a multi-tier JIT compilation VM. We validate our approach with 2SOM, a two-level compilation VM for Simple Object Machine. 2SOM incorporates two JIT compilers: a tier-1 threaded code generator that quickly produces subroutine threaded code for warm-up phase, and tier-2 tracing JIT compiler that optimizes frequently executed loops. Our performance evaluation, using a program with a realistic workload, showed that 2SOM improved warm-up performance by 15% from an RPython-based VM in compensation for a peak performance reduction of merely 5%.
Type
Publication
39th European Conference on Object-Oriented Programming (ECOOP 2025)