(This is the module that knows all about stack layouts, etc.)
\begin{code}
-{-# OPTIONS_GHC -w #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and fix
--- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
--- for details
-
module CgStackery (
spRel, getVirtSp, getRealSp, setRealSp,
setRealAndVirtualSp, getSpRelOffset,
import CLabel
import Constants
import Util
-import FastString
import OrdList
import Outputable
+
+import Control.Monad
\end{code}
%************************************************************************
= loop init_Sp_offset [] (reverse things)
where
loop offset offs [] = (offset,offs)
- loop offset offs ((VoidArg,t):things) = loop offset offs things
+ loop offset offs ((VoidArg,_):things) = loop offset offs things
-- ignore Void arguments
loop offset offs ((rep,t):things)
= loop thing_slot ((t,thing_slot):offs) things
\begin{code}
pushUpdateFrame :: CmmExpr -> Code -> Code
-
pushUpdateFrame updatee code
= do {
-#ifdef DEBUG
- EndOfBlockInfo _ sequel <- getEndOfBlockInfo ;
- ASSERT(case sequel of { OnStack -> True; _ -> False})
-#endif
-
- allocStackTop (fixedHdrSize +
+ when debugIsOn $ do
+ { EndOfBlockInfo _ sequel <- getEndOfBlockInfo ;
+ ; MASSERT(case sequel of { OnStack -> True; _ -> False}) }
+ ; allocStackTop (fixedHdrSize +
sIZEOF_StgUpdateFrame_NoHdr `quot` wORD_SIZE)
; vsp <- getVirtSp
; setStackFrame vsp
off_updatee :: ByteOff
off_updatee = fixedHdrSize*wORD_SIZE + oFFSET_StgUpdateFrame_updatee
-\end{code}
+\end{code}
%************************************************************************