pub struct Insn {
pub op: Opcode,
pub fused: Fused,
pub a: u32,
pub b: u32,
pub imm: u32,
pub offset: u32,
}Expand description
One decoded instruction.
a and b are the two operands: a slot index, a constant-pool index, an atom, an
immediate — or, for a jump, the index of the target instruction.
Fields§
§op: OpcodeThe opcode.
fused: FusedA fused form of this instruction and the next few, when they match a pattern
worth collapsing. Fused::None means “run op as it is”.
The fused form is a shorthand for a sequence the bytecode still contains: the dispatcher runs one record and skips the rest, so the bytecode, the disassembly and every jump target are unchanged. This is the one optimisation that reduces the number of dispatches rather than their cost, which is why it is worth the extra pass.
a: u32First operand, or a jump target as an instruction index.
b: u32Second operand.
imm: u32Third operand, used only by fusions that need a slot, an immediate and a jump
target at once (currently Fused::LtLocImmJump).
offset: u32Where this instruction started in the bytecode, for stack traces and the line
table. (pc is an index, and no longer answers that question.)