Implement call-site type signal backpropagation to reduce Unknown receiver types and increase Array/Map get/set/has externcall conversion coverage. **Implementation:** - New function: tmap_backprop (collections_hot.hako:82-164) - Propagates type signals from call sites: push→Array, stringy key→Map, linear index→Array - Fixpoint iteration (max 2 rounds) - Control: NYASH_AOT_CH_BACKPROP=1 (default ON) - Enhanced is_stringy_key_in_block - Detects toString method, StringBox const, binop + StringBox const - Diagnostic logging with NYASH_AOT_CH_TRACE=1 - "[aot/collections_hot] backprop recv=<vid> => arr|map via method=<mname>" **Results:** Test case: /tmp/arraymap_min.hako - ORIG: 7 boxcalls, 0 externcalls - PREP: 1 boxcall, 6 externcalls (86% reduction) - jsonfrag: 0 (structure preserved) Benchmark: tools/perf/microbench.sh --case arraymap --exe - ORIG: 8 boxcalls - PREP: 2 boxcalls, 6 externcalls (75% reduction) - Array: push(1), get(1), set(1) = 3 externcalls - Map: set(2), get(1) = 3 externcalls - Remaining: toString(2) = 2 boxcalls (expected) **Benefits:** - Unknown receiver type reduction via call-site analysis - Improved optimization coverage for Array/Map operations - Opt-in design, CFG unchanged, jsonfrag=0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
LLVM Script Builder (opt-in, Phase 20.11)
目的
- Python llvmlite ハーネスで行っている IR 構築を、Hakorune スクリプトの薄い箱で段階的に置き換える。
- 責務は「IR 構築」に限定し、リンクおよび実行は小ライブラリ(libhako_aot)/AotBox に委譲する。
ゲート
- HAKO_LLVM_SCRIPT_BUILDER=1 で有効化(既定OFF)
- 厳格化(未実装はFAIL): HAKO_LLVM_SCRIPT_BUILDER_STRICT=1(既定はFAIL推奨)
責務境界(Box)
- LLVMModuleBox: モジュール作成・型/レイアウト設定・関数登録
- LLVMFunctionBox: 関数定義・基本ブロック追加
- LLVMBuilderBox: 命令構築(v0: const/binop/ret から開始)
- LLVMTypesBox: 代表的なプリミティブ型クエリ
- LLVMEmitBox: オブジェクト出力(当面は AotBox へ委譲予定)
Fail‑Fast
- 未実装/未対応は
UNSUPPORTED: <op>を短文で出力して負値を返す(将来は統一エラーへ)。
将来拡張
- v1: compare/branch/phi、v2: call/extern(hako_* の C-ABI のみ)
- MIR→IR の対応は SSOT に集約し、Builder は小さな純関数にまとめる。