define_opcodes!() { /* proc-macro */ }Expand description
Emit the VM opcode definitions from a centralized declarative table.
See the crate-level doc for syntax. Generated outputs:
pub enum Op { ... }(#[repr(u8)],Debug + Clone + Copy + Eq)impl Op { const ALL: &[Self]; const COUNT: usize; fn from_byte(...) -> Option<Self> }impl crate::vm::Vm { fn execute_op_sync(...); async fn execute_op_async(...) }impl crate::chunk::Chunk { fn disassemble_op(...) }- One free
pub(crate) fn <flag>(op: Op) -> boolper declared flag. The well-known flagsreads_outer_nameandadaptive_binarymap toop_reads_outer_nameandis_adaptive_binary_oprespectively so existing call sites need no renames.