diff options
| author | doyougnu <jeffrey.young@iohk.io> | 2023-03-30 11:07:38 -0400 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-01 18:27:56 -0400 |
| commit | 6e2eb275a1b6d3d1dae9c2864f001bea69d20c2a (patch) | |
| tree | 4c0dff8196b15643087329e043b5e51580e717aa /compiler/GHC/StgToJS/Linker | |
| parent | a84fba6eb5cae43bd79cc1b26eadd7a2aa36099b (diff) | |
| download | haskell-6e2eb275a1b6d3d1dae9c2864f001bea69d20c2a.tar.gz | |
JS: Linker: use saturated JExpr
Follow on to MR!10142 in pursuit of #22736
Diffstat (limited to 'compiler/GHC/StgToJS/Linker')
| -rw-r--r-- | compiler/GHC/StgToJS/Linker/Linker.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/GHC/StgToJS/Linker/Linker.hs b/compiler/GHC/StgToJS/Linker/Linker.hs index 07a501cc2b..ea8cb79d95 100644 --- a/compiler/GHC/StgToJS/Linker/Linker.hs +++ b/compiler/GHC/StgToJS/Linker/Linker.hs @@ -31,6 +31,7 @@ import GHC.Platform.Host (hostPlatformArchOS) import GHC.JS.Make import GHC.JS.Unsat.Syntax +import qualified GHC.JS.Syntax as Sat import GHC.JS.Transform import GHC.Driver.Session (DynFlags(..)) @@ -280,7 +281,7 @@ computeLinkDependencies cfg logger target unit_env units objFiles extraStaticDep -- | Compiled module data ModuleCode = ModuleCode { mc_module :: !Module - , mc_js_code :: !JStat + , mc_js_code :: !Sat.JStat , mc_exports :: !B.ByteString -- ^ rendered exports , mc_closures :: ![ClosureInfo] , mc_statics :: ![StaticInfo] @@ -293,7 +294,7 @@ data ModuleCode = ModuleCode -- up into global "metadata" for the whole link. data CompactedModuleCode = CompactedModuleCode { cmc_module :: !Module - , cmc_js_code :: !JStat + , cmc_js_code :: !Sat.JStat , cmc_exports :: !B.ByteString -- ^ rendered exports } @@ -326,7 +327,7 @@ renderLinker h mods jsFiles = do -- modules themselves mod_sizes <- forM compacted_mods $ \m -> do - !mod_size <- fromIntegral <$> putJS (satJStat $! cmc_js_code m) + !mod_size <- fromIntegral <$> putJS (cmc_js_code m) let !mod_mod = cmc_module m pure (mod_mod, mod_size) @@ -565,7 +566,7 @@ extractDeps ar_state units deps loc = mod = depsModule deps newline = BC.pack "\n" mk_exports = mconcat . intersperse newline . filter (not . BS.null) . map oiRaw - mk_js_code = mconcat . map (unsatJStat . oiStat) + mk_js_code = mconcat . map oiStat collectCode l = ModuleCode { mc_module = mod , mc_js_code = mk_js_code l |
