Parents: #785, #477 Related: #771, #784
Reproduction and cause
The new #785 moving-safepoint witness creates a slot-backed lexical binding inside with, enters direct eval, requests a nursery relocation, and calls an already-native numeric loop. On returning from that nested VM activation, lexical access throws ReferenceError. Activation.saved_env lives only in the arena-backed Activation, outside the registered Exec roots; popActivation restores the stale pre-move Environment pointer. The same audit finds other saved caller Values and object pointers outside the precise root set. Existing Exec.saved_home_object/saved_super_ctor demonstrate the correct ownership pattern.
Scope
Move managed caller restoration state into the existing registered Exec root view, trace and relocate every managed edge, preserve exact state through normal return, throw, tail-call inheritance, and activation reuse, and add deterministic moving-GC coverage. Do not change operand-stack, queue, job, Promise, Worker, or iterator implementations.
Acceptance
- Saved caller Environment, this/new.target, realm/global, import-meta, active function, and this-cell contents remain rooted and relocate precisely.
- Return, abrupt completion, tail-call inheritance, and activation reuse preserve exact caller identities without stale retained edges.
- A moving-safepoint regression proves actual relocation during nested eval/native execution and resumes exact bindings afterward.
- Focused normal and TSan root/activation tests plus relevant Test262 accounting pass; full required gates are reported explicitly.
No pinning, disabled compaction, snapshots, conservative-stack dependency, or interpreter fallback.
Completed integration
CI run 33113309062 completed successfully on main commit 8a1398ffc04e9e30987f968693667c7271ca3ce1, a descendant containing this implementation. All 53 executed jobs succeeded (unit and TSan-unit shards, Linux no-GIL TSan, functional/no-GIL corpus gates, fuzz profiles, ABI, Wasm, Test262 parallel, and docs); the scheduled-only nightly job was skipped. Together with the measured local evidence in the comments, this completes this issue's acceptance.
The independently scoped provisional root-registration/preparation defect remains open in #787. This closure covers registered caller-root relocation and exact eval environment identity, not that outstanding activation-driver ownership work. The exposed capture-metadata race was fixed and verified in #789.