feat: 落地 Proxy set 组四 trap 完整语义与不变量检查

This commit is contained in:
2026-10-18 03:36:27 +00:00
parent 77a11f5f5d
commit 7f15f84139
13 changed files with 1093 additions and 199 deletions
+8
View File
@@ -492,6 +492,14 @@ impl Vm {
let receiver = self.regs[rd];
let obj = unsafe { &mut *obj_ptr };
// 代理对象恒走完整写路径:IC 命中 / 快路径直写会绕过 set trap
// (含 revoked 检查与不变量校验)。
if obj.is_proxy_obj() {
let prop_name_si = self.property_key_si(self.regs[b])?;
self.ordinary_set_dispatch(obj, prop_name_si, value, receiver, self.current_strict())?;
return Ok(());
}
// 命中路径零键零拦截:__proto__ 赋值从不写 IC,缓存槽必为数据槽。
if !obj.has_prop_meta()
&& (ic_set_hit(obj, cached_shape_id, cached_slot, cached_depth, value)