A Copy-and-Patch Just-in-Time Compiler for Boa
Currently, the JavaScript engine Boa relies exclusively on a register-based interpreter, which limits its performance. This project proposes implementing the initial version of a Just-in-Time (JIT) compiler for Boa that operates alongside the existing interpreter. Specifically, the JIT compiler will be based on the copy-and-patch technique described by Xu and Kjolstad (2021) and implemented in python/cpython#113464. Unlike traditional JIT approaches that compile code at runtime, copy-and-patch generates executable code by copying precompiled machine code templates and patching them with runtime values such as stack variable offsets. This approach enables measurable performance improvements while avoiding extensive runtime overhead, which is important to Boa’s role as an embeddable engine. The primary goal of this project is to deliver the first JIT compiler for Boa. While only moderate immediate performance improvements are expected, the project aims to provide a solid foundation for future refinement and work toward higher execution speed.
Project details
Technologies
Not listed in the archive