[Git][ghc/ghc][wip/nested-cpr-2019] Use variable length coding for ConTags

Sebastian Graf gitlab at gitlab.haskell.org
Tue May 5 09:39:11 UTC 2020



Sebastian Graf pushed to branch wip/nested-cpr-2019 at Glasgow Haskell Compiler / GHC


Commits:
75867eac by Sebastian Graf at 2020-05-05T11:39:01+02:00
Use variable length coding for ConTags

- - - - -


1 changed file:

- compiler/GHC/Types/Cpr.hs


Changes:

=====================================
compiler/GHC/Types/Cpr.hs
=====================================
@@ -592,9 +592,8 @@ instance Binary a => Binary (Levitated a) where
       _ -> pprPanic "Binary Levitated: Invalid tag" (int (fromIntegral h))
 
 instance Binary r => Binary (KnownShape r) where
-  -- Note that the ConTag is 1-indexed
-  put_ bh (Con t fs)   = do { put_ bh t; put_ bh fs}
-  get  bh = Con <$> get bh <*> get bh
+  put_ bh (Con t fs) = do { putULEB128 bh t; put_ bh fs }
+  get  bh = Con <$> getULEB128 bh <*> get bh
 
 instance Binary TerminationFlag where
   put_ bh Terminates   = put_ bh True



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/75867eac718bdc371d286c92c3a66797e0eef505

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/75867eac718bdc371d286c92c3a66797e0eef505
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200505/a23f614e/attachment.html>


More information about the ghc-commits mailing list