diff --git a/crates/oxide_vm/src/suspended.rs b/crates/oxide_vm/src/suspended.rs index 626f5365..ab3ec78d 100644 --- a/crates/oxide_vm/src/suspended.rs +++ b/crates/oxide_vm/src/suspended.rs @@ -142,11 +142,7 @@ impl SuspendedFrame { }; // 平表条目取 Arc 克隆(与调用方共享同一编译产物):后续 activate_immutables // 等 &mut 调用期间不持有对注册表的借用。 - let module = vm - .tables - .get(&gen) - .and_then(|t| t.modules.get(self.sub_idx as usize)) - .cloned(); + let module = vm.tables.get(&gen).and_then(|t| t.modules.get(self.sub_idx as usize)).cloned(); match module { Some(m) => vm.activate_immutables(gen, self.sub_idx as usize, &m), None => return Err("suspended state module table is no longer available".into()), diff --git a/crates/oxide_vm/src/vm_support.rs b/crates/oxide_vm/src/vm_support.rs index 14b34e35..08ba614b 100644 --- a/crates/oxide_vm/src/vm_support.rs +++ b/crates/oxide_vm/src/vm_support.rs @@ -77,8 +77,7 @@ impl FunctionFlags { } /// 模块级装载缓存条目三件套:已转换常量池、BigInt 自持存储、si 侧表。 -pub(crate) type ModuleLoadTriple = - (Arc>, Arc>, Arc>>); +pub(crate) type ModuleLoadTriple = (Arc>, Arc>, Arc>>); impl Vm { /// Cons(rope)节点保留的单元阈值:拼接总长(UTF-16 单元数)≤ 该值时 @@ -961,11 +960,7 @@ impl Vm { /// `new_bigint` 保持运行时专属(`BigInt(42)` 字面量、算术结果等), /// 两表 box 生命周期不相交,full_reset 拆除与条目 Drop 各释各的,无双放。 pub(crate) fn convert_module_constants(&mut self, module: &CompiledModule) -> ModuleLoadTriple { - let bigint_count = module - .constants - .iter() - .filter(|c| matches!(c, Constant::BigInt(_))) - .count(); + let bigint_count = module.constants.iter().filter(|c| matches!(c, Constant::BigInt(_))).count(); let mut bigint_storage = Vec::with_capacity(bigint_count); let mut values = Vec::with_capacity(module.constants.len()); for constant in &module.constants { diff --git a/crates/oxide_vm/src/vm_support/tests.rs b/crates/oxide_vm/src/vm_support/tests.rs index 74808837..296e02b2 100644 --- a/crates/oxide_vm/src/vm_support/tests.rs +++ b/crates/oxide_vm/src/vm_support/tests.rs @@ -530,10 +530,7 @@ fn module_cache_bigint_readable_after_full_reset() { assert!(result.is_bigint()); vm.full_reset(); // full_reset 不清装载缓存:条目 BigInt 存储归条目自持,拆除不悬垂。 - let entry = vm - .module_cache - .get(&Arc::as_ptr(&module)) - .expect("full_reset 不得清装载缓存"); + let entry = vm.module_cache.get(&Arc::as_ptr(&module)).expect("full_reset 不得清装载缓存"); let v = entry .immutables .iter()