MicroJIT: a template-based Just-in-Time compiler for constrained environments

Thumbnail Image



Journal Title

Journal ISSN

Volume Title


University of New Brunswick


The widespread adoption of Java Virtual Machine (JVM) runtime environments has increased application portability and security while making programming much more accessible. Programs that run on the JVM are initially interpreted, however, to improve performance, a Just in Time (JIT) compiler may be employed at run-time to translate parts of the program to native code. Later, the generated code can be executed directly, bypassing the need to interpret the code. Before code generation, some JIT compilers build an intermediate representation (IR) to apply transformations to, allowing for further performance improvements. For some constrained runtime environments, the overhead required by an optimizing JIT compiler may be too high to be useful. An alternative approach is to employ a non-optimized, template-based JIT compiler that copies predefined machine-code templates instead of generating and manipulating IR. In this work, we present such a JIT compiler, MicroJIT, geared toward generating native code as fast as possible for Eclipse OpenJ9, an open-source Java runtime environment. Our initial results for compilation time and memory overhead are promising. For our custom benchmarks, we can compile with significantly less overhead than the default optimizing JIT compiler in OpenJ9.