Parent: #479 Related: #476, #478
Evidence
A current-main production cold-lifecycle profile used the real bench-comparison-zig-js independent_cold boundary with the process-wide libc allocator and precise GC. In a five-second sample, Heap.headerForPayload was the dominant active leaf at 1,951 top-of-stack samples. The recurring stack is Environment.put / Environment.assign -> tolerant barrierThunk -> headerForPayload slow fallback.
The realm-root Environment is embedded in Context and explicitly has gc_managed = false, but its write barrier currently passes that unmanaged address as though it might be a managed owner. Each binding write first classifies the exact managed child and then misses the embedded owner in the slab/index before scanning live cells. The ownerless compatibility barrier already implements the required semantics: remember the exact young target for nursery collection and shade it during incremental marking.
Scope
- Route only non-GC-managed Environment value stores through the existing ownerless barrier.
- Keep exact managed Environment owners on
writeBarrierFromManaged. - Add a focused witness that records null ownership for embedded roots and exact ownership for managed environments.
- Measure exact-parent production cold lifecycle, allocation/GC attribution, and unchanged checksums.
Correctness constraints
- Do not disable or defer any barrier.
- Embedded realm roots must still retain young children and shade children stored after root tracing.
- Managed environment old-to-young edges must retain exact-owner remembered-set behavior.
- Preserve moving GC, concurrent marking, no-GIL, OOM, and teardown behavior.
Acceptance
- Exact-parent cold-lifecycle medians improve with identical checksums.
- Focused nursery/incremental-root tests and TSan pass.
- Full units and relevant test262 scope have no regressions.