| Safe Haskell | Ignore |
|---|---|
| Language | GHC2021 |
GHC.ByteCode.Types
Description
Bytecode assembler types
Synopsis
- data CompiledByteCode = CompiledByteCode {
- bc_bcos :: FlatBag UnlinkedBCO
- bc_itbls :: [(Name, ConInfoTable)]
- bc_strs :: [(Name, ByteString)]
- bc_breaks :: Maybe InternalModBreaks
- bc_spt_entries :: ![SptEntry]
- seqCompiledByteCode :: CompiledByteCode -> ()
- data BCOByteArray (a :: k) = BCOByteArray {}
- mkBCOByteArray :: UArray Int a -> BCOByteArray a
- data FFIInfo = FFIInfo {
- ffiInfoArgs :: ![FFIType]
- ffiInfoRet :: !FFIType
- newtype RegBitmap = RegBitmap {}
- data NativeCallType
- data NativeCallInfo = NativeCallInfo {}
- voidTupleReturnInfo :: NativeCallInfo
- voidPrimCallInfo :: NativeCallInfo
- newtype ByteOff = ByteOff Int
- newtype WordOff = WordOff Int
- newtype HalfWord = HalfWord Word
- data UnlinkedBCO = UnlinkedBCO {
- unlinkedBCOName :: !Name
- unlinkedBCOArity :: !Int
- unlinkedBCOInstrs :: !(BCOByteArray Word16)
- unlinkedBCOBitmap :: !(BCOByteArray Word)
- unlinkedBCOLits :: !(FlatBag BCONPtr)
- unlinkedBCOPtrs :: !(FlatBag BCOPtr)
- data BCOPtr
- data BCONPtr
- type ItblEnv = NameEnv (Name, ItblPtr)
- newtype ItblPtr = ItblPtr (RemotePtr StgInfoTable)
- type AddrEnv = NameEnv (Name, AddrPtr)
- newtype AddrPtr = AddrPtr (RemotePtr ())
- data FlatBag a
- sizeFlatBag :: FlatBag a -> Word
- fromSmallArray :: SmallArray a -> FlatBag a
- elemsFlatBag :: FlatBag a -> [a]
- data ModBreaks = ModBreaks {
- modBreaks_locs :: !(Array BreakTickIndex SrcSpan)
- modBreaks_vars :: !(Array BreakTickIndex [OccName])
- modBreaks_decls :: !(Array BreakTickIndex [String])
- modBreaks_ccs :: !(Array BreakTickIndex (String, String))
- modBreaks_module :: !Module
- data BreakpointId = BreakpointId {}
- type BreakTickIndex = Int
- data InternalModBreaks = InternalModBreaks {}
- data CgBreakInfo = CgBreakInfo {
- cgb_tyvars :: ![IfaceTvBndr]
- cgb_vars :: ![Maybe (IfaceIdBndr, Word)]
- cgb_resty :: !IfaceType
- cgb_tick_id :: !(Either InternalBreakLoc BreakpointId)
- seqInternalModBreaks :: InternalModBreaks -> ()
- data InternalBreakpointId = InternalBreakpointId {}
- type BreakInfoIndex = Int
Documentation
data CompiledByteCode #
Constructors
| CompiledByteCode | |
Fields
| |
Instances
| Outputable CompiledByteCode # | |
Defined in GHC.ByteCode.Types Methods ppr :: CompiledByteCode -> SDoc # | |
seqCompiledByteCode :: CompiledByteCode -> () #
data BCOByteArray (a :: k) #
Wrapper for a ByteArray#.
The phantom type tells what elements are stored in the ByteArray#.
Creating a ByteArray# can be achieved using UArray's API,
where the underlying ByteArray# can be unpacked.
Constructors
| BCOByteArray | |
Fields | |
Instances
| (Binary a, Storable a, IArray UArray a) => Binary (BCOByteArray a) # | |
Defined in GHCi.ResolvedBCO Methods put :: BCOByteArray a -> Put # get :: Get (BCOByteArray a) # putList :: [BCOByteArray a] -> Put # | |
| Show (BCOByteArray Word16) # | |
Defined in GHCi.ResolvedBCO | |
| Show (BCOByteArray Word) # | |
Defined in GHCi.ResolvedBCO | |
mkBCOByteArray :: UArray Int a -> BCOByteArray a #
A libffi ffi_cif function prototype.
Constructors
| FFIInfo | |
Fields
| |
Constructors
| RegBitmap | |
Fields | |
Instances
data NativeCallType #
Constructors
| NativePrimCall | |
| NativeTupleReturn |
Instances
| Eq NativeCallType # | |
Defined in GHC.ByteCode.Types Methods (==) :: NativeCallType -> NativeCallType -> Bool # (/=) :: NativeCallType -> NativeCallType -> Bool # | |
data NativeCallInfo #
Constructors
| NativeCallInfo | |
Fields | |
Instances
| Outputable NativeCallInfo # | |
Defined in GHC.ByteCode.Types Methods ppr :: NativeCallInfo -> SDoc # | |
Instances
| Enum ByteOff # | |
| Num ByteOff # | |
| Integral ByteOff # | |
Defined in GHC.ByteCode.Types | |
| Real ByteOff # | |
Defined in GHC.ByteCode.Types Methods toRational :: ByteOff -> Rational # | |
| Show ByteOff # | |
| Outputable ByteOff # | |
Defined in GHC.ByteCode.Types | |
| Eq ByteOff # | |
| Ord ByteOff # | |
Instances
| Enum WordOff # | |
| Num WordOff # | |
| Integral WordOff # | |
Defined in GHC.ByteCode.Types | |
| Real WordOff # | |
Defined in GHC.ByteCode.Types Methods toRational :: WordOff -> Rational # | |
| Show WordOff # | |
| Outputable WordOff # | |
Defined in GHC.ByteCode.Types | |
| Eq WordOff # | |
| Ord WordOff # | |
Instances
| Enum HalfWord # | |
Defined in GHC.ByteCode.Types | |
| Num HalfWord # | |
| Integral HalfWord # | |
Defined in GHC.ByteCode.Types | |
| Real HalfWord # | |
Defined in GHC.ByteCode.Types Methods toRational :: HalfWord -> Rational # | |
| Show HalfWord # | |
| Outputable HalfWord # | |
Defined in GHC.ByteCode.Types | |
| Eq HalfWord # | |
| Ord HalfWord # | |
Defined in GHC.ByteCode.Types | |
data UnlinkedBCO #
Constructors
| UnlinkedBCO | |
Fields
| |
Instances
| NFData UnlinkedBCO # | |
Defined in GHC.ByteCode.Types Methods rnf :: UnlinkedBCO -> () # | |
| Outputable UnlinkedBCO # | |
Defined in GHC.ByteCode.Types Methods ppr :: UnlinkedBCO -> SDoc # | |
Constructors
| BCOPtrName !Name | |
| BCOPtrPrimOp !PrimOp | |
| BCOPtrBCO !UnlinkedBCO | |
| BCOPtrBreakArray !Module | Converted to the actual |
Constructors
| BCONPtrWord !Word | |
| BCONPtrLbl !FastString | |
| BCONPtrItbl !Name | |
| BCONPtrAddr !Name | A reference to a top-level string literal; see Note [Generating code for top-level string literal bindings] in GHC.StgToByteCode. |
| BCONPtrStr !ByteString | A top-level string literal. Also see Note [Allocating string literals] in GHC.ByteCode.Asm. |
| BCONPtrFS !FastString | Same as |
| BCONPtrFFIInfo !FFIInfo | A libffi ffi_cif function prototype. |
| BCONPtrCostCentre !InternalBreakpointId | A |
Constructors
| ItblPtr (RemotePtr StgInfoTable) |
Store elements in a flattened representation.
A FlatBag is a data structure that stores an ordered list of elements
in a flat structure, avoiding the overhead of a linked list.
Use this data structure, if the code requires the following properties:
- Elements are stored in a long-lived object, and benefit from a flattened representation.
- The
FlatBagwill be traversed but not extended or filtered. - The number of elements should be known.
- Sharing of the empty case improves memory behaviour.
A FlagBag aims to have as little overhead as possible to store its elements.
To achieve that, it distinguishes between the empty case, singleton, tuple
and general case.
Thus, we only pay for the additional three words of an Array if we have at least
three elements.
Instances
| Functor FlatBag # | |
| Foldable FlatBag # | |
Defined in GHC.Data.FlatBag Methods fold :: Monoid m => FlatBag m -> m # foldMap :: Monoid m => (a -> m) -> FlatBag a -> m # foldMap' :: Monoid m => (a -> m) -> FlatBag a -> m # foldr :: (a -> b -> b) -> b -> FlatBag a -> b # foldr' :: (a -> b -> b) -> b -> FlatBag a -> b # foldl :: (b -> a -> b) -> b -> FlatBag a -> b # foldl' :: (b -> a -> b) -> b -> FlatBag a -> b # foldr1 :: (a -> a -> a) -> FlatBag a -> a # foldl1 :: (a -> a -> a) -> FlatBag a -> a # elem :: Eq a => a -> FlatBag a -> Bool # maximum :: Ord a => FlatBag a -> a # minimum :: Ord a => FlatBag a -> a # | |
| Traversable FlatBag # | |
| NFData a => NFData (FlatBag a) # | |
Defined in GHC.Data.FlatBag | |
sizeFlatBag :: FlatBag a -> Word #
Calculate the size of
fromSmallArray :: SmallArray a -> FlatBag a #
Convert a SizedSeq into its flattened representation.
A 'FlatBag a' is more memory efficient than '[a]', if no further modification
is necessary.
elemsFlatBag :: FlatBag a -> [a] #
Get all elements that are stored in the FlatBag.
Mod Breaks
All the information about the source-relevant breakpoints for a module
This information is constructed once during desugaring (with mkModBreaks)
from breakpoint ticks and fixed/unchanged from there on forward. It could be
exported as an abstract datatype because it should never be updated after
construction, only queried.
The arrays can be indexed using the int in the corresponding BreakpointId
(i.e. the BreakpointId whose Module matches the Module corresponding
to these ModBreaks) with the accessors modBreaks_locs, modBreaks_vars,
and modBreaks_decls.
Constructors
| ModBreaks | |
Fields
| |
data BreakpointId #
Breakpoint identifier.
Indexes into the structures in the created during desugaring
(after inserting the breakpoint ticks in the expressions).
See Note [Breakpoint identifiers]ModBreaks
Constructors
| BreakpointId | |
Fields
| |
Instances
type BreakTickIndex = Int #
Breakpoint tick index newtype BreakTickIndex = BreakTickIndex Int deriving (Eq, Ord, Data, Ix, NFData, Outputable)
Internal Mod Breaks
data InternalModBreaks #
Internal mod breaks store the runtime-relevant information of breakpoints.
Importantly, it maps InternalBreakpointIds to CgBreakInfo.
InternalModBreaks are constructed during bytecode generation and stored in
CompiledByteCode afterwards.
Constructors
| InternalModBreaks | |
Fields
| |
data CgBreakInfo #
Information about a breakpoint that we know at code-generation time
In order to be used, this needs to be hydrated relative to the current HscEnv by
hydrateCgBreakInfo. Everything here can be fully forced and that's critical for
preventing space leaks (see #22530)
Constructors
| CgBreakInfo | |
Fields
| |
Instances
| Outputable CgBreakInfo # | |
Defined in GHC.ByteCode.Breakpoints Methods ppr :: CgBreakInfo -> SDoc # | |
seqInternalModBreaks :: InternalModBreaks -> () #
Fully force an InternalModBreaks value
Internal breakpoint identifier
data InternalBreakpointId #
Internal breakpoint identifier
Indexes into the structures in the produced during ByteCode generation.
See Note [Breakpoint identifiers]InternalModBreaks
Constructors
| InternalBreakpointId | |
Fields
| |
Instances
| NFData InternalBreakpointId # | |
Defined in GHC.ByteCode.Breakpoints Methods rnf :: InternalBreakpointId -> () # | |
| Outputable InternalBreakpointId # | |
Defined in GHC.ByteCode.Breakpoints Methods ppr :: InternalBreakpointId -> SDoc # | |
| Eq InternalBreakpointId # | |
Defined in GHC.ByteCode.Breakpoints Methods (==) :: InternalBreakpointId -> InternalBreakpointId -> Bool # (/=) :: InternalBreakpointId -> InternalBreakpointId -> Bool # | |
| Ord InternalBreakpointId # | |
Defined in GHC.ByteCode.Breakpoints Methods compare :: InternalBreakpointId -> InternalBreakpointId -> Ordering # (<) :: InternalBreakpointId -> InternalBreakpointId -> Bool # (<=) :: InternalBreakpointId -> InternalBreakpointId -> Bool # (>) :: InternalBreakpointId -> InternalBreakpointId -> Bool # (>=) :: InternalBreakpointId -> InternalBreakpointId -> Bool # max :: InternalBreakpointId -> InternalBreakpointId -> InternalBreakpointId # min :: InternalBreakpointId -> InternalBreakpointId -> InternalBreakpointId # | |
type BreakInfoIndex = Int #
Internal breakpoint info index