- Add opt-in optimizations (defaults OFF) - Ret purity verifier: NYASH_VERIFY_RET_PURITY=1 - strlen FAST enhancement for const handles - FAST_INT gate for same-BB SSA optimization - length cache for string literals in llvmlite - Expand bench harness (tools/perf/microbench.sh) - Add branch/call/stringchain/arraymap/chip8/kilo cases - Auto-calculate ratio vs C reference - Document in benchmarks/README.md - Compiler health improvements - Unify PHI insertion to insert_phi_at_head() - Add NYASH_LLVM_SKIP_BUILD=1 for build reuse - Runtime & safety enhancements - Clarify Rust/Hako ownership boundaries - Strengthen receiver localization (LocalSSA/pin/after-PHIs) - Stop excessive PluginInvoke→BoxCall rewrites - Update CURRENT_TASK.md, docs, and canaries 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.2 KiB
2.2 KiB
Legacy By‑Name Call Removal Plan
Context
- Unified call system is default. VM routes by
Calleekind (Global/Method/Extern/…) - Legacy by‑name resolution (callee=None → string name lookup) is gated by env and OFF by default.
- Goal: remove legacy code path once parity is proven at integration/full levels.
Guards / Current Behavior
- 旧 by‑name 経路は削除済み。
NYASH_VM_ALLOW_LEGACYは廃止。 - 既定:
callee=None生成時は Fail‑Fast(Builder で Callee を必ず付与)。
Scope of Work
-
Identify callers that could still rely on legacy resolution
- Builder emissions that may omit
callee(should be none after Phase 1 refactor) - Any VM entry points or helpers constructing by‑name calls dynamically
- Older tests or tools expecting by‑name lookups
- Builder emissions that may omit
-
Ensure unified path covers them
- For Global user functions: attach
Callee::Global("Module.func") - For dynamic/indirect calls: mark
Callee::Valueand keep VM restrictions explicit - For extern‑like names: delegate via handlers/calls/externs.rs (SSOT)
- Normalize arity (
foo/1→foo) viautils::normalize_arity_suffix
- For Global user functions: attach
-
Strengthen tests
- Smokes/quick: unified path(by‑name 不可)を既に強制
- Integration/full: ユーザー関数呼び出し/extern 名正規化のカナリアを追加
- 旧ENV依存がないことを確認(
NYASH_VM_ALLOW_LEGACYは削除済)
-
Remove legacy code path
- Delete
src/backend/mir_interpreter/handlers/calls/legacy.rsand its resolver module - Drop env guard checks referring to legacy path (keep error message clarity)
- Update READMEs to remove temporary notes
- Delete
Readiness Criteria (before removal)
- quick/integration/full all green with legacy OFF
- No
callee=Noneemission in builder (verified by grepping MIR JSON / code review) - Extern SSOT accepts arity‑suffixed names; Global extern‑like names delegate properly
Rollback Plan
- Keep a small revertable commit boundary for legacy deletion
- If issues appear, reintroduce legacy.rs with the same path under a dev‑guard until fixed
Cross‑References
- handlers/calls/README.md (SSOT and boundaries)
- docs/ENV_VARS.md (env guards and policies)