mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
perf: BigInt 参与回收——对齐字符串 GC 路径
- SessionGc 新增 live_bigints 集合,mark 阶段扫描根与对象边标记存活 BigInt - process_edge 扩展 BigInt 值处理,scan_edges_for_mark 透传 live_bigints - 新增 sweep_session_bigints:按存活标记清扫不活跃 BigInt box - collect/collect_strings_only 收集流程接入 BigInt 清扫 - should_collect/should_collect_gc/should_collect_strings 纳入 BigInt 存在性判定 - for_each_value 新增 immutables_cache 根扫描,防止常量池 BigInt 被误回收 - 13 个 gc_runtime_tests 全部 PASS,无新增 clippy 警告
This commit is contained in:
@@ -748,6 +748,15 @@ impl Vm {
|
||||
for value in &self.regs {
|
||||
f(*value);
|
||||
}
|
||||
// immutables 缓存含 session BigInt(new_bigint 分配),未入根则被 sweep 释放
|
||||
// → 常量池加载时悬垂。perm 字符串无害(不在 session 集合中)。
|
||||
for once_lock in &self.immutables_cache {
|
||||
if let Some(immutable_vec) = once_lock.get() {
|
||||
for &value in immutable_vec.iter() {
|
||||
f(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
for frame in &self.frames {
|
||||
f(frame.saved_this);
|
||||
f(frame.saved_new_target);
|
||||
|
||||
Reference in New Issue
Block a user