ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.StgToCmm.Layout

Synopsis

- mkArgDescr :: Platform -> [Id] -> ArgDescr
- emitCall :: (Convention, Convention) -> CmmExpr -> [CmmExpr] -> FCode ReturnKind
- emitReturn :: [CmmExpr] -> FCode ReturnKind
- adjustHpBackwards :: FCode ()
- emitClosureProcAndInfoTable :: Bool -> Id -> LambdaFormInfo -> CmmInfoTable -> [NonVoid Id] -> ((Int, LocalReg, [LocalReg]) -> FCode ()) -> FCode ()
- emitClosureAndInfoTable :: Platform -> CmmInfoTable -> Convention -> [LocalReg] -> FCode () -> FCode ()
- slowCall :: CmmExpr -> [StgArg] -> FCode ReturnKind
- directCall :: Convention -> CLabel -> RepArity -> [StgArg] -> FCode ReturnKind
- data FieldOffOrPadding a
  - = FieldOff (NonVoid a) ByteOff
  - | Padding ByteOff ByteOff
- data ClosureHeader
  - = NoHeader
  - | StdHeader
  - | ThunkHeader
- mkVirtHeapOffsets :: Profile -> ClosureHeader -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [(NonVoid a, ByteOff)])
- mkVirtHeapOffsetsWithPadding :: Profile -> ClosureHeader -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [FieldOffOrPadding a])
- mkVirtConstrOffsets :: Profile -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [(NonVoid a, ByteOff)])
- mkVirtConstrSizes :: Profile -> [NonVoid PrimRep] -> (WordOff, WordOff)
- getHpRelOffset :: VirtualHpOffset -> FCode CmmExpr
- data ArgRep
  - = P
  - | N
  - | L
  - | V
  - | F
  - | D
  - | V16
  - | V32
  - | V64
- toArgRep :: Platform -> PrimRep -> ArgRep
- argRepSizeW :: Platform -> ArgRep -> WordOff
- getArgAmode :: NonVoid StgArg -> FCode CmmExpr
- getNonVoidArgAmodes :: [StgArg] -> FCode [CmmExpr]

# Documentation

mkArgDescr :: Platform -> [Id] -> ArgDescr Source #

emitCall :: (Convention, Convention) -> CmmExpr -> [CmmExpr] -> FCode ReturnKind Source #

`emitCall conv fun args` makes a call to the entry-code of `fun`, using the call/return convention `conv`, passing `args`, and returning the results to the current sequel.

emitReturn :: [CmmExpr] -> FCode ReturnKind Source #

Return multiple values to the sequel

If the sequel is `Return`

        return (x,y)

If the sequel is `AssignTo [p,q]`

       p=x; q=y;

adjustHpBackwards :: FCode () Source #

emitClosureProcAndInfoTable :: Bool -> Id -> LambdaFormInfo -> CmmInfoTable -> [NonVoid Id] -> ((Int, LocalReg, [LocalReg]) -> FCode ()) -> FCode () Source #

emitClosureAndInfoTable :: Platform -> CmmInfoTable -> Convention -> [LocalReg] -> FCode () -> FCode () Source #

slowCall :: CmmExpr -> [StgArg] -> FCode ReturnKind Source #

directCall :: Convention -> CLabel -> RepArity -> [StgArg] -> FCode ReturnKind Source #

data FieldOffOrPadding a Source #

Constructors

FieldOff (NonVoid a) ByteOff |
Padding ByteOff ByteOff |

data ClosureHeader Source #

Used to tell the various `mkVirtHeapOffsets` functions what kind of header the object has. This will be accounted for in the offsets of the fields returned.

Constructors

NoHeader |
StdHeader |
ThunkHeader |

mkVirtHeapOffsets :: Profile -> ClosureHeader -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [(NonVoid a, ByteOff)]) Source #

mkVirtHeapOffsetsWithPadding :: Profile -> ClosureHeader -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [FieldOffOrPadding a]) Source #

mkVirtConstrOffsets :: Profile -> [NonVoid (PrimRep, a)] -> (WordOff, WordOff, [(NonVoid a, ByteOff)]) Source #

Just like mkVirtHeapOffsets, but for constructors

mkVirtConstrSizes :: Profile -> [NonVoid PrimRep] -> (WordOff, WordOff) Source #

Just like mkVirtConstrOffsets, but used when we don't have the actual arguments. Useful when e.g. generating info tables; we just need to know sizes of pointer and non-pointer fields.

getHpRelOffset :: VirtualHpOffset -> FCode CmmExpr Source #

data ArgRep Source #

Constructors

P |
N |
L |
V |
F |
D |
V16 |
V32 |
V64 |

#### Instances

Instances details

Outputable ArgRep Source # |
Instance details Defined in GHC.StgToCmm.ArgRep Methods ppr :: ArgRep -> SDoc Source #
Eq ArgRep Source # |
Instance details Defined in GHC.StgToCmm.ArgRep Methods (==) :: ArgRep -> ArgRep -> Bool # (/=) :: ArgRep -> ArgRep -> Bool #

toArgRep :: Platform -> PrimRep -> ArgRep Source #

argRepSizeW :: Platform -> ArgRep -> WordOff Source #

getArgAmode :: NonVoid StgArg -> FCode CmmExpr Source #

getNonVoidArgAmodes :: [StgArg] -> FCode [CmmExpr] Source #