perf: IC 多态化 4 槽缓存(FIFO 滚动写回)消除多态场景 miss 重解析

每条 IC 指令扩展字 3→8(4 槽 × [shape_id|proto_depth, slot]),命中槽 0
单态快路径零额外成本,槽 1..3 懒解码遍历,miss 写回 FIFO 滚动(新条目进
槽 0、最老丢弃)。修复原型链 IC 深度解析多走一步与 prop_forge 模板不匹配
不写回两个使缓存恒失效的问题。ic_cache 基准命中率 34.8%→78.9%,
耗时 -29%;单态 prop_access 因扩展字布局膨胀有 ~20% 取指回归(后续
side-table 方案可根除)。
This commit is contained in:
2026-08-15 06:40:19 +08:00
parent 96da78e817
commit b62348eb5d
9 changed files with 388 additions and 112 deletions
@@ -668,7 +668,7 @@ fn compile_dynamic_member_ops() {
);
}
/// 收集字节码指令序列,跳过 IC 扩展字(3 字)与其它扩展字,逐指令定位。
/// 收集字节码指令序列,跳过 IC 扩展字(IC_EXT_WORDS 字)与其它扩展字,逐指令定位。
fn scan_opcodes(module: &CompiledModule) -> Vec<OpCode> {
let mut ops = Vec::new();
let mut i = 0;
@@ -676,7 +676,7 @@ fn scan_opcodes(module: &CompiledModule) -> Vec<OpCode> {
let op = opcode::opcode(module.bytecode[i]);
ops.push(op);
i += 1 + if op.has_ic_ext_words() {
3
opcode::IC_EXT_WORDS
} else {
match op {
OpCode::SPILL