pub struct ByteCode {
pub name: CompactString,
pub arg_count: usize,
pub local_bindings: usize,
pub instructions: Arc<[Instruction]>,
pub source: Option<Arc<str>>,
pub instruction_source: Box<[Span]>,
}Expand description
Contains a set of instructions for the Spore VM to evaluate.
Fields§
§name: CompactStringThe name of the function.
arg_count: usizeThe number of arguments for the bytecode.
local_bindings: usizeThe number of space reserved for local bindings.
instructions: Arc<[Instruction]>The instructions for the bytecode.
source: Option<Arc<str>>The source code for the bytecode.
instruction_source: Box<[Span]>The span containing the instruction code from source.
Implementations§
Source§impl ByteCode
impl ByteCode
Sourcepub fn new_native_function_call(
name: &str,
func: NativeFunction,
arg_count: usize,
) -> ByteCode
pub fn new_native_function_call( name: &str, func: NativeFunction, arg_count: usize, ) -> ByteCode
Create bytecode that calls function with the top arg_count args in the stack.
Trait Implementations§
impl StructuralPartialEq for ByteCode
Auto Trait Implementations§
impl Freeze for ByteCode
impl RefUnwindSafe for ByteCode
impl Send for ByteCode
impl Sync for ByteCode
impl Unpin for ByteCode
impl UnwindSafe for ByteCode
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