pub struct VM {
pub registers: Vec<JSValue>,
pub frames: Vec<CallFrame>,
pub frame_index: usize,
pub pc: usize,
/* private fields */
}Fields§
§registers: Vec<JSValue>§frames: Vec<CallFrame>§frame_index: usize§pc: usizeImplementations§
Source§impl VM
impl VM
pub fn new() -> Self
pub fn find_var_in_frame_stack(&self, name_atom: u32) -> Option<(usize, u16)>
pub fn get_var_in_caller_vm(&self, name_atom: u32) -> Option<JSValue>
pub fn set_var_in_caller_vm( &mut self, ctx: &mut JSContext, name_atom: u32, value: JSValue, ) -> bool
pub fn init_var_in_caller_vm( &mut self, ctx: &mut JSContext, name_atom: u32, value: JSValue, ) -> bool
pub fn set_var_in_frame_stack( &mut self, ctx: &mut JSContext, name: &str, value: JSValue, )
pub fn collect_roots(&self, ctx: &JSContext) -> Vec<JSValue>
pub fn maybe_gc(&mut self, ctx: &mut JSContext)
pub fn minor_gc(&mut self, ctx: &mut JSContext) -> usize
pub fn run_gc(&mut self, ctx: &mut JSContext) -> usize
pub fn call_function( &mut self, ctx: &mut JSContext, func: JSValue, args: &[JSValue], ) -> Result<JSValue, String>
pub fn call_function_with_this( &mut self, ctx: &mut JSContext, func: JSValue, this_value: JSValue, args: &[JSValue], ) -> Result<JSValue, String>
pub fn execute( &mut self, ctx: &mut JSContext, bytecode: &Bytecode, ) -> Result<ExecutionOutcome, String>
pub fn execute_preserving_registers( &mut self, ctx: &mut JSContext, bytecode: &Bytecode, ) -> Result<ExecutionOutcome, String>
pub fn execute_eval( &mut self, ctx: &mut JSContext, bytecode: &Bytecode, this_value: JSValue, caller_vm_ptr: Option<usize>, ) -> Result<ExecutionOutcome, String>
pub fn direct_eval( &mut self, ctx: &mut JSContext, source: &str, ) -> Result<JSValue, String>
pub fn execute_generator_step( &mut self, ctx: &mut JSContext, bytecode: &Bytecode, registers_snapshot: &[JSValue], start_pc: usize, ) -> Result<(JSValue, Vec<JSValue>, usize, bool), String>
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> 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