summaryrefslogtreecommitdiff
path: root/compiler/GHC/JS/Make.hs
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2022-11-29 09:29:16 +0000
committerJosh Meredith <joshmeredith2008@gmail.com>2023-02-16 03:28:33 +0000
commitfada5fe431031eb76c0eaf8059e67cc2885ea840 (patch)
tree06b344aa06c219cb4ad4a7e62c1e6dda1d8ee901 /compiler/GHC/JS/Make.hs
parent9ca51f9e84abc41ba590203d8bc8df8d6af86db2 (diff)
downloadhaskell-wip/js-rts-fixmes.tar.gz
Factor JS Rts generation for h$c{_,0,1,2} into h$c{n} and improve name cachingwip/js-rts-fixmes
Diffstat (limited to 'compiler/GHC/JS/Make.hs')
-rw-r--r--compiler/GHC/JS/Make.hs44
1 files changed, 0 insertions, 44 deletions
diff --git a/compiler/GHC/JS/Make.hs b/compiler/GHC/JS/Make.hs
index 6dee4cec93..f57643094c 100644
--- a/compiler/GHC/JS/Make.hs
+++ b/compiler/GHC/JS/Make.hs
@@ -126,10 +126,6 @@ module GHC.JS.Make
math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround
-- * Statement helpers
, decl
- -- * Miscellaneous
- -- $misc
- , allocData, allocClsA
- , dataFieldName, dataFieldNames
)
where
@@ -139,13 +135,10 @@ import GHC.JS.Syntax
import Control.Arrow ((***))
-import Data.Array
import qualified Data.Map as M
-import GHC.Utils.Outputable (Outputable (..))
import GHC.Data.FastString
import GHC.Utils.Monad.State.Strict
-import GHC.Utils.Panic
import GHC.Utils.Misc
import GHC.Types.Unique.Map
@@ -632,43 +625,6 @@ instance Fractional JExpr where
--------------------------------------------------------------------------------
--- Miscellaneous
---------------------------------------------------------------------------------
--- $misc
--- Everything else,
-
--- | Cache "dXXX" field names
-dataFieldCache :: Array Int FastString
-dataFieldCache = listArray (0,nFieldCache) (map (mkFastString . ('d':) . show) [(0::Int)..nFieldCache])
-
-nFieldCache :: Int
-nFieldCache = 16384
-
-dataFieldName :: Int -> FastString
-dataFieldName i
- | i < 1 || i > nFieldCache = panic "dataFieldName" (ppr i)
- | otherwise = dataFieldCache ! i
-
-dataFieldNames :: [FastString]
-dataFieldNames = fmap dataFieldName [1..nFieldCache]
-
-
--- | Cache "h$dXXX" names
-dataCache :: Array Int FastString
-dataCache = listArray (0,1024) (map (mkFastString . ("h$d"++) . show) [(0::Int)..1024])
-
-allocData :: Int -> JExpr
-allocData i = toJExpr (TxtI (dataCache ! i))
-
--- | Cache "h$cXXX" names
-clsCache :: Array Int FastString
-clsCache = listArray (0,1024) (map (mkFastString . ("h$c"++) . show) [(0::Int)..1024])
-
-allocClsA :: Int -> JExpr
-allocClsA i = toJExpr (TxtI (clsCache ! i))
-
-
---------------------------------------------------------------------------------
-- New Identifiers
--------------------------------------------------------------------------------