summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToJS/CodeGen.hs
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2023-04-26 16:30:46 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-11 23:08:27 -0400
commit0ed493a3d8f13a80d98026a5ccfacd8cfe4ac182 (patch)
treebdfa4717ab05108bb7e2a381da2228c403b84935 /compiler/GHC/StgToJS/CodeGen.hs
parent1bb24432ff77e11a0340a7d8586e151e15bba2a1 (diff)
downloadhaskell-0ed493a3d8f13a80d98026a5ccfacd8cfe4ac182.tar.gz
JS: refactor jsSaturate to return a saturated JStat (#23328)
Diffstat (limited to 'compiler/GHC/StgToJS/CodeGen.hs')
-rw-r--r--compiler/GHC/StgToJS/CodeGen.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/GHC/StgToJS/CodeGen.hs b/compiler/GHC/StgToJS/CodeGen.hs
index 6110135afb..4d557526bd 100644
--- a/compiler/GHC/StgToJS/CodeGen.hs
+++ b/compiler/GHC/StgToJS/CodeGen.hs
@@ -134,10 +134,9 @@ genUnits m ss spt_entries foreign_stubs = do
glbl <- State.gets gsGlobal
staticInit <-
initStaticPtrs spt_entries
- let stat = ( jsOptimize
- . satJStat
- . jsSaturate (Just $ modulePrefix m 1)
- $ mconcat (reverse glbl) <> staticInit)
+ let stat = ( jsOptimize .
+ satJStat (Just $ modulePrefix m 1)
+ $ mconcat (reverse glbl) <> staticInit)
let syms = [moduleGlobalSymbol m]
let oi = ObjUnit
{ oiSymbols = syms
@@ -210,8 +209,7 @@ genUnits m ss spt_entries foreign_stubs = do
si <- State.gets (ggsStatic . gsGroup)
let body = mempty -- mconcat (reverse extraTl) <> b1 ||= e1 <> b2 ||= e2
let stat = jsOptimize
- . satJStat
- $ jsSaturate (Just $ modulePrefix m n) body
+ $ satJStat (Just $ modulePrefix m n) body
let ids = [bnd]
syms <- (\(TxtI i) -> [i]) <$> identForId bnd
let oi = ObjUnit
@@ -249,8 +247,7 @@ genUnits m ss spt_entries foreign_stubs = do
topDeps = collectTopIds decl
required = hasExport decl
stat = jsOptimize
- . satJStat
- . jsSaturate (Just $ modulePrefix m n)
+ . satJStat (Just $ modulePrefix m n)
$ mconcat (reverse extraTl) <> tl
syms <- mapM (fmap (\(TxtI i) -> i) . identForId) topDeps
let oi = ObjUnit
@@ -339,7 +336,7 @@ genToplevelRhs i rhs = case rhs of
eid@(TxtI eidt) <- identForEntryId i
(TxtI idt) <- identForId i
body <- genBody (initExprCtx i) R2 args body typ
- global_occs <- globalOccs (jsSaturate (Just "ghcjs_tmp_sat_") body)
+ global_occs <- globalOccs (satJStat (Just "ghcjs_tmp_sat_") body)
let lidents = map global_ident global_occs
let lids = map global_id global_occs
let lidents' = map identFS lidents