style: 自动格式化

This commit is contained in:
2026-10-12 19:47:16 +00:00
parent d026ea626e
commit f78f7617fd
3 changed files with 4 additions and 16 deletions
+1 -5
View File
@@ -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()),
+2 -7
View File
@@ -77,8 +77,7 @@ impl FunctionFlags {
}
/// 模块级装载缓存条目三件套:已转换常量池、BigInt 自持存储、si 侧表。
pub(crate) type ModuleLoadTriple =
(Arc<Vec<JsValue>>, Arc<Vec<num_bigint::BigInt>>, Arc<Vec<Option<u32>>>);
pub(crate) type ModuleLoadTriple = (Arc<Vec<JsValue>>, Arc<Vec<num_bigint::BigInt>>, Arc<Vec<Option<u32>>>);
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 {
+1 -4
View File
@@ -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()