refactor: abstract VM
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use fix_abstract_vm::{resolve_operand, *};
|
||||
use fix_builtins::PrimOpPhase;
|
||||
use fix_error::Error;
|
||||
use gc_arena::{Gc, Mutation, RefLock};
|
||||
|
||||
use crate::value::*;
|
||||
use crate::{
|
||||
BytecodeReader, CallFrame, Closure, Env, ForceMode, Step, ThunkState, VmRuntimeCtx,
|
||||
VmRuntimeCtxExt,
|
||||
@@ -120,7 +120,7 @@ impl<'gc> crate::Vm<'gc> {
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> Step {
|
||||
let arg = reader.read_operand_data(ctx).resolve(mc, self);
|
||||
let arg = resolve_operand(&reader.read_operand_data(ctx), mc, self);
|
||||
let pc = reader.pc();
|
||||
self.call(reader, mc, arg, pc)
|
||||
}
|
||||
@@ -170,4 +170,14 @@ impl<'gc> crate::Vm<'gc> {
|
||||
self.env = env;
|
||||
Step::Continue(())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn op_dispatch_primop(
|
||||
&mut self,
|
||||
ctx: &mut impl VmRuntimeCtx,
|
||||
reader: &mut BytecodeReader<'_>,
|
||||
mc: &Mutation<'gc>,
|
||||
) -> Step {
|
||||
fix_primops::dispatch_primop(self, ctx, reader, mc)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user