Skip to content

Commit f54c5c6

Browse files
Peter Neissclaude
andcommitted
Phase 136: VM Core Variables - Identifier Modernization
Renamed 5 core variables in VirtualMachine::execute() main loop: - `cl` → `currentClosure` (~10 uses) - `k` → `constants` (~15 uses) - `base` → `stackFrameBase` (~30 uses) - `pc` → `programCounter` (~35 uses) - `trap` → `hooksEnabled` (~13 uses) **Total**: ~103 occurrences updated across VM hot path **Impact**: ⭐⭐⭐⭐ HIGH - Most frequently accessed variables in Lua VM - Currently: `cl`, `k`, `base`, `pc`, `trap` (require domain knowledge) - After: Self-documenting names (crystal clear semantics) **Files Changed**: src/vm/lvirtualmachine.cpp (1 file, ~103 uses) - Variable declarations (lines 97-101) - Lambda definitions (register access, state management, control flow) - Variable initialization (startfunc/returning labels) - Main execution loop (~1054 lines) **Testing**: All tests pass ✅ (2.22s) **Benchmark**: 10-run average = 2.18s ✅ (only 3.3% slower than 2.11s, well within tolerance!) **Performance**: Still 48% faster than 4.20s baseline! Target was ≤4.33s, we're at 2.18s. **Risk**: HIGH (VM hot path, 100+ uses) - but performance maintained! This was the highest-risk identifier modernization phase (VM core variables), but the performance impact was minimal (~3.3% regression) and still dramatically faster than baseline. The clarity improvement is substantial. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a76f2b9 commit f54c5c6

File tree

1 file changed

+80
-80
lines changed

1 file changed

+80
-80
lines changed

0 commit comments

Comments
 (0)