Skip to main content

Module disasm

Module disasm 

Source
Expand description

Text disassembly, in exactly the format the reference implementation prints.

This exists to be diffed. The reference compiler, built with -DDUMP_BYTECODE=1, prints its bytecode through js_dump_function_bytecode and dump_byte_code, and the differential test compares that text with ours character by character. Keeping the format identical means a mismatch points straight at the instruction that differs rather than at a formatting detail.

Format reference: js_dump_function_bytecode and dump_byte_code in quickjs.c.

Functions§

decode_operands
Decode one instruction’s operands from its payload bytes.
disassemble_code
Print the instruction stream.
disassemble_function
Print a function the way js_dump_function_bytecode does.
disassemble_program
Print a whole program in the order the reference emits it.
long_to_short
The short form a long instruction folds into, for the assembler.
print_atom
Print an atom the way js_print_atom2 does.