Zubin pushed to branch wip/inline-fs at Glasgow Haskell Compiler / GHC Commits: 5fb45025 by Zubin Duggal at 2025-11-05T12:58:44+05:30 wip - - - - - 1 changed file: - compiler/GHC/Data/FastString.hs Changes: ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -214,6 +214,11 @@ data FastStringPayload = FastString { data FastString = FastStringId {-# UNPACK #-} !Word64 +-- first 5 bits set: inlined faststring +-- next 3 bits: length +-- next 7 bytes: unpacked BS +-- + fs_sbs :: FastString -> ShortByteString fs_sbs (FastStringId w) | w .&. 0xf8000000_00000000 == 0xf8000000_00000000 @@ -230,7 +235,8 @@ fs_sbs (FastStringId w) 5 -> SBS.pack [ w8_64 (w `uncheckedShiftRL64#` 32#), w8_64 (w `uncheckedShiftRL64#` 24#), w8_64 (w `uncheckedShiftRL64#` 16#), w8_64 (w `uncheckedShiftRL64#` 8#), w8_64 w)] 6 -> SBS.pack [ w8_64 (w `uncheckedShiftRL64#` 40#), w8_64 (w `uncheckedShiftRL64#` 32#), w8_64 (w `uncheckedShiftRL64#` 24#), w8_64 (w `uncheckedShiftRL64#` 16#), w8_64 (w `uncheckedShiftRL64#` 8#), w8_64 w)] 7 -> SBS.pack [ w8_64 (w `uncheckedShiftRL64#` 48#), w8_64 (w `uncheckedShiftRL64#` 40#), w8_64 (w `uncheckedShiftRL64#` 32#), w8_64 (w `uncheckedShiftRL64#` 24#), w8_64 (w `uncheckedShiftRL64#` 16#), w8_64 (w `uncheckedShiftRL64#` 8#), w8_64 w)] - | otherwise + | otherwise = + n_chars :: FastString -> Int uniq :: FastString -> Int View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fb45025d1233d90db0b6102e4434fb4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fb45025d1233d90db0b6102e4434fb4... You're receiving this email because of your account on gitlab.haskell.org.