📚 Phase 11 documentation: Everything is Box × MIR15 revolution
Key updates: - Document MIR 26→15 instruction reduction plan (transitioning status) - Add Core-15 target instruction set in INSTRUCTION_SET.md - Save AI conference analyses validating Box Theory and 15-instruction design - Create MIR annotation system proposal for optimization hints - Update SKIP_PHASE_10_DECISION.md with LLVM direct migration rationale Technical insights: - RefNew/RefGet/RefSet can be eliminated through Box unification - GC/sync/async all achievable with 15 core instructions - BoxCall lowering can automatically insert GC barriers - 2-3x performance improvement expected with LLVM - Build time reduction 50%, binary size reduction 40% Status: Design complete, implementation pending
This commit is contained in:
@ -1,11 +1,21 @@
|
||||
# Nyash MIR Instruction Set (Canonical 26)
|
||||
# Nyash MIR Instruction Set (Canonical 26 → migrating to Core-15)
|
||||
|
||||
Status: Canonical (Source of Truth)
|
||||
Status: Canonical (Source of Truth) — transitioning
|
||||
Last Updated: 2025-08-25
|
||||
|
||||
この文書はNyashのMIR命令セットの唯一の参照(26命令)だよ。実装は常にこの一覧に一致し、総数はテストで26に固定する。
|
||||
この文書はNyashのMIR命令セットの唯一の参照(現状は26命令)だよ。Core-15 への段階移行を進めており、安定次第この文書を15命令へ更新し、テスト固定数も切り替える(移行中は26を維持)。
|
||||
|
||||
注意: Debug/Nop/Safepointはビルドモードでの降格用メタ命令であり、コア26命令には数えない。
|
||||
注意: Debug/Nop/Safepointはビルドモードでの降格用メタ命令であり、コア命令数には数えない。
|
||||
|
||||
Transition Note
|
||||
|
||||
- Builder/Rewrite/JIT は既に以下の統合を段階適用中
|
||||
- TypeCheck/Cast → TypeOp
|
||||
- WeakNew/WeakLoad → WeakRef
|
||||
- BarrierRead/BarrierWrite → Barrier
|
||||
- Print → ExternCall(env.console.log)(Deprecated)
|
||||
- VM/JIT の代表的な Core-15 カバー手順は `docs/reference/mir/MIR15_COVERAGE_CHECKLIST.md` を参照。
|
||||
- Core-15 安定後に本ドキュメントの「Core Instructions」を15命令へ更新し、マッピング表を併記する。
|
||||
|
||||
## Core Instructions(26)
|
||||
- Const
|
||||
@ -30,11 +40,24 @@ Last Updated: 2025-08-25
|
||||
- RefGet
|
||||
- RefSet
|
||||
- Await
|
||||
- Print
|
||||
- Print(Deprecated: ビルダーは発行しない。代わりに `ExternCall env.console.log` を使用)
|
||||
- TypeOp(TypeCheck/Cast統合)
|
||||
- WeakRef(WeakNew/WeakLoad統合)
|
||||
- Barrier(Read/Write統合)
|
||||
|
||||
## Core-15(Target; 移行中の最小コア)
|
||||
- 基本演算(5): Const, UnaryOp, BinOp, Compare, TypeOp
|
||||
- メモリ(2): Load, Store
|
||||
- 制御(4): Branch, Jump, Return, Phi
|
||||
- Box(3): NewBox, BoxCall, PluginInvoke
|
||||
- 配列(2): ArrayGet, ArraySet
|
||||
- 外部(1): ExternCall
|
||||
|
||||
Notes
|
||||
- Print/Debug/Safepointはメタ/Extern化(Print→ExternCall)。
|
||||
- WeakRef/Barrier は統合済み(旧WeakNew/WeakLoad/BarrierRead/WriteはRewriteで互換)。
|
||||
- Call は BoxCall/PluginInvoke へ集約(通常の関数呼び出しは将来Box化方針のもと整理)。
|
||||
|
||||
## Meta (降格対象; カウント外)
|
||||
- Debug
|
||||
- Nop
|
||||
|
||||
Reference in New Issue
Block a user