5 ms·
I've created several bytecode interpreters, mainly for bootloaders and cross-platform drivers. These environments are sometimes very space constrained, so usin
by trelliscoded 10y ago
I've created several bytecode interpreters, mainly for bootloaders and cross-platform drivers. These environments are sometimes very space constrained, so using the native instructions to do highly repetitive I/O to set up devices can blow your space budget. Instead, I shrink the instruction set down to (usually) 4 bit codes with packed immediate data in a 16 or 32 bit word. In one case, a SH4 based set-top box, this reduced the bootloader from 30+k down to a single flash page. This meant that we could have redundant bootloaders instead of just one copy, and that increased platform reliability and serviceability quite a bit.
I also wrote a BPF-like JIT for network packet matching once, targeting the QorIQ pattern matching engine as a backend.