perf: 不可变常量改 OnceLock 一次性缓存,删 Constant 死变体并移出 GC 根

This commit is contained in:
爱特每羊队
2026-06-25 14:32:49 +08:00
parent 1ef8349208
commit 06f769c4e0
9 changed files with 115 additions and 192 deletions
-3
View File
@@ -209,7 +209,6 @@ enum ConstantKey {
Boolean(bool),
Null,
Undefined,
BytecodeFunc(u32),
}
impl CompileCtx {
@@ -576,8 +575,6 @@ impl ConstantKey {
Constant::Boolean(v) => Some(Self::Boolean(*v)),
Constant::Null => Some(Self::Null),
Constant::Undefined => Some(Self::Undefined),
Constant::BytecodeFunc(v) => Some(Self::BytecodeFunc(*v)),
Constant::RegExp(_, _) => None,
}
}
}