Skip to main content

Module disasm

Module disasm 

Source
Expand description

Human-readable dumps of compiled bytecode (mailang disasm).

Two forms can be printed: the stack instruction stream the compiler emits (what --vm=stack runs) and the three-address register lowering the default VM runs (--vm=register names it explicitly). Operands are decoded exactly like the VMs decode them — constant-pool indices with their value, global slots with their name, jump targets as instruction indices, local slots as register numbers — so a dump can be read without counting bytes.

This is the view that the Phase N work needed and did not have: match delivering its value through the wrong protocol and the register backend’s dataflow heights are both visible in a few adjacent lines of a dump.

Functions§

disassemble_register
Register (three-address) IR for the same bytecode, lowered exactly like RegisterVm::new lowers it (same parameter_slots starting height).
disassemble_stack
Stack bytecode as the compiler emitted it. only limits the dump to one chunk index (all chunks when None).