2.0 KiB
2.0 KiB
Phase‑33 — Execution Plan (Native LLVM AOT)
Milestones
- Skeleton & Contract (this phase)
- Add C ABI header + stub implementation returning NYI
- CMake project in
c/llvm-native/without LLVM linkage - Document API and error policy; keep defaults unchanged (llvmlite)
- Minimal Codegen
- Implement JSON→IR→OBJ for: const i64 / ret / binop / compare+branch
- Target: Linux x86_64 only; opt-level configurable
- Add canaries mirroring existing AOT tests (return/binop/if)
- Linking
- Implement
.o + libhako_kernel.a → exe - Provide flags for relocation model / LTO (optional)
- Add canaries to assert rc/last-line parity with VM/llvmlite
- Packaging & Toggle
- Provide
--aot-engine native/HAKO_AOT_ENGINE=native, fall back to llvmlite if native unavailable - Doc: system LLVM vs. bundled releases; size/perf trade-offs
Acceptance (Phase 33)
- C ABI skeleton present and isolated; repository builds unchanged by default
- Plan/README written; follow-up work scoped to Phase 34+
Current Blockers (2025‑10‑31)
- Harness error in
ny-llvmcpath:unexpected indent (mir_call.py, line 26)→ JSON→EXE が停止。 - Workspace includes missing plugin crates (
plugins/nyash-aot-plugin等) →--features llvmビルドが失敗。 - AOT userbox canary は環境不足(動的プラグイン未構築、パーサ互換)で SKIP。
Immediate Steps
- Fix harness indentation (mir_call.py) → return 7 カナリアを緑化(EXE 生成・rc 7)。
- Exclude missing plugins from workspace(またはダミーcrate)→
cargo build --features llvmが通る状態へ。 - Optional: アーカイバ helper を復帰(
.o + libnyash_kernel.a → exe)し、ハーネス迂回のバックアップ経路を確保。
Notes
- main ブランチは docs のみコミット済み。AOT の作業差分は phase33 ブランチで継続(混在回避)。
- 既定は llvmlite 維持。native は opt‑in(失敗時は llvmlite に自動フォールバック)。