Profile source: zig-utils/zig-js#62 after cfed7bc
zig-js object_churn now spends 237 top-of-stack samples in Heap.headerForPayload from the dense replacement barrier. The generic writeBarrierFrom contract accepts arbitrary embedder pointers, so it correctly performs tolerant ownership classification for both child and owner. Some runtime paths, however, have exact live cells created by the same heap and need neither membership lookup nor fallback list scans.
Scope:
- add writeBarrierFromManaged(owner, child) for non-null exact live managed payloads
- derive headers directly and assert header magic in safety builds
- preserve nursery old-to-young owner remembering
- preserve incremental/concurrent marking handoff
- leave writeBarrier/writeBarrierFrom tolerant semantics unchanged
- share the post-classification marking helper to avoid logic drift
Acceptance:
- nursery test promotes an owner, stores a young exact child through the new barrier, and proves survival
- incremental barrier test proves a managed child becomes marked/retained
- existing wild/non-heap pointer tolerance tests remain on the generic API
- full zig-gc tests pass
- commit references this issue and is pushed as Chris without coauthors
- zig-js adoption is tracked separately and must show a pinned benchmark win before landing