mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
perf: member 复合写路径接入 IC 写命中(depth 0)消除每次 DashMap 查询与回写
set_member_prop 增加 ic_set_hit_own(仅接受 depth==0 槽,跳过读侧学习的 原型条目防原型污染)命中直写槽,ext_pc 由 read_member_prop 显式带出消除 隐式 pc 契约;写新属性 miss 分支(IC_SET 分发 + member 写)统一改 CreateDataProperty 快路径(保留原型链 setter/readonly 检查),砍掉 ordinary_set 全链路的重复查询与 shape 转换开销。
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
var ITERATIONS = 100000;
|
||||
|
||||
// 单态段:同一对象复合写,IC 读写全命中(写侧直写槽、零查表零回写)。
|
||||
var t = { x: 0 };
|
||||
for (var i = 0; i < ITERATIONS; i++) {
|
||||
t.x += 1;
|
||||
}
|
||||
|
||||
// 多态段:4 种 shape 轮换复合写,4 槽缓存覆盖,仅学习 miss。
|
||||
var objs = [{ x: 0 }, { x: 0, y: 1 }, { x: 0, z: 1 }, { x: 0, y: 1, z: 2 }];
|
||||
var s = 0;
|
||||
for (var i = 0; i < ITERATIONS; i++) {
|
||||
var o = objs[i % 4];
|
||||
o.x += 1;
|
||||
s += o.x;
|
||||
}
|
||||
t.x + s
|
||||
Reference in New Issue
Block a user