SMRep(..), ClosureType(..),
isStaticRep,
fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize,
- profHdrSize,
+ profHdrSize, thunkHdrSize,
tablesNextToCode,
smRepClosureType, smRepClosureTypeInt,
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, opt_SMP )
import Constants
import Outputable
= 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
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 | opt_SMP = fixedHdrSize + smp_hdr
+ | otherwise = fixedHdrSize
+ where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
\end{code}
\begin{code}
-- IA64 mangler doesn't place tables next to code
tablesNextToCode :: Bool
-#ifdef ia64_TARGET_ARCH
+#if defined(ia64_TARGET_ARCH) || defined(powerpc64_TARGET_ARCH)
tablesNextToCode = False
#else
tablesNextToCode = not opt_Unregisterised