A flexible framework for studying trace-based just-in-time compilation. (January 2018) - Vandercammen, Maarten; Marr, Stefan; De Roover, Coen
Highlights: STRAF, a minimalistic meta-compilation framework for experimenting with trace-based compilation for interpreters, is proposed. The STRAF framework enables tracing of a range of interpreters, given that these interpreters satisfy a minimal set of requirements identified in this paper. In contrast to existing meta-compilation frameworks, STRAF emphasises flexibility and extensibility over performance. To maximize flexibility of the framework, STRAF is divided in a tracing component that is fixed to the framework and a pluggable interpreter that is to be provided by the interpreter developers. The paper precisely details the workings of the framework by providing a set of formal semantics, as well as offering a practical implementation. Abstract: Just-in-time compilation has proven an effective, though effort-intensive, choice for realizing performant language runtimes. Recently introduced JIT compilation frameworks advocate applying meta-compilation techniques such as partial evaluation or meta-tracing on simple interpreters to reduce the implementation effort. However, such frameworks are few and far between. Designed and highly optimized for performance, they are difficult to experiment with. We therefore presentSTRAF, a minimalistic yet flexible Scala framework for studying trace-based JIT compilation.STRAF is sufficiently general to support a diverse set of language interpreters, but also sufficiently extensible to enable experiments with trace recording and optimization. We demonstrate the former by plugging two different interpreters intoSTRAF . We demonstrate the latter by extendingSTRAF with e.g., constant folding and type-specialization optimizations, which are commonly found in dedicated trace-based JIT compilers. The evaluation shows thatSTRAF is suitable for prototyping new techniques and formalisms in the domain of trace-based JIT compilation.