Refactor (light): move VM value ops to backend/vm_values.rs; add backend/vm_boxcall.rs with call_box_method_impl and rewire call_unified_method. Update CURRENT_TASK for refactor start.

This commit is contained in:
Moe Charm
2025-08-26 00:48:09 +09:00
parent 63656c1d1b
commit 2a02eb7a52
7 changed files with 348 additions and 286 deletions

View File

@ -116,6 +116,17 @@ tools/ci_check_golden.sh # 代表ケースのMIR含有チェック
- 差分検証: `execute_instruction`/`execute_binop` に挿入したデバッグ出力が未出力→実行経路の相違が濃厚。
- 対応: 実行バイナリの署名チェックとコードパスの網羅的ログ追加でルート確定→修正。
### ✅ 小タスク完了2025-08-25 深夜)
- Verifier: Barrierの軽い文脈診断を追加`NYASH_VERIFY_BARRIER_STRICT=1`で有効)。
- ResultBox移行TODOを追加`docs/development/current/RESULTBOX_MIGRATION_TODO.md`)。
- VM: 旧`box_trait::ResultBox`扱いのデプリケーション警告を最小抑制(完全移行までの暫定)。
### ▶ リファクタリング開始(控えめ)
- 方針: 肥大化防止のため`src/backend/vm.rs`を2分割のみ実施。
- `vm_values.rs`: `execute_binary_op`/`execute_unary_op`/`execute_compare_op` を移動。
- `vm_boxcall.rs`: `call_box_method` を移動(`call_unified_method`は現状のまま)。
- 影響最小・挙動非変更で、可読性と責務分離を先行する。
### ⚠️ MIRビルダー引き継ぎポイントChatGPT5さんへ
- **状況**: MIRビルダーのモジュール化完了Phase 1-8コミット済み
- **問題**: MIR命令構造の変更により、expressions.rsでエラー発生

View File

@ -0,0 +1,19 @@
## ResultBox Migration TODO (Phase 9.78h follow-up)
Goal: fully migrate from legacy `box_trait::ResultBox` to `boxes::result::NyashResultBox` (aka `boxes::ResultBox`).
### Current usages (grep snapshot)
- src/backend/vm.rs
- Handles both new `NyashResultBox` and legacy `box_trait::ResultBox` for `.is_ok/.get_value/.get_error` (deprecation suppressed)。
### Proposed steps (small, incremental)
- Step 1: Keep dual handling but gate legacy path with feature flag or cfg for deprecation-only builds任意
- Step 2: Audit call sites that construct legacy ResultBox; replace with `boxes::result::NyashResultBox` constructors。
- Step 3: Remove legacy path from VM once no legacy constructors remain。
- Step 4: Delete/Archive legacy `box_trait::ResultBox`(テスト緑後)。
### Notes
- New API already aliased: `pub type ResultBox = NyashResultBox;` so external references may transparently resolve after migration。
- Keep migration scoped: do not mix with unrelated refactors。
Last updated: 2025-08-25