A simple JIT written in C++ for brainfuck. This extends https://github.com/spencertipping/jit-tutorial to support brainfuck.
make
./jit mandelbrot.bf
- Simple macro assembler for generating machine code
- Supports calling back in to C++ (I had no idea the stack needed to be aligned to 16 bytes, that was a pain to debug)
- Uses tonnes of memory
- There is a debug flag in the top of main.cc to enable dumping the machine code.
- In gdb, break before jit entry, then do
layout asm
orlayout split
to see the generated code.ni
andsi
will let you jump over or into the assembly.