remove empty dir
[ghc-hetmet.git] / ghc / compiler / codeGen / SMRep.lhs
index 8bbf79d..c807703 100644 (file)
@@ -28,7 +28,7 @@ module SMRep (
        SMRep(..), ClosureType(..),
        isStaticRep,
        fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize,
-       profHdrSize,
+       profHdrSize, thunkHdrSize,
        tablesNextToCode,
        smRepClosureType, smRepClosureTypeInt,
 
@@ -42,7 +42,8 @@ import Id             ( Id, idType )
 import Type            ( Type, typePrimRep, PrimRep(..) )
 import TyCon           ( TyCon, tyConPrimRep )
 import MachOp--                ( MachRep(..), MachHint(..), wordRep )
-import CmdLineOpts     ( opt_SccProfilingOn, opt_GranMacros, opt_Unregisterised )
+import StaticFlags     ( opt_SccProfilingOn, opt_GranMacros,
+                         opt_Unregisterised )
 import Constants
 import Outputable
 
@@ -250,8 +251,8 @@ data SMRep
   = GenericRep         -- GC routines consult sizes in info tbl
        Bool            -- True <=> This is a static closure.  Affects how 
                        --          we garbage-collect it
-       !Int            -- # ptr words
-       !Int            -- # non-ptr words
+       !Int            --  # ptr words
+       !Int            --  # non-ptr words
        ClosureType     -- closure type
 
   | BlackHoleRep
@@ -284,6 +285,12 @@ arrWordsHdrSize   = fixedHdrSize*wORD_SIZE + sIZEOF_StgArrWords_NoHdr
 
 arrPtrsHdrSize    :: ByteOff
 arrPtrsHdrSize    = fixedHdrSize*wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr
+
+-- Thunks have an extra header word on SMP, so the update doesn't 
+-- splat the payload.
+thunkHdrSize :: WordOff
+thunkHdrSize = fixedHdrSize + smp_hdr
+       where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
 \end{code}
 
 \begin{code}