Commit Graph

174 Commits

Author SHA1 Message Date
pjh123 538a5670dc feat: Promise 基础子系统 + 微任务队列(resolve/reject/then/catch/finally + run() drain) 2026-08-09 21:08:53 +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 cd1bc206a5 fix: symbol 作属性键独立编码,不再塌缩为空串 2026-08-09 16:09:49 +08:00
pjh123 36fb61fc74 feat: 解构模式语义补齐(REST 枚举/getter/computed 排除、IteratorClose、RegAlloc def 干涉、for-in 捕获遮蔽) 2026-08-09 15:01:31 +08:00
pjh123 2bebd822d0 feat: TypedArray 第一批解锁(%TypedArray% 构造器、原型访问器、of/from、bind 绑参、harness) 2026-08-09 12:26:31 +08:00
pjh123 6c79dbb21c feat: class 私有成员语义(字段/方法/访问器 + brand 检查 + 契约修复) 2026-08-09 11:08:36 +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 826d9fd0a2 feat: RegExp.prototype 实现 Symbol.match/replace/search/split/matchAll 2026-08-08 22:33:32 +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 d186c4d9f2 feat: Function 构造器(动态编译字符串生成函数) 2026-08-08 03:07:26 +08:00
pjh123 0b68baa802 fix: delete 真正删除属性(shape 链重建 + 数组元素 hole 标记)
字节码 delete 原先只清值为 undefined,属性残留在 shape 链,hasOwnProperty/
keys/枚举仍可见。统一走共享 delete_own_property(与 Reflect.deleteProperty
一致):
- 命名属性经 shape 链重建移除,数组重建前保存并恢复元素区
- 数组下标元素标记为 hole(PropMetaEntry.hole),length 不变,
  存在性检查(resolve_property/get_own_property_slot/ordinary_get/for-in)
  判 hole,重赋值自动清除标记
- 不可配置属性统一返回 false(sloppy 语义,strict 抛错留待 emit 追踪严格模式)
- set_or_create_prop_value 数组下标键路由元素区,修复 delete 后重赋值误入
  shape 链

test262 Object +212 PASS/-102 FAIL,Array +149 PASS/-60 FAIL,无回归。
2026-08-08 02:25:13 +08:00
pjh123 bfcf132d73 feat: arguments 对象绑定(CREATE_ARGUMENTS + 帧实参 spill 区) 2026-08-08 00:01:22 +08:00
pjh123 bfc2312f6c fix: 数组元素写入越过元素区时搬移属性区 + defineProperty 数组索引走元素区 2026-08-07 23:20:32 +08:00
pjh123 31542a2576 fix: 数组属性存储机制(array_prop_count 显式元素数 + shape 属性偏移 + IC/prop_forge 对齐) 2026-08-07 21:53:45 +08:00
pjh123 76b3bcf6eb fix: 顶层模块 param_layout.base 改 0 防父槽误判 + regalloc/VM 诊断日志 2026-08-07 17:13:57 +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 98b07687f0 fix: CREATE_CLOSURE 越界改运行时错误防进程中断 2026-08-07 00:42:33 +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 77a52bf7e8 fix: 修复嵌套函数调用并接通闭包捕获链路 2026-06-30 21:52:18 +08:00
pjh123 56d41441e5 perf: 优化调用原型链的 IC 命中加速 2026-06-30 21:41:05 +08:00
pjh123 0166e0c849 perf: 消除热路径冗余检查 2026-06-30 21:02:45 +08:00
pjh123 f9449c52e3 fix: 修复嵌套函数调用并接通闭包捕获链路 2026-06-30 20:49:23 +08:00
pjh123 c58aae4862 feat: 搭建闭包捕获基础设施 2026-06-30 19:58:58 +08:00
pjh123 d5c292d33f style: 修复 clippy --all-targets 告警 2026-06-30 15:18:13 +08:00
pjh123 da75f3a214 perf: 字符串拼接用 push_to_string 消去中间分配, GC阈值 8M→32M
- oxide_runtime_api 新增 push_to_string: 直接将 JsValue 写入 String buffer
- dispatch_add / dispatch_compound_add 复用 Vm::string_buf, 每次concat从4次分配降到1次
- vm_support 新增 new_string_owned 接受 String 转移所有权
- kernel session_gc_threshold 8MB→32MB 减少频繁 GC
- build.sh: make clean 清跨平台 .obj 残留

(cherry picked from commit ad7b044a5a24b23819d783c5419d3e33f936dfc5)
2026-06-30 12:42:57 +08:00
pjh123 365b0e58f6 fix: Error原型属性、规范toString、V8风格stack trace 2026-06-27 20:13:17 +08:00
pjh123 e7a0d5aa16 feat: for-of 异常中断按规范关闭迭代器,next() 抛错可捕获并保留原始值 2026-06-27 18:28:07 +08:00
pjh123 9c4a169c33 fix: for-in 整数索引升序+字符串插入序枚举,null/undefined 空遍历 2026-06-27 17:15:32 +08:00
pjh123 27b7e8ad29 refactor: 重写 abstract_eq 为 ES §7.2.15 11 步算法 2026-06-27 13:23:35 +08:00
pjh123 d387347f80 feat: ToPrimitive 链支持 Symbol.toPrimitive 2026-06-27 11:22:37 +08:00
pjh123 3e7c082293 feat: 为 VM 添加结构化日志 2026-06-26 20:50:05 +08:00
pjh123 b95824fc9c fix: 统一错误模型 2026-06-26 16:52:14 +08:00
pjh123 59f6e4002a fix: 将同步原生调用参数限制错误消息对齐 ECMAScript 规范措辞 2026-06-26 16:41:21 +08:00
pjh123 f23d4e61b2 feat: 提取 oxide_builtins 独立 crate,泛型化 <H: VmHost> 2026-06-25 22:38:23 +08:00
pjh123 2f330dbe45 refactor: Symbol/Iter/Profiling 子结构方法下沉,IC helper 完成提取 2026-06-25 22:08:27 +08:00
pjh123 d195d7615c refactor: Vm 状态分组、dispatch 拆分为分发表、IC 辅助函数独立成模块 2026-06-25 19:22:16 +08:00
pjh123 00c38ba5f9 feat: 迁移 NativeResult 2026-06-25 18:32:09 +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