X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FSMRep.lhs;h=b0b1b140f7802445d0f1b6f81e9c946cb00147e3;hb=bba98641e10c71ec9aeb20d508b8905e4a64a143;hp=92b9513d565793d1805f52e540f04ad987235e27;hpb=423d477bfecd490de1449c59325c8776f91d7aac;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/SMRep.lhs b/ghc/compiler/codeGen/SMRep.lhs index 92b9513..b0b1b14 100644 --- a/ghc/compiler/codeGen/SMRep.lhs +++ b/ghc/compiler/codeGen/SMRep.lhs @@ -28,7 +28,7 @@ module SMRep ( SMRep(..), ClosureType(..), isStaticRep, fixedHdrSize, arrWordsHdrSize, arrPtrsHdrSize, - profHdrSize, + profHdrSize, thunkHdrSize, tablesNextToCode, smRepClosureType, smRepClosureTypeInt, @@ -41,8 +41,9 @@ module SMRep ( 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 MachOp-- ( MachRep(..), MachHint(..), wordRep ) +import StaticFlags ( opt_SccProfilingOn, opt_GranMacros, + opt_Unregisterised, opt_SMP ) 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,12 +285,19 @@ 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 | 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