WG211/M12Rompf

From WG 2.11
Jump to: navigation, search

Project Lancet: Surgical Precision JIT Compilers by Tiark Rompf

Just-in-time (JIT) compilation of running programs faces more optimization opportunities than offline compilation. Modern JIT compilers, such as those found in virtual machines (VMs) for Java or JavaScript rely on a limited set of dynamic properties, mainly inferred by profiling, as their key mechanism to guide optimization decisions. While JIT compilers offer good average performance across a wide range of programs, their behavior is a black box and in many cases, the achieved performance is highly unpredictable.

The goal of this work is to turn JIT compilation into a precision tool. Project Lancet is a JIT compiler framework for Java bytecode that tightly integrates with the running program itself. Lancet enables more deterministic performance and easy extensibility – for example allowing library developers to supply domain-specific compiler optimizations through JIT compiler macros.

I this talk we will also look at the implementation of Lancet, which is interesting from a program generation perspective. We started with a high-level interpreter for Java bytecode. We staged it using Lightweight Modular Staging (LMS). This turned the interpreter into a simple compiler, without extra work. We then extended the staging interface to perform abstract interpretation, which turned the simple compiler into an optimizing compiler. JIT macros are integrated with forward dataflow optimizations, largely avoiding phase ordering problems.