- StandardFormInfo,
-
- EntryConvention(..),
-
- mkClosureLFInfo, mkConLFInfo,
- mkLFImported, mkLFArgument, mkLFLetNoEscape,
-
- closureSize, closureHdrSize,
- closureNonHdrSize, closureSizeWithoutFixedHdr,
- closureGoodStuffSize, closurePtrsSize, -- UNUSED: closureNonPtrsSize,
- slopSize, fitsMinUpdSize,
-
- layOutDynClosure, layOutDynCon, layOutStaticClosure,
- layOutStaticNoFVClosure, layOutPhantomClosure,
- mkVirtHeapOffsets, -- for GHCI
-
- nodeMustPointToIt, getEntryConvention,
- blackHoleOnEntry,
-
- staticClosureRequired,
- slowFunEntryCodeRequired, funInfoTableRequired,
- stdVapRequired, noUpdVapRequired,
-
- closureId, infoTableLabelFromCI,
- closureLabelFromCI,
- entryLabelFromCI, fastLabelFromCI,
- closureLFInfo, closureSMRep, closureUpdReqd,
- closureSingleEntry, closureSemiTag, closureType,
- closureReturnsUnboxedType, getStandardFormThunkInfo,
-
---OLD auxInfoTableLabelFromCI, isIntLikeRep, -- go away in 0.23
-
- closureKind, closureTypeDescr, -- profiling
-
- isConstantRep, isSpecRep, isPhantomRep, -- ToDo: Should be in SMRep, perhaps?
- isStaticClosure, allocProfilingMsg,
- blackHoleClosureInfo,
- getSMInfoStr, getSMInitHdrStr, getSMUpdInplaceHdrStr,
- ltSMRepHdr, --UNUSED: equivSMRepHdr,
- maybeSelectorInfo,
-
- dataConLiveness, -- concurrency
-
- -- and to make the interface self-sufficient...
- AbstractC, CAddrMode, HeapOffset, MagicId,
- CgInfoDownwards, CgState, CgIdInfo, CompilationInfo,
- CLabel, Id, Maybe, PrimKind, FCode(..), TyCon, StgExpr,
- StgAtom, StgBinderInfo,
- DataCon(..), PlainStgExpr(..), PlainStgLiveVars(..),
- PlainStgAtom(..),
- UniqSet(..), UniqFM, UpdateFlag(..) -- not abstract
-
- IF_ATTACK_PRAGMAS(COMMA mkClosureLabel)
- IF_ATTACK_PRAGMAS(COMMA getUniDataSpecTyCon_maybe)
- ) where
-
-import AbsCSyn
-import CgMonad
-import SMRep
-import StgSyn
-
-import AbsUniType
-import CgCompInfo -- some magic constants
-import CgRetConv
-import CLabelInfo -- Lots of label-making things
-import CmdLineOpts ( GlobalSwitch(..) )
-import Id
-import IdInfo -- SIGH
-import Maybes ( maybeToBool, assocMaybe, Maybe(..) )
-import Outputable -- needed for INCLUDE_FRC_METHOD
-import Pretty -- ( ppStr, Pretty(..) )
-import PrimKind ( PrimKind, getKindSize, separateByPtrFollowness )
-import Util
-\end{code}
-
-The ``wrapper'' data type for closure information:
-
-\begin{code}
-data ClosureInfo
- = MkClosureInfo
- Id -- The thing bound to this closure
- LambdaFormInfo -- info derivable from the *source*
- SMRep -- representation used by storage manager
-\end{code}
-
-%************************************************************************
-%* *
-\subsection[ClosureInfo-OLD-DOC]{OLD DOCUMENTATION PROBABLY SUPERCEDED BY stg-details}
-%* *
-%************************************************************************
-
-We can optimise the function-entry code as follows.
-\begin{itemize}
-
-\item If the ``function'' is not updatable, we can jump directly to its
- entry code, rather than indirecting via the info pointer in the
- closure. (For updatable thunks we must go via the closure, in
- case it has been updated.)
-
-\item If the former bullet applies, and the application we are
- compiling gives the function as many arguments as it needs, we
- can jump to its fast-entry code. (This only applies if the
- function has one or more args, because zero-arg closures have
- no fast-entry code.)
-
-\item If the function is a top-level non-constructor or imported, there
- is no need to make Node point to its closure. In order for
- this to be right, we need to ensure that:
- \begin{itemize}
- \item If such closures are updatable then they push their
- static address in the update frame, not Node. Actually
- we create a black hole and push its address.
-
- \item The arg satisfaction check should load Node before jumping to
- UpdatePAP.
-
- \item Top-level constructor closures need careful handling. If we are to
- jump direct to the constructor code, we must load Node first, even
- though they are top-level. But if we go to their ``own''
- standard-entry code (which loads Node and then jumps to the
- constructor code) we don't need to load Node.
- \end{itemize}
-\end{itemize}
-
-
-{\em Top level constructors (@mkStaticConEntryInfo@)}
-
-\begin{verbatim}
- x = {y,ys} \ {} Cons {y,ys} -- Std form constructor
-\end{verbatim}
-
-x-closure: Cons-info-table, y-closure, ys-closure
-
-x-entry: Node = x-closure; jump( Cons-entry )
-
-x's EntryInfo in its own module:
-\begin{verbatim}
- Base-label = Cons -- Not x!!
- NodeMustPoint = True
- ClosureClass = Constructor
-\end{verbatim}
-
- So if x is entered, Node will be set up and
- we'll jump direct to the Cons code.