X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FSMRep.lhs;h=c807703b132a404273aaf450134c03cacbf9b51d;hb=28a464a75e14cece5db40f2765a29348273ff2d2;hp=8bbf79d1daa69b83683a49f0e854725bf18b2e0d;hpb=a1947dc78b38b2aced923e2f6d04031a0cb94009;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/SMRep.lhs b/ghc/compiler/codeGen/SMRep.lhs index 8bbf79d..c807703 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, @@ -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}