Commit Graph

11 Commits

Author SHA1 Message Date
爱特每羊队 6da248872b feat: emit 模块编译(快照式链接:依赖子模块闭包 + import/export 域)
- emit_program_module:模块顶层编译(is_global_scope=false,顶层 this undefined 由 VM 按标志绑定)
- emit_module_into_ctx:预声明/闭包分析识别 export 包裹声明与 import 绑定
- 依赖收集:import/re-export/star 的 source 去重、循环检测、json/text 数据模块
- 导入绑定初始化:__moduleLinkGet 链接期检查;self-import 别名语义(export 处回写)
- export 域:声明/重导出/export */export default 就地注册命名空间
- re-export 链接检查移至 prelude(先于 body 求值)
- emit_module_call 参数打包连续寄存器(CALL_NATIVE 契约)
- CompileCtx 增 module_ns_reg/module_dep_ns_regs/self-import 映射
- 拆分 declaration helper(export 声明复用);function/class 表达式 emitter 提升可见性
2026-08-12 17:37:33 +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
爱特每羊队 da586082cc feat: rest 参数(function f(...args)),实参区收集数组 2026-08-10 00:33:25 +08:00
爱特每羊队 0d9e6eabc9 feat: async/await 语法支持(AWAIT 帧快照挂起/恢复 + 微任务驱动 + AsyncFunction intrinsics) 2026-08-09 22:02:15 +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
爱特每羊队 2777b00c82 feat: 调用实参 spread(f(...args) / new F(...args) / super(...args)) 2026-08-08 10:33:16 +08:00
爱特每羊队 04a6aa10f7 feat(emit): 实现默认参数(形参 initializer 与解构默认值) 2026-08-07 15:26:25 +08:00
爱特每羊队 328b8a3ddc docs: 补充注释与格式化 2026-08-06 23:10:27 +08:00
爱特每羊队 38d6c7a60e refactor(emit): 寄存器号 u8→u32 全链放宽,vreg 化去 checkpoint/reg_overflow(B005) 2026-08-06 16:31:16 +08:00
爱特每羊队 f461235f04 docs: 添加 Rustdoc 注释 2026-08-05 21:46:47 +08:00
爱特每羊队 bbdfca1a1c refactor(compiler): 拆分 oxide_emit 为独立 emit pass crate(依赖倒置) 2026-08-05 20:13:18 +08:00