Parent: #97 Related: #62, #98, #102
Evidence
A fresh 10-second ReleaseFast sample of clean 24656d74, exact shared object_churn 8x100, shows these collapsed top-of-stack counts across the worker threads:
gc.allocObjectBatch: 5,759Heap.headerForPayload: 5,574Heap.create: 5,413__ulock_wait2: 2,712Heap.sweepPhaseLocked: 2,170GcCellBacking.allocFn: 1,574Heap.collectYoung: 1,299GcCellBacking.freeFn: 65
The retained object-allocation quick loop accounts 61 VM steps per iteration and is bounded to the next 1,024-step safepoint. A 16-iteration batch consumes 976 logical steps. When fewer than 61 steps remain, the quick path returns null and the interpreter executes one complete generic iteration. That generic iteration uses unbatched Heap.create, tolerant barrier classification through headerForPayload, and parallel metadata locking. All eight workers repeatedly converge on that fallback around collection boundaries.
Direction
Allow an already-guarded, non-calling quick-loop iteration to cross at most one internal VM safepoint, then immediately service the crossed checkpoint from fully materialized frame/stack state before any next JS instruction. Preserve exact maximum-step behavior and do not allow arbitrary checkpoint skipping. Prefer a general quick-loop checkpoint handoff if it is safe for the other guarded loop plans.
Acceptance criteria
- Never execute the generic loop body solely because less than one specialized iteration remains before a safepoint.
- Service every crossed checkpoint immediately after the atomic specialized iteration, with live accumulator/IP/frame roots materialized.
- Preserve stop/termination, GIL-yield, GC safepoint, maximum-step, exception-step, and observable re-entry semantics.
- Add boundary tests immediately before/at/after a 1,024-step checkpoint and near
max_steps. - Exact-parent direct and shared 1/2/4/8
object_churnA/B keeps exact checksums and materially reducesHeap.create/headerForPayloadsamples. - Pass focused VM/GC/no-GIL tests, full units once, and relevant TSan/threadfuzz gates.
- Refresh the full report, TSV, benchmark guide, and README after a retained change.