Module bf::jit[][src]

Just-in-time compiles Brainfuck AST to x64 machine code (--features jit, nightly only)

This uses the dynasm crate to generate x86-64 machine code from peephole-optimized AST. This is currently the fastest implementation, but it is available only on nightly Rust because dynasm uses a plugin.

In the bfi interpreter, this pass is enabled by default if compiled in. To go even faster, pass the --unchecked flag to the bfi interpreter to disable memory bounds checking in the generated code. Note that this runs Brainfuck in unsafe mode, which means that programs that move the pointer outside the allocated memory will access and possibly overwrite arbitrary memory locations.

Structs

Program

The representation of a JIT-compiled program.

Traits

JitCompilable

Program forms that can be JIT compiled.

Functions

compile

Compiles peephole-optimized AST to x64 machine code.