refactor: reorganize crate hierarchy

This commit is contained in:
2026-06-06 22:02:31 +08:00
parent 9412c319f9
commit 81ac08fb5a
53 changed files with 1422 additions and 1547 deletions
+7 -7
View File
@@ -1,6 +1,6 @@
use fix_abstract_vm::{NixType, resolve_operand};
use fix_common::StringId;
use fix_error::Error;
use fix_lang::StringId;
use fix_runtime::{NixType, resolve_operand};
use gc_arena::{Gc, RefLock};
use smallvec::SmallVec;
@@ -43,13 +43,13 @@ impl<'gc> crate::Vm<'gc> {
for _ in 0..static_count {
let key = reader.read_string_id();
let val = resolve_operand(&reader.read_operand_data(ctx), mc, self);
let val = resolve_operand(&reader.read_operand_data(), mc, ctx, self);
let _span_id = reader.read_u32();
kv.push((key, val));
}
for key in dyn_keys {
let val = resolve_operand(&reader.read_operand_data(ctx), mc, self);
let val = resolve_operand(&reader.read_operand_data(), mc, ctx, self);
let _span_id = reader.read_u32();
if let Some(key) = key {
kv.push((key, val))
@@ -124,7 +124,7 @@ impl<'gc> crate::Vm<'gc> {
ctx: &mut impl VmRuntimeCtx,
reader: &mut BytecodeReader<'_>,
) -> Step {
use fix_codegen::Op::*;
use fix_bytecode::Op::*;
loop {
match reader.read_op() {
SelectStatic => {
@@ -153,7 +153,7 @@ impl<'gc> crate::Vm<'gc> {
/// Skip the rest of a **HasAttr** attrpath after an intermediate
/// lookup failed. Only recognises HasAttr opcodes and jumps.
fn has_attr_skip(&mut self, reader: &mut BytecodeReader<'_>) -> Step {
use fix_codegen::Op::*;
use fix_bytecode::Op::*;
loop {
match reader.read_op() {
HasAttrPathStatic => {
@@ -314,7 +314,7 @@ impl<'gc> crate::Vm<'gc> {
let count = reader.read_u32() as usize;
let mut items: SmallVec<[Value; 4]> = SmallVec::with_capacity(count);
for _ in 0..count {
items.push(resolve_operand(&reader.read_operand_data(ctx), mc, self));
items.push(resolve_operand(&reader.read_operand_data(), mc, ctx, self));
}
let list = Gc::new(
mc,