Expand description
Register-based bytecode and a stack→register translator.
The classic compiler emits stack bytecode. A real register VM executes
three-address instructions (Add dst, lhs, rhs) with a flat register file.
This module defines that IR and a translator that lowers stack bytecode to
register bytecode by simulating the operand stack and assigning each stack
slot a virtual register.
Structs§
- RegChunk
- A register-mode chunk (function body), i.e. one frame layout.
- Stack
ToRegister - Lower a stack instruction stream to register form.
Enums§
- BinKind
- CmpKind
- RegOp
- Three-address register instruction. Registers are
u16indices into a flat frame-local register file. Constants live in the chunk const table. - UnKind
- Wrap
Kind
Functions§
- parameter_
slots - Parameter /
thisslot count for a chunk: the translator’s starting stack height (RegChunk::param_slots), soletlocals land on their own registers.