dfajit
JIT compilation of DFA transition tables to native x86_64 machine code.
Quick Start
use ;
let mut table = new;
table.set_transition;
table.set_transition;
table.add_accept;
table.set_pattern_length;
let jit = compile.unwrap;
let mut matches = Vecnew;
assert_eq!;
Features
- Real x86_64 machine code emission (not interpreted)
- W^X memory safety (RW → RX via mprotect)
- Hopcroft DFA minimization
- Range analysis for multi-byte stride optimization
- Serialization (to_bytes / from_bytes)
- Convenience builders:
from_patterns,from_regex_patterns - scan_count, scan_first, has_match fast paths
- Interpreted fallback for large DFAs (>4096 states)
License
MIT