pub struct BytecodeProgram {
pub instructions: Vec<Instruction>,
}Expand description
A compiled, flat sequence of Instructions.
Fields§
§instructions: Vec<Instruction>The ordered list of instructions.
Implementations§
Source§impl BytecodeProgram
impl BytecodeProgram
Sourcepub fn push(&mut self, instr: Instruction) -> usize
pub fn push(&mut self, instr: Instruction) -> usize
Append an instruction and return its absolute index.
Sourcepub fn patch_jump(&mut self, idx: usize, target: usize)
pub fn patch_jump(&mut self, idx: usize, target: usize)
Patch the jump target of the instruction at idx.
Panics in debug builds if idx does not contain a jump instruction.
Trait Implementations§
Source§impl Clone for BytecodeProgram
impl Clone for BytecodeProgram
Source§fn clone(&self) -> BytecodeProgram
fn clone(&self) -> BytecodeProgram
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BytecodeProgram
impl Debug for BytecodeProgram
Auto Trait Implementations§
impl Freeze for BytecodeProgram
impl RefUnwindSafe for BytecodeProgram
impl Send for BytecodeProgram
impl Sync for BytecodeProgram
impl Unpin for BytecodeProgram
impl UnsafeUnpin for BytecodeProgram
impl UnwindSafe for BytecodeProgram
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