ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

ByteCodeTypes

Description

Bytecode assembler types

Synopsis

- data CompiledByteCode = CompiledByteCode {
  - bc_bcos :: [UnlinkedBCO]
  - bc_itbls :: ItblEnv
  - bc_ffis :: [FFIInfo]
  - bc_strs :: [RemotePtr ()]
  - bc_breaks :: Maybe ModBreaks
  }
- seqCompiledByteCode :: CompiledByteCode -> ()
- newtype FFIInfo = FFIInfo (RemotePtr C_ffi_cif)
- data UnlinkedBCO = UnlinkedBCO {
  - unlinkedBCOName :: !Name
  - unlinkedBCOArity :: !Int
  - unlinkedBCOInstrs :: !(UArray Int Word16)
  - unlinkedBCOBitmap :: !(UArray Int Word)
  - unlinkedBCOLits :: !(SizedSeq BCONPtr)
  - unlinkedBCOPtrs :: !(SizedSeq BCOPtr)
  }
- data BCOPtr
  - = BCOPtrName !Name
  - | BCOPtrPrimOp !PrimOp
  - | BCOPtrBCO !UnlinkedBCO
  - | BCOPtrBreakArray
- data BCONPtr
  - = BCONPtrWord !Word
  - | BCONPtrLbl !FastString
  - | BCONPtrItbl !Name
  - | BCONPtrStr !ByteString
- type ItblEnv = NameEnv (Name, ItblPtr)
- newtype ItblPtr = ItblPtr (RemotePtr StgInfoTable)
- data CgBreakInfo = CgBreakInfo {
  - cgb_vars :: [(Id, Word16)]
  - cgb_resty :: Type
  }
- data ModBreaks = ModBreaks {
  - modBreaks_flags :: ForeignRef BreakArray
  - modBreaks_locs :: !(Array BreakIndex SrcSpan)
  - modBreaks_vars :: !(Array BreakIndex [OccName])
  - modBreaks_decls :: !(Array BreakIndex [String])
  - modBreaks_ccs :: !(Array BreakIndex (RemotePtr CostCentre))
  - modBreaks_breakInfo :: IntMap CgBreakInfo
  }
- type BreakIndex = Int
- emptyModBreaks :: ModBreaks
- data CCostCentre

# Documentation

data CompiledByteCode #

Constructors

CompiledByteCode |

Fields

- bc_bcos :: [UnlinkedBCO]
- bc_itbls :: ItblEnv
- bc_ffis :: [FFIInfo]
- bc_strs :: [RemotePtr ()]
- bc_breaks :: Maybe ModBreaks

Instances

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

seqCompiledByteCode :: CompiledByteCode -> () #

newtype FFIInfo #

Constructors

FFIInfo (RemotePtr C_ffi_cif) |

Instances

Show FFIInfo # |
Methods showsPrec :: Int -> FFIInfo -> ShowS Source # show :: FFIInfo -> String Source # showList :: [FFIInfo] -> ShowS Source #
NFData FFIInfo # |
Methods rnf :: FFIInfo -> () Source #

data UnlinkedBCO #

Constructors

UnlinkedBCO |

Fields

- unlinkedBCOName :: !Name
- unlinkedBCOArity :: !Int
- unlinkedBCOInstrs :: !(UArray Int Word16)
- unlinkedBCOBitmap :: !(UArray Int Word)
- unlinkedBCOLits :: !(SizedSeq BCONPtr)
- unlinkedBCOPtrs :: !(SizedSeq BCOPtr)

Instances

NFData UnlinkedBCO # |
Methods rnf :: UnlinkedBCO -> () Source #
Outputable UnlinkedBCO # |
Methods ppr :: UnlinkedBCO -> SDoc # pprPrec :: Rational -> UnlinkedBCO -> SDoc #

data BCOPtr #

Constructors

BCOPtrName !Name |
BCOPtrPrimOp !PrimOp |
BCOPtrBCO !UnlinkedBCO |
BCOPtrBreakArray |

Instances

NFData BCOPtr # |
Methods rnf :: BCOPtr -> () Source #

data BCONPtr #

Constructors

BCONPtrWord !Word |
BCONPtrLbl !FastString |
BCONPtrItbl !Name |
BCONPtrStr !ByteString |

Instances

NFData BCONPtr # |
Methods rnf :: BCONPtr -> () Source #

type ItblEnv = NameEnv (Name, ItblPtr) #

newtype ItblPtr #

Constructors

ItblPtr (RemotePtr StgInfoTable) |

Instances

Show ItblPtr # |
Methods showsPrec :: Int -> ItblPtr -> ShowS Source # show :: ItblPtr -> String Source # showList :: [ItblPtr] -> ShowS Source #
NFData ItblPtr # |
Methods rnf :: ItblPtr -> () Source #

data CgBreakInfo #

Information about a breakpoint that we know at code-generation time

Constructors

CgBreakInfo |

Fields

- cgb_vars :: [(Id, Word16)]
- cgb_resty :: Type

Instances

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

data ModBreaks #

All the information about the breakpoints for a module

Constructors

ModBreaks |

Fields

- modBreaks_flags :: ForeignRef BreakArray

  The array of flags, one per breakpoint, indicating which breakpoints are enabled.

- modBreaks_locs :: !(Array BreakIndex SrcSpan)

  An array giving the source span of each breakpoint.

- modBreaks_vars :: !(Array BreakIndex [OccName])

  An array giving the names of the free variables at each breakpoint.

- modBreaks_decls :: !(Array BreakIndex [String])

  An array giving the names of the declarations enclosing each breakpoint.

- modBreaks_ccs :: !(Array BreakIndex (RemotePtr CostCentre))

  Array pointing to cost centre for each breakpoint

- modBreaks_breakInfo :: IntMap CgBreakInfo

  info about each breakpoint from the bytecode generator

type BreakIndex = Int #

Breakpoint index

emptyModBreaks :: ModBreaks #

Construct an empty ModBreaks

data CCostCentre #

C CostCentre type