refactor: abstract VM

This commit is contained in:
2026-05-13 18:28:18 +08:00
parent 21899f7380
commit 29fab93cd1
42 changed files with 1823 additions and 1410 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
#![allow(dead_code)]
use bumpalo::Bump;
use fix_abstract_vm::{ForceMode, StaticValue, VmCode, VmContext, VmRuntimeCtx};
use fix_builtins::PrimOpPhase;
use fix_codegen::disassembler::{Disassembler, DisassemblerContext};
use fix_codegen::{BytecodeContext, InstructionPtr, Op};
@@ -12,7 +13,7 @@ use fix_ir::{
GhostMaybeThunkRef, GhostRoIrRef, GhostRoMaybeThunkRef, GhostRoRef, Ir, MaybeThunk, RawIrRef,
ThunkId,
};
use fix_vm::{ForceMode, StaticValue, Vm, VmCode, VmContext, VmRuntimeCtx};
use fix_vm::Vm;
use ghost_cell::{GhostCell, GhostToken};
use hashbrown::{HashMap, HashSet};
use string_interner::{DefaultStringInterner, Symbol as _};
@@ -155,7 +156,7 @@ impl VmCode for CodeState {
fn compile_with_scope(
&mut self,
source: Source,
extra_scope: Option<fix_vm::ExtraScope>,
extra_scope: Option<fix_abstract_vm::ExtraScope>,
runtime: &mut impl VmRuntimeCtx,
) -> Result<InstructionPtr> {
let mut compiler = CompilerCtx {
@@ -163,7 +164,7 @@ impl VmCode for CodeState {
runtime,
};
let extra = extra_scope.map(|s| match s {
fix_vm::ExtraScope::ScopedImport { keys, slot_id } => {
fix_abstract_vm::ExtraScope::ScopedImport { keys, slot_id } => {
ExtraScope::ScopedImport { keys, slot_id }
}
});