mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
A typed array such as a number[] reaches untyped code as a capsule of the native array. A keyed read `xs[i]` there missed the inline cache, which answers only dyn arrays, and went to the member helper, which converted the index to a string; the capsule's key lookup then parsed the string back into a number for every element. Keyed sites now read an element of a native number[] capsule in place when the index is an integer below the array's hole-free prefix, and `length` sites read the native array's length. Other capsule elements (holes, out-of-range and fractional indices, arrays of other element types) are answered by the keyed probe through scr_dyn_index_get without forming the key, or by the helper as before.