JIT-8 is a CHIP-8 just-in-time compiler that targets x86-64 on Linux. Instead of interpreting instructions one by one, it compiles executed code paths directly.
This project explores how far a compact virtual machine can be pushed with JIT compilation. CHIP-8 is small enough to experiment quickly while still exposing real trade-offs around code generation, invalidation, and quirks handling.
The project is split into a few core parts:
According to the repository benchmarks, JIT-8 can be around 10x faster than the referenced interpreter in favorable cases. Programs with frequent self-modifying behavior may perform worse due to recompilation overhead.
mkdir build
cd build
cmake ..
make -j8
./jit8 <-t slowdown in ns> <-s shift quirks> <-i I register quirks> filepath_rom
Example:
./jit8 -t 500000 -s -i ../rom/c8games/BLINKY
Source code and details are available on GitHub:
For more details look at the following presentation!