perf: String() 有限 double 转串加 16 槽 last-value 缓存

This commit is contained in:
2026-10-05 07:36:12 +00:00
parent 1dc9f41618
commit bfbab9431a
9 changed files with 145 additions and 21 deletions
+6
View File
@@ -76,6 +76,12 @@ impl Vm {
for &cached in self.template_objects.values() {
f(cached);
}
// f64→string 缓存槽值是 session 串,是 GC 根(漏根 → 串清扫释放 → 命中悬垂)。
for &v in &self.number_to_string_cache_vals {
if v.is_string() {
f(v);
}
}
for &entry in &self.iters.for_of_iters {
f(entry.iterator);
f(entry.last_result);