Goal
Make every semantically eligible JavaScript function and program reach the bytecode VM, removing the current flat-slot lexical-scope barrier without weakening tree-walker equivalence.
Current boundary
The compiler now has explicit lexical scopes, checked TDZ/const slots, captured iteration environments, and direct-eval activation views. 81ce8599 adds exact ordinary block-function/CaseBlock lexical and Annex B bindings (#788), with required-bytecode Annex B function-code witnesses at 159/159. 8d772d15 adds program/suspendable environment-mode declarations (#790), including 153/153 required-bytecode Annex B global-code witnesses. e1afde2d removes the blanket rejection of nested suspendable templates inside ordinary VM functions through live defining-environment views (#794), with the concurrent-GC ownership prerequisite in #796. e0ed6eb1 installs complete callee parameter metadata (#795), and 8a1398ff preserves exact lexical private and field-initializer eval contexts across parameter entry and suspension (#797). These landed prerequisites have completed required integration in CI run 33113309062: all 53 executed jobs passed; the scheduled-only nightly job was skipped. Automatic tiering still follows workload policy; required-bytecode admission is not proof of default-tier selection or throughput leadership.
Scope
- Add explicit lexical-scope metadata and storage for block bindings, TDZ state, catch bindings, class names, and per-iteration environments.
- Preserve O(1) slot access for statically resolved bindings while allocating environment cells only where capture/dynamic lookup requires them.
- Compile top-level, functions, methods, constructors, arrows, generators, async functions, and async generators through one verified eligibility model.
- Model
eval,with, direct eval, global resolution,this,super,new.target, and upvalues with explicit dynamic barriers rather than blanket or unsafe admission. - Add compiler/VM/tree-walker differential generation for scopes, abrupt completion, closures, exceptions, suspend/resume, and proper tail calls.
- Publish admission counters by reason so remaining tree-walker execution is auditable.
No-workaround rules
- Do not flatten a scope whose identity/TDZ is observable, eagerly heap-allocate every local, disable per-iteration capture semantics, or silently route a failing compiled path to a different result.
- Tree-walker fallback remains exact during rollout but is not completion for a construct declared bytecode-eligible.
Acceptance
- Shadowing, TDZ, catch/class scopes, and per-iteration closures pass forced tree-walker/VM differentials.
- Eligible test262 and PR-249 programs execute through VM witnesses with identical result, exception, side effects, steps, and async ordering.
- Admission inventory reports every compiler rejection with a stable reason; no unclassified fallback remains.
- Focused VM, full unit, test262, no-GIL, TSan, threadfuzz, generator/async, debugger, and moving-GC gates pass.
- #460 records tree-walker/VM/tier attribution before and after without a regression caused by unnecessary heap environments.
Foundation
Architecture boundary: docs/architecture.md; bytecode/compiler paths: src/compiler.zig, src/bytecode.zig, and src/vm.zig.
Latest parameter-reference boundary
2865b8b4 (#798) admits exact lexical parameter references through existing checked resolution. Against 8a1398f, the same 9,643 positive paired files improve from 8,475 to 8,809 passes (+334, zero new failing paths); 834 existing failures remain. All 13 default-tier diagnostics retain 11,494 passes with byte-identical output (0 default-tier flips). Full local units: 2,020 pass / 1 skip / 0 fail/leak; focused ReleaseSafe+TSan and 700 seeded fuzz programs pass. Pushed CI 33127832028 is pending. #799 tracks the next assignment/update initializer boundary. These scoped gains do not complete universal admission, the separate #787/#791 ownership audits, or performance attribution.