Commit 4279ab50 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Use sIZEOF_* from platformConstants rather than Constants

parent 07c37771
......@@ -235,17 +235,17 @@ minClosureSize dflags = fixedHdrSize dflags + mIN_PAYLOAD_SIZE
arrWordsHdrSize :: DynFlags -> ByteOff
arrWordsHdrSize dflags
= fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgArrWords_NoHdr
= fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgArrWords_NoHdr dflags
arrPtrsHdrSize :: DynFlags -> ByteOff
arrPtrsHdrSize dflags
= fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr
= fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr dflags
-- Thunks have an extra header word on SMP, so the update doesn't
-- splat the payload.
thunkHdrSize :: DynFlags -> WordOff
thunkHdrSize dflags = fixedHdrSize dflags + smp_hdr
where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
where smp_hdr = sIZEOF_StgSMPThunkHeader dflags `quot` wORD_SIZE
nonHdrSize :: SMRep -> WordOff
......
......@@ -347,7 +347,7 @@ funInfoTable :: DynFlags -> CmmExpr -> CmmExpr
-- in the info table.
funInfoTable dflags info_ptr
| tablesNextToCode dflags
= cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev)
= cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev dflags)
| otherwise
= cmmOffsetW dflags info_ptr (1 + stdInfoTableSizeW dflags)
-- Past the entry code pointer
......
......@@ -1025,7 +1025,7 @@ emitCloneArray :: CLabel -> CmmFormal -> CmmExpr -> CmmExpr -> CmmExpr
emitCloneArray info_p res_r src0 src_off0 n0 live = do
dflags <- getDynFlags
let arrPtrsHdrSizeW dflags = CmmLit $ mkIntCLit dflags $ fixedHdrSize dflags +
(sIZEOF_StgMutArrPtrs_NoHdr `div` wORD_SIZE)
(sIZEOF_StgMutArrPtrs_NoHdr dflags `div` wORD_SIZE)
myCapability = cmmSubWord dflags (CmmReg baseReg)
(CmmLit (mkIntCLit dflags oFFSET_Capability_r))
-- Assign the arguments to temporaries so the code generator can
......
......@@ -289,7 +289,7 @@ pushSpecUpdateFrame lbl updatee code
; MASSERT(case sequel of { OnStack -> True; _ -> False}) }
; dflags <- getDynFlags
; allocStackTop (fixedHdrSize dflags +
sIZEOF_StgUpdateFrame_NoHdr `quot` wORD_SIZE)
sIZEOF_StgUpdateFrame_NoHdr dflags `quot` wORD_SIZE)
; vsp <- getVirtSp
; setStackFrame vsp
; frame_addr <- getSpRelOffset vsp
......
......@@ -635,7 +635,7 @@ pushUpdateFrame lbl updatee body
dflags <- getDynFlags
let
hdr = fixedHdrSize dflags * wORD_SIZE
frame = updfr + hdr + sIZEOF_StgUpdateFrame_NoHdr
frame = updfr + hdr + sIZEOF_StgUpdateFrame_NoHdr dflags
off_updatee = hdr + oFFSET_StgUpdateFrame_updatee
--
emitStore (CmmStackSlot Old frame) (mkLblExpr lbl)
......
......@@ -659,7 +659,7 @@ funInfoTable :: DynFlags -> CmmExpr -> CmmExpr
-- in the info table.
funInfoTable dflags info_ptr
| tablesNextToCode dflags
= cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev)
= cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev dflags)
| otherwise
= cmmOffsetW dflags info_ptr (1 + stdInfoTableSizeW dflags)
-- Past the entry code pointer
......
......@@ -1101,7 +1101,7 @@ emitCloneArray :: CLabel -> CmmFormal -> CmmExpr -> CmmExpr -> CmmExpr
emitCloneArray info_p res_r src0 src_off0 n0 = do
dflags <- getDynFlags
let arrPtrsHdrSizeW dflags = mkIntExpr dflags (fixedHdrSize dflags +
(sIZEOF_StgMutArrPtrs_NoHdr `div` wORD_SIZE))
(sIZEOF_StgMutArrPtrs_NoHdr dflags `div` wORD_SIZE))
myCapability = cmmSubWord dflags (CmmReg baseReg) (mkIntExpr dflags oFFSET_Capability_r)
-- Passed as arguments (be careful)
src <- assignTempE src0
......
......@@ -147,8 +147,6 @@ enum Mode { Gen_Haskell, Gen_Haskell_Type, Gen_Haskell_Value, Gen_Haskell_Wrappe
#define def_size(str, size) \
switch (mode) { \
case Gen_Haskell: \
printf("sIZEOF_" str " :: Int\n"); \
printf("sIZEOF_" str " = %" FMT_SizeT "\n", (size_t)size); \
break; \
case Gen_Haskell_Type: \
printf(" , pc_SIZEOF_" str " :: Int\n"); \
......@@ -157,11 +155,11 @@ enum Mode { Gen_Haskell, Gen_Haskell_Type, Gen_Haskell_Value, Gen_Haskell_Wrappe
printf(" , pc_SIZEOF_" str " = %" FMT_SizeT "\n", (size_t)size); \
break; \
case Gen_Haskell_Wrappers: \
printf("-- sIZEOF_" str " :: DynFlags -> Int\n"); \
printf("-- sIZEOF_" str " dflags = pc_SIZEOF_" str " (sPlatformConstants (settings dflags))\n"); \
printf("sIZEOF_" str " :: DynFlags -> Int\n"); \
printf("sIZEOF_" str " dflags = pc_SIZEOF_" str " (sPlatformConstants (settings dflags))\n"); \
break; \
case Gen_Haskell_Exports: \
printf("-- sIZEOF_" str ",\n"); \
printf(" sIZEOF_" str ",\n"); \
break; \
case Gen_Header: \
printf("#define SIZEOF_" str " %" FMT_SizeT "\n", (size_t)size); \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment