mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-08 16:12:23 +02:00
Arrays created via new Array(N) or by setting .length start as Holey since their elements are not present. After sequential fill (e.g. for (i=0; i<N; i++) a[i]=v), all holes are filled but the array remained Holey, preventing the Packed fast paths in the asm interpreter from triggering. Now, whenever indexed_put() writes to the last index of a Holey array, we scan for remaining holes and promote to Packed if none are found. Only checking on writes to the last index avoids O(N^2) scanning on partial fills while still catching the common sequential fill pattern.
78 KiB
78 KiB