Bytecode * bytecode_new(void)
Allocate and initialize an empty Bytecode object.
int bytecode_add_instruction(Bytecode *bc, OpCode op, int32_t operand)
Append a single instruction to the instruction stream.
void bytecode_free(Bytecode *bc)
Free a Bytecode and all memory it owns.
OpCode
VM operation codes executed by the Fun virtual machine.
@ OP_RUST_HELLO_ARGS_RETURN
void bytecode_dump(const Bytecode *bc)
Print a human-readable dump of constants and instructions to stdout.
void bytecode_set_operand(Bytecode *bc, int idx, int32_t operand)
Patch the operand of a previously emitted instruction.
int bytecode_add_constant(Bytecode *bc, Value v)
Append a constant to a Bytecode's constant table.
Instruction * instructions
Tagged union representing a Fun value.
Defines the Value type and associated functions for the Fun VM.