hax
hax copied to clipboard
Optimize the resulting code object.
Currently, the code object we generate has too big of a stack, extra names/constants, and a ton of NOP
s. We should take a page out of peephole.c’s playbook and optimize this stuff. We do need to be careful, though, to not change any of the legitimate generated instructions (including user-specified NOP
s, which could be tricky).
Because this would make jumps basically impossible to write, #1 would most likely need to happen first.
This is mostly done! All that's left is compressing lnotab
, and being smarter about our stack size calculations.