mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
A local number[] that only compiled element operations reach, and whose every stored element the int32 slot analysis proves an int32 (never -0), is now stored as SCR_ELEM_I32: 4-byte int32 slots, with state bytes once it holds a hole or undefined, as for every array. Element reads give consumers an exact int32, so indexing with an element skips the double round trip, and the slots take half the memory. The runtime's dense slot accessors convert between the int32 slot and the double, so its double-valued entry points serve int32 arrays unchanged; growth, copies, fill and length changes use the 4-byte width. ir/int32-arrays.ts proposes the candidates and inlines their element-reader helper calls; the int32 slot analysis keeps the proven ones, and selectInt32Arrays rewrites the module for exactly those, so a program without an int32 array emits the same LLVM IR as before.