Commit Graph

39 Commits

Author SHA1 Message Date
pjh123 57a3148d77 perf: 数组回调字节码调用改寄存器窗口复用减少搬移 2026-08-13 20:11:09 +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 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 46e7bceb07 refactor: save/restore 收敛为字段表宏单一登记,补齐 accessor_frame_target_reg 2026-08-10 14:18:58 +08:00
pjh123 9d18eb2533 refactor: GeneratorState 收敛到 SuspendedFrame(save/restore/GC 遍历/string 边) 2026-08-10 13:28:14 +08:00
pjh123 5ced83e8c0 feat: async-generator 语义(async function*),yield/await 共存 + next 返回 Promise
- emit 识别 generator+async 组合,模块同时标记 is_generator/is_async
- 新增 AsyncGeneratorState:帧快照 + 请求队列 + 当前请求
- next/return/throw 返回 Promise,请求入队逐条处理
- YIELD 让出经 promise unwrap 后交付(yield rejected promise 关闭生成器)
- AWAIT 挂起保留当前请求,微任务恢复后继续执行
- %AsyncGeneratorPrototype% / %AsyncGeneratorFunction.prototype% 内建
- session GC / promote 支持异步生成器状态盒
- 普通 async 函数嵌套调用隔离外层异步生成器上下文
2026-08-10 01:52:03 +08:00
pjh123 fd47cd56d0 feat: async/await 语法支持(AWAIT 帧快照挂起/恢复 + 微任务驱动 + AsyncFunction intrinsics) 2026-08-09 22:02:15 +08:00
pjh123 538a5670dc feat: Promise 基础子系统 + 微任务队列(resolve/reject/then/catch/finally + run() drain) 2026-08-09 21:08:53 +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 a0c271ef3c fix: try 内 return 泄漏 TryHandler,异常跳回死函数 catch 死循环 2026-08-09 07:41:34 +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 bfcf132d73 feat: arguments 对象绑定(CREATE_ARGUMENTS + 帧实参 spill 区) 2026-08-08 00:01:22 +08:00
pjh123 710c8c8a2c fix: 闭包 upvalue cell 占位稳定化修复错读调用方表 2026-08-07 14:38:47 +08:00
pjh123 fd94ff6931 fix: 子模块全局扁平化根治逃逸闭包上下文错位 2026-08-07 10:49:15 +08:00
pjh123 dd5607ce1a fix: inline 回调支持 upvalue 闭包上下文 2026-08-07 00:23:35 +08:00
pjh123 710965b7f2 fix: new 构造 cell_stack 失衡与子模块 immutables 缓存失步 2026-08-07 00:15:09 +08:00
pjh123 31e28a03a6 docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
pjh123 fd267816f4 feat: 新增 MOV/SPILL/UNSPILL 执行语义 + spill 栈帧边界(D-06/D-07/D-08) 2026-08-06 16:51:01 +08:00
pjh123 263fd255b6 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
pjh123 435674d961 fix: 接通透传闭包值链路 2026-06-30 23:57:22 +08:00
pjh123 991e6040e5 fix: 修复闭包值传递链路 2026-06-30 22:52:25 +08:00
pjh123 f9449c52e3 fix: 修复嵌套函数调用并接通闭包捕获链路 2026-06-30 20:49:23 +08:00
pjh123 e7a0d5aa16 feat: for-of 异常中断按规范关闭迭代器,next() 抛错可捕获并保留原始值 2026-06-27 18:28:07 +08:00
pjh123 3e7c082293 feat: 为 VM 添加结构化日志 2026-06-26 20:50:05 +08:00
pjh123 d195d7615c refactor: Vm 状态分组、dispatch 拆分为分发表、IC 辅助函数独立成模块 2026-06-25 19:22:16 +08:00
pjh123 1cab5bde65 perf: 不可变常量改 OnceLock 一次性缓存,删 Constant 死变体并移出 GC 根 2026-06-25 14:32:49 +08:00
pjh123 c378b92d1a feat: 增加 CreateClosure 字节码,函数字面量每次执行创建新闭包 2026-06-25 10:16:32 +08:00
pjh123 d7bc6a9b4e perf: 模块树改用 Arc 持有,消除同步调用路径深层模块克隆 2026-06-24 22:52:25 +08:00
pjh123 12bfe551cf perf: 寄存器保存改用共享 save_stack,消除 Box<[JsValue]> 堆分配 2026-06-24 22:20:34 +08:00
pjh123 ddffa8504e refactor: 字符串值改用 JsString 指针表示,键与字面量改用 PermInterner 2026-06-24 20:15:15 +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
pjh123 b1cd4661ed refactor: 统一错误对象构造与异常类型传播 2026-06-23 14:51:58 +08:00
pjh123 2d166cbfa5 fix: 修复全局边界安全与内存稳定性问题 2026-06-22 19:43:00 +08:00
pjh123 391566ba5b feat: 实现for-of与解构赋值 2026-06-14 23:45:12 +08:00
pjh123 246ad72540 refactor: 拆分 Kernel 中可变 Session 与不可变 Core 2026-06-14 12:58:09 +08:00
pjh123 0f6dcef710 refactor: 拆分运行时入口与状态恢复逻辑 2026-06-14 00:17:27 +08:00