Commit Graph

39 Commits

Author SHA1 Message Date
pjh123 0d9004f8e2 perf: 对象字面量批量构造键序预建 shape 2026-08-14 04:47:15 +08:00
pjh123 df23fdff39 feat: compiler/test262 runner 接线 + 模块顶层 this 绑定
- Compiler::compile_module:Emitter::emit_program_module → 统一 IR 管线(DCE/regalloc/lower/flatten)
- CompiledModule.is_es_module:VM run 时模块顶层 this=undefined(脚本仍为全局对象)
- 全局注册 __moduleLinkGet
- test262 runner:Test262ModuleLoader(相对路径解析 + import attributes 判定 json/text/bytes),is_module 走 compile_module
2026-08-12 17:37:33 +08:00
pjh123 f1b7a908f9 fix: class 方法/访问器/constructor/prototype 属性描述符(非枚举/只读),新增 DEFINE_PROP_ATTRS/DEFINE_ACCESSOR_ATTRS
- opcode.rs/inst.rs/contract.rs/vm.rs/vm_dispatch_ctrl.rs:新增两个带 attrs 扩展字的 define 指令
  (attrs bit0=writable, bit1=enumerable, bit2=configurable,与 PropAttributes 一致)
- class/method.rs:方法与非计算访问器改按规范非枚举安装(DefineMethod 语义)
- class/prototype.rs:proto.constructor 非枚举;ctor.prototype 三标志全 false(MakeConstructor)
- 效果:language/statements/class 1782 pass/948 fail -> 1910 pass/716 fail(+128/-232)
2026-08-12 14:11:02 +08:00
pjh123 1824ef0df1 feat: num-bigint 接入任意精度 BigInt(字面量、算术、toString、asIntN/asUintN) 2026-08-12 03:15:18 +08:00
pjh123 b44bc3d7f2 feat: 新增 DEFINE_ACCESSOR_DYNAMIC opcode 支持计算键对象访问器 2026-08-10 23:28:18 +08:00
pjh123 078688070d feat: 实现最小 BigInt 子集(字面量/算术/比较/构造器,Temporal 前置) 2026-08-10 23:02:31 +08:00
pjh123 8a53bfb584 feat: 编译管线/类型层 crate 补全多级日志宏 + 关键路径日志 2026-08-10 17:56:28 +08:00
pjh123 8163a5d25e perf: 子模块树改 Arc 共享,run() 免深拷贝模块树 2026-08-10 17:23:29 +08:00
pjh123 7efb26bc96 perf: 函数调用 bytecode 改 Arc 共享(O(1) 帧切换 + IC 写时复制) 2026-08-10 15:08:51 +08:00
pjh123 03b510b2ef refactor: opcode 语义单张声明式表(def/use/pure/jump/term/ic 六维收敛) 2026-08-10 12:23:19 +08:00
pjh123 80cb1c2feb feat: 循环 let/const 每迭代绑定(MAKE_CELL_FRESH + 解构捕获修复) 2026-08-10 10:18:39 +08:00
pjh123 e03ec0f635 fix: 脚本顶层 var/function 声明落 globalThis(DEFINE_GLOBAL_PROP 非可配置数据属性) 2026-08-10 03:52:17 +08:00
pjh123 a5a910a24e feat: for-await-of + Symbol.asyncIterator + AsyncFromSyncIterator 2026-08-10 03:21:37 +08:00
pjh123 85c192a747 feat: rest 参数(function f(...args)),实参区收集数组 2026-08-10 00:33:25 +08:00
pjh123 fd47cd56d0 feat: async/await 语法支持(AWAIT 帧快照挂起/恢复 + 微任务驱动 + AsyncFunction intrinsics) 2026-08-09 22:02:15 +08:00
pjh123 464712f7ba feat: 实现 yield* 委托语法(内层迭代器 next/return/throw 转发) 2026-08-09 20:00:16 +08:00
pjh123 783e89e4cb feat: 生成器基础支持(YIELD 帧快照挂起/恢复 + GeneratorPrototype next/return/throw)
- 新增 YIELD/SUSPEND_BODY opcode;function* 识别与 yield emit
- GeneratorState 全量快照 VM 执行上下文(regs/pc/bytecode/spill/save/try/cell 栈段/迭代器)
- 调用时参数初始化(默认值/解构副作用与异常在 g() 时刻生效)
- %GeneratorPrototype%/%GeneratorFunction.prototype% 内建对象与 next/return/throw
- session GC trace 生成器状态 JsValues;闭包捕获分析补 yield/赋值目标扫描
2026-08-09 18:02:08 +08:00
pjh123 c8740bfb49 feat: 函数 length 属性(字节码函数/bind 包装器)+ getter/setter name 前缀 2026-08-09 15:38:45 +08:00
pjh123 088b3bc976 fix: opcode IC ext words 计数断言更新(新 opcode 增长) 2026-08-09 09:40:04 +08:00
pjh123 8669f55470 feat: class 公有字段 define 语义 + computed key 类定义期求值一次 2026-08-09 09:35:24 +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 cd214069cd fix: try/finally 支持 break/continue/return 穿越 finally(completion 机制) 2026-08-08 12:38:25 +08:00
pjh123 6c29515624 feat: 对象字面量 spread({...obj} 展开可枚举自有属性) 2026-08-08 11:24:09 +08:00
pjh123 ab979dc47b feat: 调用实参 spread(f(...args) / new F(...args) / super(...args)) 2026-08-08 10:33:16 +08:00
pjh123 bfcf132d73 feat: arguments 对象绑定(CREATE_ARGUMENTS + 帧实参 spill 区) 2026-08-08 00:01:22 +08:00
pjh123 de67cc8eee fix: 链式 upvalue 捕获支持多层嵌套函数引用深层变量 2026-08-07 14:56:51 +08:00
pjh123 fd94ff6931 fix: 子模块全局扁平化根治逃逸闭包上下文错位 2026-08-07 10:49:15 +08:00
pjh123 31e28a03a6 docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
pjh123 c46f7023c6 feat: 新增 MOV/SPILL/UNSPILL opcode 登记 + 构造 API + 契约层(D-06/D-07) 2026-08-06 16:34:25 +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 c58aae4862 feat: 搭建闭包捕获基础设施 2026-06-30 19:58:58 +08:00
pjh123 14f82d2c4d refactor: 用 define_opcodes! 宏统一生成 OpCode 枚举/TryFrom/Display 2026-06-25 18:12:37 +08:00
pjh123 1cab5bde65 perf: 不可变常量改 OnceLock 一次性缓存,删 Constant 死变体并移出 GC 根 2026-06-25 14:32:49 +08:00
pjh123 63737ef74d feat: 增加 CreateRegExp 字节码,正则字面量每次执行创建新对象 2026-06-25 10:28:35 +08:00
pjh123 c378b92d1a feat: 增加 CreateClosure 字节码,函数字面量每次执行创建新闭包 2026-06-25 10:16:32 +08:00
pjh123 94405f50d7 refactor: 移除代码注释中的文档内部编号引用 2026-06-24 16:03:53 +08:00
pjh123 1815958b11 refactor: 清理未使用符号,合并bind_constructor宏,统一init/rebind绑定列表,bind_number改为表驱动 2026-06-24 12:12:44 +08:00
pjh123 be87e4e21b refactor: 拆分 bytecode/cache crate 并模块化 counter 2026-06-23 17:06:39 +08:00