mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
Map.get of a reference value under a string key called scr_map_get_str_ref, which retained the hit through the collection's value adapter: an indirect tail call into an out-of-line retain function on every hit (in tsc-ts the symbol tables' Symbol and Type retains, 0.4% of samples, were only reached that way). Number keys already read the entry and retain with the value type's own retain. String keys now do the same: scr_map_entry_str returns the entry, and the generated code loads the value slot and retains it inline. Both the ordinary and the stack-boxed (local) reads take the entry path. Corpus 4651 keeps string-keyed results alive past delete, overwrite, clear and the map itself for instances, records, arrays, nested maps, cycles and union values; dropping the inline retain makes it (and 523) fail under ASan.