Commit Graph

42 Commits

Author SHA1 Message Date
pjh123 8bdcb43aba perf: 三处手写压帧收敛单一入口并免实参堆 Vec 物化 2026-08-15 10:27:14 +08:00
pjh123 2239eeac24 perf: 字节码调用压帧窗口按调用点存活上界拷贝减少整窗搬移
RegAlloc 改写后补第三次 liveness,为每条 CALL/NEW/SUPER_CALL 计算调用点
存活上界(最大存活物理槽号 + 1,254/255 由帧单独保存不计入),编码进
ext 高 8 位(nargs 低 8 位不变)。三处手写压帧窗口 = min(调用方活动寄存
器, 存活上界),restore_frame 按窗口回拷;CallFrame 新增
caller_active_reg_limit 保存调用方真实活动上限,恢复时不随截断窗口缩水。
生成器/异步函数体调用点保持全量窗口。spread 调用与运行时发起压帧
(accessor/内联)走全量路径不受影响。
2026-08-15 09:56:22 +08:00
pjh123 17ee852ced fix: inline 回调窗口保存上限提到 254 覆盖物理槽 253
RegAlloc 合法产物 n_registers=254(builtin 槽落 253 或高活度着色)的
inline 字节码回调会写 regs[253],而 save_inline_state 窗口截断
regs_end.min(253) 漏存该槽,restore 不回拷 → 调用方 active_reg_limit=254
时 regs[253] 活动值静默丢失,与 native 分支 saved_r253 单存不对称。
窗口上限 253→254 后保存 regs[0..=253] + 254/255 单存,与全量 256 语义
逐槽等价;同步修正 InlineSyncState 与 save_inline_state 文档。

补三条回归:窗口 254 往返(含槽 253)、n_registers=254 inline 回调不
覆盖调用方活动 regs[253]、native 回调内嵌 254 寄存器 inline 回调不污染
外层 receiver 槽。
2026-08-15 04:16:59 +08:00
pjh123 fccf2063f1 perf: 数组回调字节码调用改寄存器窗口复用减少搬移 2026-08-13 20:11:09 +08:00
爱特每羊队 4303462d19 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
爱特每羊队 c90c610e15 perf: 子模块树改 Arc 共享,run() 免深拷贝模块树 2026-08-10 17:23:29 +08:00
爱特每羊队 eaf4825e4f perf: 函数调用 bytecode 改 Arc 共享(O(1) 帧切换 + IC 写时复制) 2026-08-10 15:08:51 +08:00
爱特每羊队 cc21c20a53 refactor: save/restore 收敛为字段表宏单一登记,补齐 accessor_frame_target_reg 2026-08-10 14:18:58 +08:00
爱特每羊队 abbabfc54e refactor: GeneratorState 收敛到 SuspendedFrame(save/restore/GC 遍历/string 边) 2026-08-10 13:28:14 +08:00
爱特每羊队 89a4e1bb86 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
爱特每羊队 0d9e6eabc9 feat: async/await 语法支持(AWAIT 帧快照挂起/恢复 + 微任务驱动 + AsyncFunction intrinsics) 2026-08-09 22:02:15 +08:00
爱特每羊队 dcbe3d9320 feat: Promise 基础子系统 + 微任务队列(resolve/reject/then/catch/finally + run() drain) 2026-08-09 21:08:53 +08:00
爱特每羊队 6f80c12ac9 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
爱特每羊队 d4fffcdcc6 fix: try 内 return 泄漏 TryHandler,异常跳回死函数 catch 死循环 2026-08-09 07:41:34 +08:00
爱特每羊队 2f8f1c3b71 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
爱特每羊队 a814dd0700 fix: try/finally 支持 break/continue/return 穿越 finally(completion 机制) 2026-08-08 12:38:25 +08:00
爱特每羊队 a206d0ef82 feat(vm): arguments 对象绑定(CREATE_ARGUMENTS + 帧实参 spill 区) 2026-08-08 00:01:22 +08:00
爱特每羊队 543f88ce86 fix(vm): 闭包 upvalue cell 占位稳定化修复错读调用方表 2026-08-07 14:38:47 +08:00
爱特每羊队 d1675c217d fix(vm): 子模块全局扁平化根治逃逸闭包上下文错位 2026-08-07 10:49:15 +08:00
爱特每羊队 c59518e899 fix(vm): inline 回调支持 upvalue 闭包上下文 2026-08-07 00:23:35 +08:00
爱特每羊队 f57cb0f051 fix(vm): new 构造 cell_stack 失衡与子模块 immutables 缓存失步 2026-08-07 00:15:09 +08:00
爱特每羊队 328b8a3ddc docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
爱特每羊队 6c0c30e5d5 feat(vm): 新增 MOV/SPILL/UNSPILL 执行语义 + spill 栈帧边界(D-06/D-07/D-08) 2026-08-06 16:51:01 +08:00
爱特每羊队 f461235f04 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
爱特每羊队 a4c13c4f6a fix: 接通透传闭包值链路 2026-06-30 23:57:22 +08:00
爱特每羊队 a17f98b02d fix: 修复闭包值传递链路 2026-06-30 22:52:25 +08:00
爱特每羊队 4271b7e348 fix: 修复嵌套函数调用并接通闭包捕获链路 2026-06-30 20:49:23 +08:00
爱特每羊队 11d69ea95c feat: for-of 异常中断按规范关闭迭代器,next() 抛错可捕获并保留原始值 2026-06-27 18:28:07 +08:00
爱特每羊队 b986a8f229 feat: 为 VM 添加结构化日志 2026-06-26 20:50:05 +08:00
爱特每羊队 bb3f1cf0e9 refactor: Vm 状态分组、dispatch 拆分为分发表、IC 辅助函数独立成模块 2026-06-25 19:22:16 +08:00
爱特每羊队 06f769c4e0 perf: 不可变常量改 OnceLock 一次性缓存,删 Constant 死变体并移出 GC 根 2026-06-25 14:32:49 +08:00
爱特每羊队 5007e7af7c feat: 增加 CreateClosure 字节码,函数字面量每次执行创建新闭包 2026-06-25 10:16:32 +08:00
爱特每羊队 12f66ae675 perf: 模块树改用 Arc 持有,消除同步调用路径深层模块克隆 2026-06-24 22:52:25 +08:00
爱特每羊队 33c0596c81 perf: 寄存器保存改用共享 save_stack,消除 Box<[JsValue]> 堆分配 2026-06-24 22:20:34 +08:00
爱特每羊队 466a0815ca refactor: 字符串值改用 JsString 指针表示,键与字面量改用 PermInterner 2026-06-24 20:15:15 +08:00
爱特每羊队 6bf5daa1af refactor: 清理未使用符号,合并bind_constructor宏,统一init/rebind绑定列表,bind_number改为表驱动 2026-06-24 12:12:44 +08:00
爱特每羊队 dbc15f6d1f refactor: 拆分 bytecode/cache crate 并模块化 counter 2026-06-23 17:06:39 +08:00
爱特每羊队 1ed6562063 refactor: 统一错误对象构造与异常类型传播 2026-06-23 14:51:58 +08:00
爱特每羊队 933612c89d fix: 修复全局边界安全与内存稳定性问题 2026-06-22 19:43:00 +08:00
爱特每羊队 21e3693c63 feat: 实现for-of与解构赋值 2026-06-14 23:45:12 +08:00
爱特每羊队 d242d08e6d refactor: 拆分 Kernel 中可变 Session 与不可变 Core 2026-06-14 12:58:09 +08:00
爱特每羊队 0df110946a refactor: 拆分运行时入口与状态恢复逻辑 2026-06-14 00:17:27 +08:00