pub struct BytecodeEmitter { /* private fields */ }Implementations§
Source§impl BytecodeEmitter
impl BytecodeEmitter
pub fn new() -> Self
Sourcepub fn register_agents(&self, vm: &mut BetVm)
pub fn register_agents(&self, vm: &mut BetVm)
After emit_program, call this to wire agent handler addresses into a VM.
pub fn emit_program(&mut self, program: &Program)
pub fn emit_function(&mut self, func: &Function)
pub fn emit_stmt(&mut self, stmt: &Stmt)
Sourcepub fn emit_entry_call(&mut self, func_name: &str)
pub fn emit_entry_call(&mut self, func_name: &str)
Emit a TCALL to a named function. Call this after emit_program() to
create an entry point that executes a specific function (typically main).
The TJMP in emit_program already points past all function bodies, so
code appended here is what actually runs at startup.
The function’s return value will be on the stack when the VM halts.
pub fn finalize(self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for BytecodeEmitter
impl RefUnwindSafe for BytecodeEmitter
impl Send for BytecodeEmitter
impl Sync for BytecodeEmitter
impl Unpin for BytecodeEmitter
impl UnsafeUnpin for BytecodeEmitter
impl UnwindSafe for BytecodeEmitter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more