mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
Number-key reads called scr_map_get_f64_ref and friends, which hashed the key and retained reference values through the map's val_retain function pointer. They now go through sc_map_entry_f64, a small internal IR helper LLVM inlines at each site: with the runtime's direct index present, an integral in-range key reads its slot and any other key is absent, with no call; maps without the index defer to scr_map_entry_f64. The generated code reads the entry's value slot itself and retains reference values with the value type's own (inlinable) retain, the adapter the collection was constructed with. Map.get with stack-boxed results, union and scalar values, and Map/Set.has all use it. The helper and its %ScrMapIx/%ScrMapEntry types follow the target's size type, so wasm32 builds verify as well.