Commit Graph

18 Commits

Author SHA1 Message Date
pjh123 c564ec539b emit/kernel: 可写 builtin 全局标识符写双写全局属性,三常量描述符对齐规范 c:false,受限词法名集补 eval
- 谓词注册表化:targets_readonly_builtin 解析条件抽公共助手,新增
  targets_writable_builtin / is_writable_builtin_global(BUILTIN_GLOBALS
  减只读三常量派生,不复制名单)+ 只读/可写划分漂移守卫单测
- 12 个赋值族写点(简单/复合/更新/逻辑赋值、解构两臂、for-in/for-of
  标识符目标)补双写臂:STORE_VAR 后 0x98 同步全局对象属性(既有可写
  属性原地更值、保 e/c 位),裸读镜像与 globalThis 反射不失步
- for-in 头 tier 写点移除 builtin 名例外:可写 builtin 名迭代键照规范
  覆写全局属性(三常量仍由拦截臂跳过)
- 三常量(undefined/NaN/Infinity)全局描述符 configurable 翻正为
  false:delete 拒绝、属性保留,描述符读同步
- 脚本顶层受限词法名集 3→4(补 eval,静态受限臂):let/const/class
  eval 顶层声明编译期 SyntaxError
- 配套钉:7 处既有钉随 c 位翻正 + 2 枚 for-in/eval 形态钉反转,新增
  global_builtin_writable_tests(16 钉:双写六形态 + 遮蔽/strict/eval/
  宿主名面)

test262 子集:built-ins/global 29/29、三常量族 20/20、11.13.1-4 7/7、
assignmenttargettype plain 8/8 全绿;language/global-code 17 失败文件
双树单跑一致(pre-existing);annexB assignmenttargettype 7 个 parse
error 为既有解析器缺口
2026-09-13 10:46:10 +00:00
pjh123 44c16cab8a fix: 顶层 var 读写直连全局对象属性单一真值——GDI 序言 + 声明处同步删除,类原型 session 直分防晋升克隆 identity 分裂,自增减 int 保持 2026-09-12 15:48:32 +00:00
pjh123 430231236d fix: 未声明标识符读写混合解析——读侧登记的全局槽写不穿透全局对象
未声明名由首次引用侧登记全局槽:读侧(LOAD_GLOBAL 槽)登记后,
后的写点只查写侧集合,补全局对象属性写被跳过——条件读走全局
属性、写落脚本内寄存器,脱节成死循环;更新式/复合式/逻辑赋值的
旧值又取自入口快照槽(读从不刷新槽),先读后写算出陈旧值。

写点隐式全局判定改读写登记集合取并(7 处),RMW 旧值读前经
LOAD_GLOBAL_TYPEOF 从全局对象取当前值(缺失按 undefined,sloppy
未解析引用 GetBaseValue 语义),读侧登记集合随继承绑定传入子
函数 ctx。
2026-09-11 10:14:56 +00:00
pjh123 b77a9322e5 fix: 不可写全局内置(undefined/NaN/Infinity)寄存器镜像写编译期拦截——sloppy 静默 no-op、strict 抛 TypeError 2026-09-09 23:17:01 +08:00
pjh123 d9c2847730 fix: sloppy 未声明写隐式全局创建 + strict ReferenceError——DEFINE_GLOBAL_PROP_C 0x98 2026-09-09 18:44:38 +08:00
pjh123 75153a909d fix: 未声明标识符读取抛 ReferenceError(typeof 特判返回 undefined) 2026-08-16 00:10:08 +08:00
pjh123 bca463438d fix: for-const 循环 update 段豁免 const 写检查(per-iteration 绑定合法) 2026-08-15 22:29:09 +08:00
pjh123 26db7ae07c fix: TDZ 写与 const 赋值检查补全(含闭包捕获路径) 2026-08-15 21:55:43 +08:00
pjh123 0c22a0e968 fix: class 类名绑定经 dedicated cell 捕获(C===Cv 恒等)+ upvalue 写入 const guard(getter 赋值抛 TypeError) 2026-08-12 17:30:28 +08:00
pjh123 973778f181 fix: 块级 let/const/class 预声明 + TDZ 读取运行时抛 ReferenceError 2026-08-10 21:07:39 +08:00
pjh123 80cb1c2feb feat: 循环 let/const 每迭代绑定(MAKE_CELL_FRESH + 解构捕获修复) 2026-08-10 10:18:39 +08:00
pjh123 6c79dbb21c feat: class 私有成员语义(字段/方法/访问器 + brand 检查 + 契约修复) 2026-08-09 11:08:36 +08:00
pjh123 5611d90ad0 feat: with 语句、成员位/移位复合赋值、CALL_NATIVE 无目标修复
with 语句:新增 emit 支持,with 体内自由标识符动态解析(对象属性优先,
回退外层),支持读/写/复合赋值/自增自减/delete/var 初始化动态化,
TO_OBJECT opcode 处理原始值对象,顶层 this 绑定全局对象。

复合赋值:新增 6 个 COMPOUND_MEMBER_BIT_* opcode 支持成员位/移位复合赋值,
修复 computed member 复合赋值覆盖 bug,with 内标识符复合赋值动态化。

CALL_NATIVE:实现全局 isNaN/isFinite 并绑定,用户覆盖 builtin 名时
回退通用调用路径而非报错,局部遮蔽 builtin 名走普通 CALL。

test262: with 34 pass(基线 0),compound-assignment 320 pass(基线 223)
2026-08-09 07:22:46 +08:00
pjh123 fca660110d fix: LOAD_UPVALUE 的 uv_idx 改 Imm 编码避免被 RegAlloc 重写 2026-08-07 16:09:17 +08:00
pjh123 31e28a03a6 docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
pjh123 224d1347eb refactor: 寄存器号 u8→u32 全链放宽,vreg 化去 checkpoint/reg_overflow 2026-08-06 16:31:16 +08:00
pjh123 263fd255b6 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
pjh123 7c8f19f61a refactor: 拆分 oxide_emit 为独立 emit pass crate(依赖倒置) 2026-08-05 20:13:18 +08:00