|
|
edf4513b5a
|
refactor: complete MIR interpreter utility migration (Phase 2)
Migrate remaining argument validation and destination write patterns
to utility helpers introduced in Phase 1.
Changes:
- boxes_map.rs: 135 → 123 lines (-12)
* 6 arg validations → validate_args_exact()
* 7 destination writes → write_result()
- externals.rs: 219 → 206 lines (-13)
* 12 destination patterns unified
* Simplified env/future/modules handling
- boxes_string.rs: 209 → 197 lines (-12)
* 4 arg validations + 4 destinations unified
* Methods: replace, contains, lastIndexOf, concat, etc.
- boxes_array.rs: 64 lines (3 validations migrated)
* Methods: push, get, set
- boxes_object_fields.rs: 400 → 394 lines (-6)
* 2 arg validations (getField, setField)
Pattern Elimination:
- Argument validation: 15 → 0 (100% eliminated)
- Destination writes: 51 → 28 (45% eliminated)
Code Reduction:
- Phase 2: 43 lines removed (1.3%)
- Cumulative: 117-154 lines removed (3.5-4.6% of handlers/)
Test Results:
- Build: ✅ SUCCESS (no new warnings)
- MapBox: ✅ 37/37 passed
- StringBox: ✅ 30/30 passed
- ArrayBox: ⚠️ 13/14 (1 pre-existing failure)
Benefits:
- Unified error messages across all handlers
- Single source of truth for validation logic
- Easier maintenance and future refactoring
- Consistent behavior throughout codebase
Related: Phase 21.0 refactoring (DUPLICATION_ANALYSIS_REPORT.md)
Risk: Low (pure refactoring, behavior preserved)
|
2025-11-06 22:59:47 +09:00 |
|
|
|
8d179e9499
|
refactor: add MIR interpreter utility helpers (Phase 1)
- Add destination write helpers (write_box_result, write_void, write_result)
- Add argument validation helpers (validate_args_exact/range/min)
- Add receiver conversion helper (convert_to_box)
- Update handlers to use new helpers
Reduces code duplication:
- Destination patterns: 37 call sites converted
- Each replacement saves 2-3 lines (74-111 lines saved)
- Helper infrastructure: 178 lines added
- Net improvement: Reduced duplication + better maintainability
Impact:
- Build: ✓ SUCCESS (0 errors, 146 warnings)
- Tests: ✓ 8/9 smoke tests PASS
- Functionality: ✓ PRESERVED (no behavior changes)
Files created:
- src/backend/mir_interpreter/utils/mod.rs
- src/backend/mir_interpreter/utils/destination_helpers.rs
- src/backend/mir_interpreter/utils/arg_validation.rs
- src/backend/mir_interpreter/utils/receiver_helpers.rs
Files modified: 15 handler files
- arithmetic.rs, boxes.rs, boxes_array.rs, boxes_instance.rs
- boxes_map.rs, boxes_object_fields.rs, boxes_plugin.rs
- boxes_string.rs, calls.rs, extern_provider.rs, externals.rs
- memory.rs, misc.rs, mod.rs
Related: Phase 21.0 refactoring
Risk: Low (pure refactoring, no behavior change)
|
2025-11-06 22:50:46 +09:00 |
|
|
|
0455307418
|
refactor(phase-a): remove Cranelift/JIT backend legacy code (~373 lines)
Phase A cleanup - Safe deletions with zero risk:
## Deleted Files (6 files, 373 lines total)
1. Cranelift/JIT Backend (321 lines):
- src/runner/modes/cranelift.rs (45 lines)
- src/runner/modes/aot.rs (55 lines)
- src/runner/jit_direct.rs (152 lines)
- src/tests/core13_smoke_jit.rs (42 lines)
- src/tests/core13_smoke_jit_map.rs (27 lines)
2. Legacy MIR Builder (52 lines):
- src/mir/builder/exprs_legacy.rs
- Functionality inlined into exprs.rs (control flow constructs)
## Module Reference Cleanup
- src/backend/mod.rs: Removed cranelift feature gate exports
- src/runner/mod.rs: Removed jit_direct module reference
- src/runner/modes/mod.rs: Removed aot module reference
- src/mir/builder.rs: Removed exprs_legacy module
## Impact Analysis
- Build: Success (cargo build --release)
- Tests: All passing
- Risk Level: None (feature already archived, code unused)
- Related: Phase 15 JIT archival (archive/jit-cranelift/)
## BID Copilot Status
- Already removed in previous cleanup
- Not part of this commit
Total Reduction: 373 lines (~0.4% of codebase)
Next: Phase B - Dead code investigation
Related: #phase-21.0-cleanup
Part of: Legacy Code Cleanup Initiative
|
2025-11-06 22:34:18 +09:00 |
|
|
|
06a729ff40
|
vm(hako): add v1 reader/dispatcher (flagged), commonize mir_call handler, share block scan; smokes: add v1 hakovm canary; docs: 20.37/20.38 plans, OOB policy; runner: v1 hakovm toggle; include SKIP summary
|
2025-11-03 23:21:48 +09:00 |
|
|
|
a4f30ae827
|
Phase 20.34: expand MirBuilder internal library with comprehensive lowering boxes; add pattern registry and program scanning infrastructure; implement internal lowerers for if/loop/return patterns; add dev tools and comprehensive canary tests; update VM boxes and host providers for internal delegation; wire phase2034 test suite with 30+ canary scripts covering internal lowering scenarios
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
2025-11-03 16:09:19 +09:00 |
|
|
|
cb236b7f5a
|
json(vm): fix birth dispatch; unify constructor naming (Box.birth/N); JsonNode factories return JsonNodeInstance; quick: enable heavy JSON with probe; builder: NYASH_BUILDER_DEBUG_LIMIT guard; json_query_min(core) harness; docs/tasks updated
|
2025-09-27 08:45:25 +09:00 |
|
|
|
824ca600ea
|
refactor: 大規模ファイル分割とプラグインリファクタリング
## 🎯 プラグイン整理
- ✅ **nyash-json-plugin**: プロバイダー抽象化、NodeRep統一
- ✅ **nyash-string-plugin**: TLVヘルパー整理
- ✅ **nyash-net-plugin**: HTTPヘルパー分離、ソケット管理改善
- ✅ **nyash-counter-plugin/fixture-plugin**: 基本構造整理
## 📂 mir_interpreter分割
- ✅ **mir_interpreter.rs → mir_interpreter/ディレクトリ**
- mod.rs: メイン構造体定義
- execution.rs: 実行エンジン
- memory.rs: メモリ管理
- instructions/: 命令別実装
## 🔧 その他の改善
- テストファイル群の最適化
- LLVMコンパイラのメイン関数整理
- 不要なインポート削除
1000行超のファイルを適切なモジュール構造に分割完了!
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-09-25 01:09:48 +09:00 |
|