fix(runtime): refresh rooted arrays during iteration - #8670
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
ChangesRooted array access
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Merge Risk: ⚪ Minimal · up to This localized runtime change refreshes array roots during find/findIndex iteration and prevents stale values after callback-driven shrinkage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…re safepoints (#8680) Lands four reviewed PRs as one squash. - #8670: refresh rooted arrays during iteration. - #8673: fix a `--report-size` false positive from std-internal crate names. - #8668: specialize dense Array-subclass indexing. - #8678 (#8583): count property/index STORES as GC safepoint sites in the spill estimate. `PropertySet`/`PropertyUpdate`/`IndexSet` lower to collecting runtime calls that rewrite-statepoints-for-gc gives a statepoint, but none were counted, so a closed-shape object literal's constructor -- one long run of `this.field = v` -- estimated ~0, was never spilled to the shadow frame, and RS4GC grew one `__AnonShape_*_constructor` from 34,009 to 2,280,128 instructions, overrunning the #8586 per-function budget and refusing the whole module. Reads are deliberately not counted: they frequently inline to a shape-cached load with no call, so counting them would over-spill read-heavy hot loops. Version bump stripped per maintainer policy; the Cargo.lock diff was verified version-only before stripping. Co-authored-by: Ralph Küpper <ralph@skelpo.com>
|
Landed on Validated on the merged 4-PR result rather than per-branch: 9 ratchet gates + Version bump stripped per maintainer policy (the |
Summary
Fixes the Array.prototype.find and findIndex mutation-during-iteration failures from the #5898 Test262 worklist. Callback-driven array relocation now refreshes the rooted receiver, and reads beyond a callback-shrunk logical length return absent/undefined instead of stale tail storage.
Changes
Related issue
Refs #5898 — completes the find/findIndex array-altered-during-loop subcluster.
Test plan
Screenshots / output
Before: 34/36 pass in the selected Test262 directories; both array-altered-during-loop cases failed with stale Bike instead of undefined.
After: 36/36 pass.
Checklist
Summary by CodeRabbit