Skip to main content

GcVM

Struct GcVM 

Source
pub struct GcVM { /* private fields */ }

Implementations§

Source§

impl GcVM

Source

pub fn new(bytecode: Bytecode) -> Self

Source

pub fn load_bytecode(&mut self, bytecode: Bytecode)

Replace the current main program while preserving the heap and globals.

Used by the REPL so later lines can read bindings created earlier. Old constant-pool owning refs are released; objects still reachable from globals stay alive.

Source

pub fn heap(&self) -> &GcHeap

Source

pub fn heap_mut(&mut self) -> &mut GcHeap

Source

pub fn set_capture_output(&mut self, capture: bool)

Capture puts/print output in-memory instead of writing to stdout.

Source

pub fn take_output(&mut self) -> String

Drain captured output while leaving capture enabled.

Source

pub fn set_global_bindings(&mut self, bindings: Vec<BindingDebugInfo>)

Record the compiler’s global definition ledger (slot order, rebindings included), used by GC reports for the named root set (see GlobalRoot) and by debugger snapshots for slot names.

Source

pub fn globals_initialized(&self) -> &[bool]

One flag per global slot: has OpSetGlobal written it? Debugger snapshots use this to tell a user-assigned null from a never-run let.

Source

pub fn take_debugger_hits(&mut self) -> (Vec<DebuggerHit>, usize)

Drain recorded debugger; snapshots plus the count of hits dropped after MAX_DEBUGGER_HITS. Recording resumes from zero afterwards.

Source

pub fn collect_garbage(&mut self) -> GcCollectionReport

Source

pub fn run(&mut self)

Source

pub fn run_with_budget( &mut self, instruction_budget: usize, ) -> Result<(), GcRuntimeError>

Source

pub fn run_with_budget_classified( &mut self, instruction_budget: usize, ) -> Result<(), GcClassifiedRuntimeError>

Execute with a budget and retain the category assigned at the raise site.

Source

pub fn last_popped_stack_elm(&self) -> Option<GcRef>

Source

pub fn export_last_result(&self) -> Option<Object>

Source

pub fn try_export_last_result(&self) -> Result<Object, String>

Source

pub fn last_result_string(&self) -> String

Auto Trait Implementations§

§

impl !RefUnwindSafe for GcVM

§

impl !Send for GcVM

§

impl !Sync for GcVM

§

impl !UnwindSafe for GcVM

§

impl Freeze for GcVM

§

impl Unpin for GcVM

§

impl UnsafeUnpin for GcVM

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.