ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

StgCmmClosure

Contents

- LambdaFormInfo
- Used by other modules
- ClosureInfo
  - Inspection
  - Labels
  - Predicates
- InfoTables

Synopsis

- type DynTag = Int
- tagForCon :: DynFlags -> DataCon -> DynTag
- isSmallFamily :: DynFlags -> Int -> Bool
- type ConTagZ = Int
- dataConTagZ :: DataCon -> ConTagZ
- idPrimRep :: Id -> PrimRep
- isVoidRep :: PrimRep -> Bool
- isGcPtrRep :: PrimRep -> Bool
- addIdReps :: [NonVoid Id] -> [NonVoid (PrimRep, Id)]
- addArgReps :: [NonVoid StgArg] -> [NonVoid (PrimRep, StgArg)]
- argPrimRep :: StgArg -> PrimRep
- newtype NonVoid a = NonVoid a
- fromNonVoid :: NonVoid a -> a
- nonVoidIds :: [Id] -> [NonVoid Id]
- nonVoidStgArgs :: [StgArg] -> [NonVoid StgArg]
- assertNonVoidIds :: [Id] -> [NonVoid Id]
- assertNonVoidStgArgs :: [StgArg] -> [NonVoid StgArg]
- data LambdaFormInfo
- data StandardFormInfo
- mkLFThunk :: Type -> TopLevelFlag -> [Id] -> UpdateFlag -> LambdaFormInfo
- mkLFReEntrant :: TopLevelFlag -> [Id] -> [Id] -> ArgDescr -> LambdaFormInfo
- mkConLFInfo :: DataCon -> LambdaFormInfo
- mkSelectorLFInfo :: Id -> Int -> Bool -> LambdaFormInfo
- mkApLFInfo :: Id -> UpdateFlag -> Arity -> LambdaFormInfo
- mkLFImported :: Id -> LambdaFormInfo
- mkLFArgument :: Id -> LambdaFormInfo
- mkLFLetNoEscape :: LambdaFormInfo
- mkLFStringLit :: LambdaFormInfo
- lfDynTag :: DynFlags -> LambdaFormInfo -> DynTag
- maybeIsLFCon :: LambdaFormInfo -> Maybe DataCon
- isLFThunk :: LambdaFormInfo -> Bool
- isLFReEntrant :: LambdaFormInfo -> Bool
- lfUpdatable :: LambdaFormInfo -> Bool
- data CgLoc
  - = CmmLoc CmmExpr
  - | LneLoc BlockId [LocalReg]
- type SelfLoopInfo = (Id, BlockId, [LocalReg])
- data CallMethod
  - = EnterIt
  - | JumpToIt BlockId [LocalReg]
  - | ReturnIt
  - | SlowCall
  - | DirectEntry CLabel RepArity
- nodeMustPointToIt :: DynFlags -> LambdaFormInfo -> Bool
- isKnownFun :: LambdaFormInfo -> Bool
- funTag :: DynFlags -> ClosureInfo -> DynTag
- tagForArity :: DynFlags -> RepArity -> DynTag
- getCallMethod :: DynFlags -> Name -> Id -> LambdaFormInfo -> RepArity -> RepArity -> CgLoc -> Maybe SelfLoopInfo -> CallMethod
- data ClosureInfo
- mkClosureInfo :: DynFlags -> Bool -> Id -> LambdaFormInfo -> Int -> Int -> String -> ClosureInfo
- mkCmmInfo :: ClosureInfo -> CmmInfoTable
- closureLFInfo :: ClosureInfo -> LambdaFormInfo
- closureName :: ClosureInfo -> Name
- closureInfoLabel :: ClosureInfo -> CLabel
- staticClosureLabel :: ClosureInfo -> CLabel
- closureSlowEntryLabel :: ClosureInfo -> CLabel
- closureLocalEntryLabel :: DynFlags -> ClosureInfo -> CLabel
- closureUpdReqd :: ClosureInfo -> Bool
- closureSingleEntry :: ClosureInfo -> Bool
- closureReEntrant :: ClosureInfo -> Bool
- closureFunInfo :: ClosureInfo -> Maybe (RepArity, ArgDescr)
- isToplevClosure :: ClosureInfo -> Bool
- blackHoleOnEntry :: ClosureInfo -> Bool
- isStaticClosure :: ClosureInfo -> Bool
- mkDataConInfoTable :: DynFlags -> DataCon -> Bool -> Int -> Int -> CmmInfoTable
- cafBlackHoleInfoTable :: CmmInfoTable
- indStaticInfoTable :: CmmInfoTable
- staticClosureNeedsLink :: Bool -> CmmInfoTable -> Bool

# Documentation

type DynTag = Int #

tagForCon :: DynFlags -> DataCon -> DynTag #

isSmallFamily :: DynFlags -> Int -> Bool #

type ConTagZ = Int #

A *zero-indexed* constructor tag

dataConTagZ :: DataCon -> ConTagZ #

idPrimRep :: Id -> PrimRep #

isVoidRep :: PrimRep -> Bool #

isGcPtrRep :: PrimRep -> Bool #

addIdReps :: [NonVoid Id] -> [NonVoid (PrimRep, Id)] #

addArgReps :: [NonVoid StgArg] -> [NonVoid (PrimRep, StgArg)] #

argPrimRep :: StgArg -> PrimRep #

newtype NonVoid a #

Constructors

NonVoid a |

Instances

Eq a => Eq (NonVoid a) # |
Methods (==) :: NonVoid a -> NonVoid a -> Bool # (/=) :: NonVoid a -> NonVoid a -> Bool #
Show a => Show (NonVoid a) # |
Methods showsPrec :: Int -> NonVoid a -> ShowS Source # show :: NonVoid a -> String Source # showList :: [NonVoid a] -> ShowS Source #
Outputable a => Outputable (NonVoid a) # |
Methods ppr :: NonVoid a -> SDoc # pprPrec :: Rational -> NonVoid a -> SDoc #

fromNonVoid :: NonVoid a -> a #

nonVoidIds :: [Id] -> [NonVoid Id] #

nonVoidStgArgs :: [StgArg] -> [NonVoid StgArg] #

assertNonVoidIds :: [Id] -> [NonVoid Id] #

Used in places where some invariant ensures that all these Ids are non-void; e.g. constructor field binders in case expressions. See Note [Post-unarisation invariants] in UnariseStg.

assertNonVoidStgArgs :: [StgArg] -> [NonVoid StgArg] #

Used in places where some invariant ensures that all these arguments are non-void; e.g. constructor arguments. See Note [Post-unarisation invariants] in UnariseStg.

# LambdaFormInfo

data LambdaFormInfo #

data StandardFormInfo #

mkLFThunk :: Type -> TopLevelFlag -> [Id] -> UpdateFlag -> LambdaFormInfo #

mkLFReEntrant :: TopLevelFlag -> [Id] -> [Id] -> ArgDescr -> LambdaFormInfo #

mkConLFInfo :: DataCon -> LambdaFormInfo #

mkSelectorLFInfo :: Id -> Int -> Bool -> LambdaFormInfo #

mkApLFInfo :: Id -> UpdateFlag -> Arity -> LambdaFormInfo #

mkLFImported :: Id -> LambdaFormInfo #

mkLFArgument :: Id -> LambdaFormInfo #

mkLFLetNoEscape :: LambdaFormInfo #

mkLFStringLit :: LambdaFormInfo #

lfDynTag :: DynFlags -> LambdaFormInfo -> DynTag #

maybeIsLFCon :: LambdaFormInfo -> Maybe DataCon #

isLFThunk :: LambdaFormInfo -> Bool #

isLFReEntrant :: LambdaFormInfo -> Bool #

lfUpdatable :: LambdaFormInfo -> Bool #

# Used by other modules

data CgLoc #

Constructors

CmmLoc CmmExpr |
LneLoc BlockId [LocalReg] |

Instances

Outputable CgLoc # |
Methods ppr :: CgLoc -> SDoc # pprPrec :: Rational -> CgLoc -> SDoc #

type SelfLoopInfo = (Id, BlockId, [LocalReg]) #

data CallMethod #

Constructors

EnterIt |
JumpToIt BlockId [LocalReg] |
ReturnIt |
SlowCall |
DirectEntry CLabel RepArity |

nodeMustPointToIt :: DynFlags -> LambdaFormInfo -> Bool #

isKnownFun :: LambdaFormInfo -> Bool #

funTag :: DynFlags -> ClosureInfo -> DynTag #

tagForArity :: DynFlags -> RepArity -> DynTag #

getCallMethod :: DynFlags -> Name -> Id -> LambdaFormInfo -> RepArity -> RepArity -> CgLoc -> Maybe SelfLoopInfo -> CallMethod #

# ClosureInfo

data ClosureInfo #

mkClosureInfo :: DynFlags -> Bool -> Id -> LambdaFormInfo -> Int -> Int -> String -> ClosureInfo #

mkCmmInfo :: ClosureInfo -> CmmInfoTable #

Convert from `ClosureInfo` to `CmmInfoTable`.

## Inspection

closureLFInfo :: ClosureInfo -> LambdaFormInfo #

closureName :: ClosureInfo -> Name #

## Labels

closureInfoLabel :: ClosureInfo -> CLabel #

staticClosureLabel :: ClosureInfo -> CLabel #

closureSlowEntryLabel :: ClosureInfo -> CLabel #

closureLocalEntryLabel :: DynFlags -> ClosureInfo -> CLabel #

## Predicates

closureUpdReqd :: ClosureInfo -> Bool #

closureSingleEntry :: ClosureInfo -> Bool #

closureReEntrant :: ClosureInfo -> Bool #

closureFunInfo :: ClosureInfo -> Maybe (RepArity, ArgDescr) #

isToplevClosure :: ClosureInfo -> Bool #

blackHoleOnEntry :: ClosureInfo -> Bool #

isStaticClosure :: ClosureInfo -> Bool #

# InfoTables

mkDataConInfoTable :: DynFlags -> DataCon -> Bool -> Int -> Int -> CmmInfoTable #

cafBlackHoleInfoTable :: CmmInfoTable #

indStaticInfoTable :: CmmInfoTable #

staticClosureNeedsLink :: Bool -> CmmInfoTable -> Bool #