Complete iterative bytecode dispatch loop#1
Draft
alexryndin wants to merge 1 commit into
Draft
Conversation
alexryndin
added a commit
that referenced
this pull request
Jul 19, 2026
P15.34a — eliminate bcConstToValue re-interning (#1 perf hotspot, ~12.4%): - Add resolveProtoConstants: at first Proto execution, replace compile-time *LuaString (hash seed 0) with VM-interned pointers (per-VM seed) - bcConstToValue returns string constants directly — no re-hashing on every GETTABUP/GETFIELD/SETFIELD execution - Called from pushBytecodeExecFrame AND TAILCALL frame-reuse path - Ownership: after resolution, string constants owned by VM intern table, not by Proto (matching PUC's TString ownership model) - Results: global_arith -54%, field_access -59%, metamethod_add -13% P15.34b — PUC-faithful reader fixes (latent bug fixes): - Nil-fill missing parameters in pushBytecodeExecFrame (PUC luaD_precall) - Bound debug.getlocal/setlocal temp-scan by live_reg_top[pc] instead of scanning entire register window (fixes phantom temporaries from stale values) - Fix parked-coroutine GC scan: walk per-frame live_reg_top[fr.pc] instead of flat bytecode_stack[0..parked_top] scan (fixes SIGSEGV on coroutine.lua/cstack.lua) - cloneStrippedProto now copies live_reg_top - @Memset(regs, .Nil) kept as safety net: live_reg_top is per-statement high-water mark, not per-instruction after-boundary like PUC's L->top. Removal is a P15.35 prerequisite. Parity: 28/31 (no regressions), 44/44 smoke tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress based on
TODO-1. This draft temporarily contains a source-export workflow so the branch can be built and tested locally; it will be removed before review.