[Git][ghc/ghc][wip/T22010] Revert non-critical changes in StgToJS
Jaro Reinders (@Noughtmare)
gitlab at gitlab.haskell.org
Fri Jun 2 08:50:09 UTC 2023
Jaro Reinders pushed to branch wip/T22010 at Glasgow Haskell Compiler / GHC
Commits:
c4634b0f by Jaro Reinders at 2023-06-02T10:50:04+02:00
Revert non-critical changes in StgToJS
- - - - -
2 changed files:
- compiler/GHC/StgToJS/Ids.hs
- compiler/GHC/StgToJS/Symbols.hs
Changes:
=====================================
compiler/GHC/StgToJS/Ids.hs
=====================================
@@ -61,18 +61,16 @@ import qualified Control.Monad.Trans.State.Strict as State
import qualified Data.Map as M
import Data.Maybe
import qualified Data.ByteString.Char8 as BSC
-import Data.Word
-- | Get fresh unique number
-freshUnique :: G Word64
+freshUnique :: G Int
freshUnique = do
id_gen <- State.gets gsId
liftIO $ do
-- no need for atomicFetchAdd as we don't use threads in G
v <- readFastMutInt id_gen
writeFastMutInt id_gen (v+1)
- -- TODO: depends on readFastMutWord64
- pure (undefined v)
+ pure v
-- | Get fresh local Ident of the form: h$$unit:module_uniq
freshIdent :: G Ident
=====================================
compiler/GHC/StgToJS/Symbols.hs
=====================================
@@ -74,12 +74,12 @@ mkJsSymbol :: Bool -> Module -> FastString -> FastString
mkJsSymbol exported mod s = mkFastStringByteString (mkJsSymbolBS exported mod s)
-- | Make JS symbol for given module and unique.
-mkFreshJsSymbol :: Module -> Word64 -> FastString
+mkFreshJsSymbol :: Module -> Int -> FastString
mkFreshJsSymbol mod i = mkFastStringByteString $ mconcat
[ hdd
, unitModuleStringZ mod
, BSC.pack "_"
- , word64BS i
+ , intBS i
]
-- | Make symbol "h$XYZ" or "h$$XYZ"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4634b0f4460096f74e0a84bfbd76b3045359366
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4634b0f4460096f74e0a84bfbd76b3045359366
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/20230602/513c3280/attachment-0001.html>
More information about the ghc-commits
mailing list