%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CLabel.lhs,v 1.26 1999/05/11 16:44:04 keithw Exp $
+% $Id: CLabel.lhs,v 1.30 1999/12/02 17:57:13 simonmar Exp $
%
\section[CLabel]{@CLabel@: Information to make C Labels}
mkAsmTempLabel,
mkErrorStdEntryLabel,
- mkUpdEntryLabel,
+ mkUpdInfoLabel,
+ mkTopTickyCtrLabel,
+ mkBlackHoleInfoTableLabel,
mkCAFBlackHoleInfoTableLabel,
mkSECAFBlackHoleInfoTableLabel,
mkRtsPrimOpLabel,
mkCC_Label, mkCCS_Label,
- needsCDecl, isReadOnly, isAsmTemp, externallyVisibleCLabel,
+ needsCDecl, isAsmTemp, externallyVisibleCLabel,
CLabelType(..), labelType, labelDynamic,
| RtsBlackHoleInfoTbl FAST_STRING -- black hole with info table name
- | RtsUpdEntry
+ | RtsUpdInfo
| RtsSelectorInfoTbl Bool{-updatable-} Int{-offset-} -- Selector thunks
| RtsSelectorEntry Bool{-updatable-} Int{-offset-}
| RtsPrimOp PrimOp
+ | RtsTopTickyCtr
+
deriving (Eq, Ord)
-- Label Type: for generating C declarations.
-- Some fixed runtime system labels
mkErrorStdEntryLabel = RtsLabel RtsShouldNeverHappenCode
-mkUpdEntryLabel = RtsLabel RtsUpdEntry
+mkUpdInfoLabel = RtsLabel RtsUpdInfo
+mkTopTickyCtrLabel = RtsLabel RtsTopTickyCtr
+mkBlackHoleInfoTableLabel = RtsLabel (RtsBlackHoleInfoTbl SLIT("BLACKHOLE_info"))
mkCAFBlackHoleInfoTableLabel = RtsLabel (RtsBlackHoleInfoTbl SLIT("CAF_BLACKHOLE_info"))
mkSECAFBlackHoleInfoTableLabel = if opt_DoTickyProfiling then
RtsLabel (RtsBlackHoleInfoTbl SLIT("SE_CAF_BLACKHOLE_info"))
\begin{code}
needsCDecl :: CLabel -> Bool -- False <=> it's pre-declared; don't bother
-isReadOnly :: CLabel -> Bool -- lives in C "text space"
isAsmTemp :: CLabel -> Bool -- is a local temporary for native code generation
externallyVisibleCLabel :: CLabel -> Bool -- not C "static"
\end{code}
needsCDecl (CCS_Label _) = False
\end{code}
-Whether the labelled thing can be put in C "text space":
-
-\begin{code}
-isReadOnly (IdLabel _ InfoTbl) = True -- info-tables: yes
-isReadOnly (IdLabel _ other) = False -- others: pessimistically, no
-
-isReadOnly (DataConLabel _ _) = True -- and so on, for other
-isReadOnly (TyConLabel _) = True
-isReadOnly (CaseLabel _ _) = True
-isReadOnly (AsmTempLabel _) = True
-isReadOnly (RtsLabel _) = True
-isReadOnly (CC_Label _) = True
-isReadOnly (CCS_Label _) = True
-\end{code}
-
Whether the label is an assembler temporary:
\begin{code}
labelType (RtsLabel (RtsBlackHoleInfoTbl _)) = InfoTblType
labelType (RtsLabel (RtsSelectorInfoTbl _ _)) = InfoTblType
labelType (RtsLabel (RtsApInfoTbl _ _)) = InfoTblType
+labelType (RtsLabel RtsUpdInfo) = InfoTblType
labelType (CaseLabel _ CaseReturnInfo) = InfoTblType
labelType (CaseLabel _ CaseReturnPt) = CodeType
labelType (CaseLabel _ CaseVecTbl) = VecTblType
static_info Static Constructor info table
sel_info Selector info table
sel_entry Selector entry code
+ cc Cost centre
+ ccs Cost centre stack
\begin{code}
-- specialised for PprAsm: saves lots of arg passing in NCG
pprCLbl (RtsLabel RtsShouldNeverHappenCode) = ptext SLIT("stg_error_entry")
-pprCLbl (RtsLabel RtsUpdEntry) = ptext SLIT("Upd_frame_entry")
+pprCLbl (RtsLabel RtsUpdInfo) = ptext SLIT("Upd_frame_info")
+
+pprCLbl (RtsLabel RtsTopTickyCtr) = ptext SLIT("top_ct")
pprCLbl (RtsLabel (RtsBlackHoleInfoTbl info)) = ptext info