mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
indexOf and includes on arrays of class instances, records, arrays, maps, sets, typed arrays and strings call an internal helper that LLVM inlines. When the array's hole-free prefix covers its whole length, the helper scans the dense slots itself: references compare as 64-bit slots, four per branch, and strings compare by pointer, then length, then bytes, with strings of up to 16 bytes compared as two words and longer ones through scr_str_eq. Arrays with holes or sparse entries, and every other element type, keep the runtime search.