builder+vm: unify method calls via emit_unified_call; add RouterPolicy trace; finalize LocalSSA/BlockSchedule guards; docs + selfhost quickstart

- Unify standard method calls to emit_unified_call; route via RouterPolicy and apply rewrite::{special,known} at a single entry.\n- Stabilize emit-time invariants: LocalSSA finalize + BlockSchedule PHI→Copy→Call ordering; metadata propagation on copies.\n- Known rewrite default ON (userbox only, strict guards) with opt-out flag NYASH_REWRITE_KNOWN_DEFAULT=0.\n- Expand TypeAnnotation whitelist (is_digit_char/is_hex_digit_char/is_alpha_char/Map.has).\n- Docs: unified-method-resolution design note; Quick Reference normalization note; selfhosting/quickstart.\n- Tools: add tools/selfhost_smoke.sh (dev-only).\n- Keep behavior unchanged for Unknown/core/user-instance via BoxCall fallback; all tests green (quick/integration).
This commit is contained in:
nyash-codex
2025-09-28 20:38:09 +09:00
parent e442e5f612
commit dd65cf7e4c
60 changed files with 2523 additions and 471 deletions

View File

@ -11,8 +11,11 @@ Keywords (reserved)
Expressions and Calls
- Function call: `f(a, b)`
- Method call: `obj.m(a, b)` — internally rewritten to function form: `Class.m(me: obj, a, b)`
- Rewrite is defaultON; backends (VM/LLVM/Ny) receive the unified call shape.
- Method call: `obj.m(a, b)` — internally normalized to function form: `Class.m(me: obj, a, b)`
- DefaultONP4: Known 受信者かつ関数が一意に存在する場合に正規化userbox 限定)。
- それ以外Unknown/core/userinstanceは安全に BoxCall へフォールバック(挙動不変)。
- 環境で無効化: `NYASH_REWRITE_KNOWN_DEFAULT=0`(開発時の切替用)。
- バックエンドVM/LLVM/Nyは統一形状の呼び出しを受け取る。
- Member: `obj.field` or `obj.m`
Display & Conversion