Safe Haskell | None |
---|---|
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 = 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
- seqInternalModBreaks :: InternalModBreaks -> ()
- data InternalBreakpointId = InternalBreakpointId {}
- type BreakInfoIndex = Int
Documentation
data CompiledByteCode Source #
Constructors
CompiledByteCode | |
Fields
|
Instances
Outputable CompiledByteCode Source # | |
Defined in GHC.ByteCode.Types Methods ppr :: CompiledByteCode -> SDoc Source # |
seqCompiledByteCode :: CompiledByteCode -> () Source #
data BCOByteArray a Source #
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) Source # | |
Defined in GHCi.ResolvedBCO Methods put :: BCOByteArray a -> Put Source # get :: Get (BCOByteArray a) Source # putList :: [BCOByteArray a] -> Put Source # | |
Show (BCOByteArray Word16) Source # | |
Defined in GHCi.ResolvedBCO | |
Show (BCOByteArray Word) Source # | |
Defined in GHCi.ResolvedBCO |
mkBCOByteArray :: UArray Int a -> BCOByteArray a Source #
A libffi ffi_cif function prototype.
Constructors
FFIInfo | |
Fields
|
Constructors
RegBitmap | |
Fields |
Instances
data NativeCallType Source #
Constructors
NativePrimCall | |
NativeTupleReturn |
Instances
Eq NativeCallType Source # | |
Defined in GHC.ByteCode.Types Methods (==) :: NativeCallType -> NativeCallType -> Bool Source # (/=) :: NativeCallType -> NativeCallType -> Bool Source # |
data NativeCallInfo Source #
Constructors
NativeCallInfo | |
Fields |
Instances
Outputable NativeCallInfo Source # | |
Defined in GHC.ByteCode.Types Methods ppr :: NativeCallInfo -> SDoc Source # |
Instances
Outputable ByteOff Source # | |
Eq ByteOff Source # | |
Ord ByteOff Source # | |
Defined in GHC.ByteCode.Types | |
Enum ByteOff Source # | |
Defined in GHC.ByteCode.Types Methods succ :: ByteOff -> ByteOff Source # pred :: ByteOff -> ByteOff Source # toEnum :: Int -> ByteOff Source # fromEnum :: ByteOff -> Int Source # enumFrom :: ByteOff -> [ByteOff] Source # enumFromThen :: ByteOff -> ByteOff -> [ByteOff] Source # enumFromTo :: ByteOff -> ByteOff -> [ByteOff] Source # enumFromThenTo :: ByteOff -> ByteOff -> ByteOff -> [ByteOff] Source # | |
Num ByteOff Source # | |
Defined in GHC.ByteCode.Types | |
Integral ByteOff Source # | |
Defined in GHC.ByteCode.Types Methods quot :: ByteOff -> ByteOff -> ByteOff Source # rem :: ByteOff -> ByteOff -> ByteOff Source # div :: ByteOff -> ByteOff -> ByteOff Source # mod :: ByteOff -> ByteOff -> ByteOff Source # quotRem :: ByteOff -> ByteOff -> (ByteOff, ByteOff) Source # | |
Real ByteOff Source # | |
Defined in GHC.ByteCode.Types Methods toRational :: ByteOff -> Rational Source # | |
Show ByteOff Source # | |
Instances
Outputable WordOff Source # | |
Eq WordOff Source # | |
Ord WordOff Source # | |
Defined in GHC.ByteCode.Types | |
Enum WordOff Source # | |
Defined in GHC.ByteCode.Types Methods succ :: WordOff -> WordOff Source # pred :: WordOff -> WordOff Source # toEnum :: Int -> WordOff Source # fromEnum :: WordOff -> Int Source # enumFrom :: WordOff -> [WordOff] Source # enumFromThen :: WordOff -> WordOff -> [WordOff] Source # enumFromTo :: WordOff -> WordOff -> [WordOff] Source # enumFromThenTo :: WordOff -> WordOff -> WordOff -> [WordOff] Source # | |
Num WordOff Source # | |
Defined in GHC.ByteCode.Types | |
Integral WordOff Source # | |
Defined in GHC.ByteCode.Types Methods quot :: WordOff -> WordOff -> WordOff Source # rem :: WordOff -> WordOff -> WordOff Source # div :: WordOff -> WordOff -> WordOff Source # mod :: WordOff -> WordOff -> WordOff Source # quotRem :: WordOff -> WordOff -> (WordOff, WordOff) Source # | |
Real WordOff Source # | |
Defined in GHC.ByteCode.Types Methods toRational :: WordOff -> Rational Source # | |
Show WordOff Source # | |
Instances
data UnlinkedBCO Source #
Constructors
UnlinkedBCO | |
Fields
|
Instances
NFData UnlinkedBCO Source # | |
Defined in GHC.ByteCode.Types Methods rnf :: UnlinkedBCO -> () Source # | |
Outputable UnlinkedBCO Source # | |
Defined in GHC.ByteCode.Types Methods ppr :: UnlinkedBCO -> SDoc Source # |
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 !BreakpointId | 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
FlatBag
will 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 Source # | |
Foldable FlatBag Source # | |
Defined in GHC.Data.FlatBag Methods fold :: Monoid m => FlatBag m -> m Source # foldMap :: Monoid m => (a -> m) -> FlatBag a -> m Source # foldMap' :: Monoid m => (a -> m) -> FlatBag a -> m Source # foldr :: (a -> b -> b) -> b -> FlatBag a -> b Source # foldr' :: (a -> b -> b) -> b -> FlatBag a -> b Source # foldl :: (b -> a -> b) -> b -> FlatBag a -> b Source # foldl' :: (b -> a -> b) -> b -> FlatBag a -> b Source # foldr1 :: (a -> a -> a) -> FlatBag a -> a Source # foldl1 :: (a -> a -> a) -> FlatBag a -> a Source # toList :: FlatBag a -> [a] Source # null :: FlatBag a -> Bool Source # length :: FlatBag a -> Int Source # elem :: Eq a => a -> FlatBag a -> Bool Source # maximum :: Ord a => FlatBag a -> a Source # minimum :: Ord a => FlatBag a -> a Source # | |
Traversable FlatBag Source # | |
Defined in GHC.Data.FlatBag | |
NFData a => NFData (FlatBag a) Source # | |
Defined in GHC.Data.FlatBag |
sizeFlatBag :: FlatBag a -> Word Source #
Calculate the size of
fromSmallArray :: SmallArray a -> FlatBag a Source #
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] Source #
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 Source #
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 Source #
Breakpoint tick index newtype BreakTickIndex = BreakTickIndex Int deriving (Eq, Ord, Data, Ix, NFData, Outputable)
Internal Mod Breaks
data InternalModBreaks Source #
Internal mod breaks store the runtime-relevant information of breakpoints.
Importantly, it maps InternalBreakpointId
s to CgBreakInfo
.
InternalModBreaks
are constructed during bytecode generation and stored in
CompiledByteCode
afterwards.
Constructors
InternalModBreaks | |
Fields
|
data CgBreakInfo Source #
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 Source # | |
Defined in GHC.ByteCode.Breakpoints Methods ppr :: CgBreakInfo -> SDoc Source # |
seqInternalModBreaks :: InternalModBreaks -> () Source #
Fully force an InternalModBreaks
value
Internal breakpoint identifier
data InternalBreakpointId Source #
Internal breakpoint identifier
Indexes into the structures in the
produced during ByteCode generation.
See Note [Breakpoint identifiers]InternalModBreaks
Constructors
InternalBreakpointId | |
Fields
|
Instances
type BreakInfoIndex = Int Source #
Internal breakpoint info index