Files
hakorune/docs/private/roadmap/selfhosting/mir-generation-p2-p3.md

30 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

MIR Generation — Phase 15.7 (P2/P3)
Scope
- P2: binop/unary/loop の最小形を共有箱MirSchema/BlockBuilderで提供し、emit 経路を薄アダプタで接続JSON形状は互換
- P3: Call 統一の最小導線Extern/Global/Method/Constructorを JSON 生成面に追加。VM/LLVM 実行は既存の registry/adapter に準拠。
Shared Boxes
- selfhost/shared/common/mir/mir_schema_box.hako
- inst_const/ret/compare/branch/jump/binop
- inst_mir_call_extern/global/method/constructorargsは i64 wrap
- selfhost/shared/common/mir/block_builder_box.hako
- const_ret, compare_branch, binop, loop_counter
- extern_call_ret/global_call_ret/method_call_ret/constructor_call_ret最小形
Emit Adaptation
- selfhost/compiler/pipeline_v2/emit_mir_flow_map.hakoP1/P2
- selfhost/compiler/pipeline_v2/emit_mir_flow.hakoP1/P2/P3
- 返却は `{ functions:[...] }` に制限(既存互換)。将来は module(version/kind) へ昇格可能。
Extern Path (P3 Minimal)
- op_eq: `mir_call callee=Extern("nyrt.ops.op_eq") args=[lhs,rhs] -> ret`
- 代表スモークrconly:
- selfhost_pipeline_v2_op_eq_vmtrue
- selfhost_pipeline_v2_op_eq_false_vmfalse
Next
- Global/Method/Constructor の代表rc-onlyを追加最小呼出
- Eq/Ne の Builder 正規化を導入フラグ→安定後に既定ON