pub struct GcVM { /* private fields */ }Implementations§
Source§impl GcVM
impl GcVM
pub fn new(bytecode: Bytecode) -> Self
Sourcepub fn load_bytecode(&mut self, bytecode: Bytecode)
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.
pub fn heap(&self) -> &GcHeap
pub fn heap_mut(&mut self) -> &mut GcHeap
Sourcepub fn set_capture_output(&mut self, capture: bool)
pub fn set_capture_output(&mut self, capture: bool)
Capture puts/print output in-memory instead of writing to stdout.
Sourcepub fn take_output(&mut self) -> String
pub fn take_output(&mut self) -> String
Drain captured output while leaving capture enabled.
Sourcepub fn set_global_bindings(&mut self, bindings: Vec<BindingDebugInfo>)
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.
Sourcepub fn globals_initialized(&self) -> &[bool]
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.
Sourcepub fn take_debugger_hits(&mut self) -> (Vec<DebuggerHit>, usize)
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.
pub fn collect_garbage(&mut self) -> GcCollectionReport
pub fn run(&mut self)
pub fn run_with_budget( &mut self, instruction_budget: usize, ) -> Result<(), GcRuntimeError>
Sourcepub fn run_with_budget_classified(
&mut self,
instruction_budget: usize,
) -> Result<(), GcClassifiedRuntimeError>
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.