dillon1000/react

Commit

[Scheduler] Fix de-opt caused by out-of-bounds access (#21147)

Scheduler's heap implementation sometimes accesses indices that are out
of bounds (larger than the size of the array). This causes a VM de-opt.

This change fixes the de-opt by always checking the index before
accessing the array. In exchange, we can remove the typecheck on the
returned element.

Background: https://v8.dev/blog/elements-kinds#avoid-reading-beyond-the-length-of-the-array

Co-authored-by: Andrew Clark <[email protected]>
Browse files
Changed paths1 file
First-parent comparison
M packages/scheduler/src/SchedulerMinHeap.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…