Skip to main content

VM

Struct VM 

Source
pub struct VM {
    pub arena: Arena,
    /* private fields */
}
Expand description

The Aver bytecode virtual machine.

Fields§

§arena: Arena

Implementations§

Source§

impl VM

Source

pub fn new(code: CodeStore, globals: Vec<NanValue>, arena: Arena) -> Self

Source

pub fn start_profiling(&mut self)

Source

pub fn clear_profile(&mut self)

Source

pub fn profile_report(&self) -> Option<VmProfileReport>

Source

pub fn profile_top_bigrams(&self, n: usize) -> Vec<((u8, u8), u64)>

Source

pub fn set_cli_args(&mut self, args: Vec<String>)

Set CLI arguments for Args.get().

Source

pub fn set_silent_console(&mut self, silent: bool)

Source

pub fn set_runtime_policy(&mut self, config: ProjectConfig)

Set the runtime policy loaded from aver.toml.

Source

pub fn start_recording(&mut self)

Start recording effectful calls.

Source

pub fn start_replay(&mut self, effects: Vec<EffectRecord>, validate_args: bool)

Start replaying from recorded effects.

Source

pub fn recorded_effects(&self) -> &[EffectRecord]

Source

pub fn replay_progress(&self) -> (usize, usize)

Source

pub fn ensure_replay_consumed(&self) -> Result<(), VmError>

Source

pub fn run(&mut self) -> Result<NanValue, VmError>

Source

pub fn run_top_level(&mut self) -> Result<(), VmError>

Source

pub fn run_named_function( &mut self, name: &str, args: &[NanValue], ) -> Result<NanValue, VmError>

Source

pub fn call_function( &mut self, fn_id: u32, args: &[NanValue], ) -> Result<NanValue, VmError>

Auto Trait Implementations§

§

impl Freeze for VM

§

impl RefUnwindSafe for VM

§

impl !Send for VM

§

impl !Sync for VM

§

impl Unpin for VM

§

impl UnsafeUnpin for VM

§

impl UnwindSafe for VM

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V