[commit: ghc] wip/T13861: WIP: cleverer tagging? (f23c042)
git at git.haskell.org
git at git.haskell.org
Fri Dec 22 00:03:21 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T13861
Link : http://ghc.haskell.org/trac/ghc/changeset/f23c0423f05d26e081b47f6382fe8f2a4610b022/ghc
>---------------------------------------------------------------
commit f23c0423f05d26e081b47f6382fe8f2a4610b022
Author: Gabor Greif <ggreif at gmail.com>
Date: Tue Oct 17 00:21:06 2017 +0200
WIP: cleverer tagging?
>---------------------------------------------------------------
f23c0423f05d26e081b47f6382fe8f2a4610b022
compiler/codeGen/StgCmmClosure.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index 1da1f70..6daedba 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -354,7 +354,8 @@ type DynTag = Int -- The tag on a *pointer*
-- * big, otherwise.
--
-- Small families can have the constructor tag in the tag bits.
--- Big families only use the tag value 1 to represent evaluatedness.
+-- Big families only use the tag value 1..mAX_PTR_TAG to represent
+-- evaluatedness, the last one lumping together all overflowing ones.
-- We don't have very many tag bits: for example, we have 2 bits on
-- x86-32 and 3 bits on x86-64.
@@ -364,10 +365,12 @@ isSmallFamily dflags fam_size = fam_size <= mAX_PTR_TAG dflags
tagForCon :: DynFlags -> DataCon -> DynTag
tagForCon dflags con
| isSmallFamily dflags fam_size = con_tag
- | otherwise = 1
+ | con_tag < max_tag = con_tag
+ | otherwise = max_tag
where
con_tag = dataConTag con -- NB: 1-indexed
fam_size = tyConFamilySize (dataConTyCon con)
+ max_tag = mAX_PTR_TAG dflags
tagForArity :: DynFlags -> RepArity -> DynTag
tagForArity dflags arity
More information about the ghc-commits
mailing list