summaryrefslogtreecommitdiff
path: root/compiler/GHC/ByteCode
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-07-07 18:48:31 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-25 00:45:08 -0400
commit9dfeca6c2019fdb46613a68ccd6e650e40c7baac (patch)
tree29a2cda3faddedc7024be259011f4406b6473f45 /compiler/GHC/ByteCode
parent6333d7391068d8029eed3e8eff019b9e2c104c7b (diff)
downloadhaskell-9dfeca6c2019fdb46613a68ccd6e650e40c7baac.tar.gz
Remove platform constant wrappers
Platform constant wrappers took a DynFlags parameter, hence implicitly used the target platform constants. We removed them to allow support for several platforms at once (#14335) and to avoid having to pass the full DynFlags to every function (#17957). Metric Decrease: T4801
Diffstat (limited to 'compiler/GHC/ByteCode')
-rw-r--r--compiler/GHC/ByteCode/InfoTable.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/GHC/ByteCode/InfoTable.hs b/compiler/GHC/ByteCode/InfoTable.hs
index 84f4ed3ef0..02b2e236b9 100644
--- a/compiler/GHC/ByteCode/InfoTable.hs
+++ b/compiler/GHC/ByteCode/InfoTable.hs
@@ -12,6 +12,8 @@ module GHC.ByteCode.InfoTable ( mkITbls ) where
import GHC.Prelude
import GHC.Platform
+import GHC.Platform.Profile
+
import GHC.ByteCode.Types
import GHC.Runtime.Interpreter
import GHC.Driver.Session
@@ -54,7 +56,7 @@ make_constr_itbls :: HscEnv -> [DataCon] -> IO ItblEnv
make_constr_itbls hsc_env cons =
mkItblEnv <$> mapM (uncurry mk_itbl) (zip cons [0..])
where
- dflags = hsc_dflags hsc_env
+ profile = targetProfile (hsc_dflags hsc_env)
mk_itbl :: DataCon -> Int -> IO (Name,ItblPtr)
mk_itbl dcon conNo = do
@@ -63,19 +65,20 @@ make_constr_itbls hsc_env cons =
, prim_rep <- typePrimRep (scaledThing arg) ]
(tot_wds, ptr_wds) =
- mkVirtConstrSizes dflags rep_args
+ mkVirtConstrSizes profile rep_args
ptrs' = ptr_wds
nptrs' = tot_wds - ptr_wds
nptrs_really
- | ptrs' + nptrs' >= mIN_PAYLOAD_SIZE dflags = nptrs'
- | otherwise = mIN_PAYLOAD_SIZE dflags - ptrs'
+ | ptrs' + nptrs' >= pc_MIN_PAYLOAD_SIZE constants = nptrs'
+ | otherwise = pc_MIN_PAYLOAD_SIZE constants - ptrs'
descr = dataConIdentity dcon
- platform = targetPlatform dflags
+ platform = profilePlatform profile
+ constants = platformConstants platform
tables_next_to_code = platformTablesNextToCode platform
r <- iservCmd hsc_env (MkConInfoTable tables_next_to_code ptrs' nptrs_really
- conNo (tagForCon dflags dcon) descr)
+ conNo (tagForCon platform dcon) descr)
return (getName dcon, ItblPtr r)