ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.ByteCode.Types

Description

Bytecode assembler types

Synopsis

Documentation

data CompiledByteCode #

Constructors

CompiledByteCode 

Fields

Instances

Instances details
Outputable CompiledByteCode # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: CompiledByteCode -> SDoc #

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 

Instances

Instances details
(Binary a, Storable a, IArray UArray a) => Binary (BCOByteArray a) # 
Instance details

Defined in GHCi.ResolvedBCO

Methods

put :: BCOByteArray a -> Put #

get :: Get (BCOByteArray a) #

putList :: [BCOByteArray a] -> Put #

Show (BCOByteArray Word16) # 
Instance details

Defined in GHCi.ResolvedBCO

Show (BCOByteArray Word) # 
Instance details

Defined in GHCi.ResolvedBCO

data FFIInfo #

A libffi ffi_cif function prototype.

Constructors

FFIInfo 

Instances

Instances details
Show FFIInfo # 
Instance details

Defined in GHC.ByteCode.Types

newtype RegBitmap #

Constructors

RegBitmap 

Fields

Instances

Instances details
Bits RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

FiniteBits RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Enum RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Num RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Integral RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Real RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Show RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Outputable RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: RegBitmap -> SDoc #

Eq RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

Ord RegBitmap # 
Instance details

Defined in GHC.ByteCode.Types

data NativeCallType #

Instances

Instances details
Eq NativeCallType # 
Instance details

Defined in GHC.ByteCode.Types

newtype ByteOff #

Constructors

ByteOff Int 

Instances

Instances details
Enum ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Num ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Integral ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Real ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Show ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Outputable ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: ByteOff -> SDoc #

Eq ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

Methods

(==) :: ByteOff -> ByteOff -> Bool #

(/=) :: ByteOff -> ByteOff -> Bool #

Ord ByteOff # 
Instance details

Defined in GHC.ByteCode.Types

newtype WordOff #

Constructors

WordOff Int 

Instances

Instances details
Enum WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Num WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Integral WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Real WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Show WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Outputable WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: WordOff -> SDoc #

Eq WordOff # 
Instance details

Defined in GHC.ByteCode.Types

Methods

(==) :: WordOff -> WordOff -> Bool #

(/=) :: WordOff -> WordOff -> Bool #

Ord WordOff # 
Instance details

Defined in GHC.ByteCode.Types

newtype HalfWord #

Constructors

HalfWord Word 

Instances

Instances details
Enum HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Num HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Integral HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Real HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Show HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Outputable HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: HalfWord -> SDoc #

Eq HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

Ord HalfWord # 
Instance details

Defined in GHC.ByteCode.Types

data UnlinkedBCO #

Instances

Instances details
NFData UnlinkedBCO # 
Instance details

Defined in GHC.ByteCode.Types

Methods

rnf :: UnlinkedBCO -> () #

Outputable UnlinkedBCO # 
Instance details

Defined in GHC.ByteCode.Types

Methods

ppr :: UnlinkedBCO -> SDoc #

data BCOPtr #

Constructors

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

Converted to the actual BreakArray remote pointer at link-time

Instances

Instances details
NFData BCOPtr # 
Instance details

Defined in GHC.ByteCode.Types

Methods

rnf :: BCOPtr -> () #

data BCONPtr #

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 BCONPtrStr but with benefits of FastString interning logic.

BCONPtrFFIInfo !FFIInfo

A libffi ffi_cif function prototype.

BCONPtrCostCentre !InternalBreakpointId

A CostCentre remote pointer array's respective BreakpointId

Instances

Instances details
NFData BCONPtr # 
Instance details

Defined in GHC.ByteCode.Types

Methods

rnf :: BCONPtr -> () #

newtype ItblPtr #

Instances

Instances details
NFData ItblPtr # 
Instance details

Defined in GHC.ByteCode.Types

Methods

rnf :: ItblPtr -> () #

Show ItblPtr # 
Instance details

Defined in GHC.ByteCode.Types

newtype AddrPtr #

Constructors

AddrPtr (RemotePtr ()) 

Instances

Instances details
NFData AddrPtr # 
Instance details

Defined in GHC.ByteCode.Types

Methods

rnf :: AddrPtr -> () #

data FlatBag a #

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

Instances details
Functor FlatBag # 
Instance details

Defined in GHC.Data.FlatBag

Methods

fmap :: (a -> b) -> FlatBag a -> FlatBag b #

(<$) :: a -> FlatBag b -> FlatBag a #

Foldable FlatBag # 
Instance details

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 #

toList :: FlatBag a -> [a] #

null :: FlatBag a -> Bool #

length :: FlatBag a -> Int #

elem :: Eq a => a -> FlatBag a -> Bool #

maximum :: Ord a => FlatBag a -> a #

minimum :: Ord a => FlatBag a -> a #

sum :: Num a => FlatBag a -> a #

product :: Num a => FlatBag a -> a #

Traversable FlatBag # 
Instance details

Defined in GHC.Data.FlatBag

Methods

traverse :: Applicative f => (a -> f b) -> FlatBag a -> f (FlatBag b) #

sequenceA :: Applicative f => FlatBag (f a) -> f (FlatBag a) #

mapM :: Monad m => (a -> m b) -> FlatBag a -> m (FlatBag b) #

sequence :: Monad m => FlatBag (m a) -> m (FlatBag a) #

NFData a => NFData (FlatBag a) # 
Instance details

Defined in GHC.Data.FlatBag

Methods

rnf :: FlatBag a -> () #

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

data ModBreaks #

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 ModBreaks created during desugaring (after inserting the breakpoint ticks in the expressions). See Note [Breakpoint identifiers]

Constructors

BreakpointId 

Fields

Instances

Instances details
NFData BreakpointId # 
Instance details

Defined in GHC.Types.Tickish

Methods

rnf :: BreakpointId -> () #

Data BreakpointId # 
Instance details

Defined in GHC.Types.Tickish

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BreakpointId -> c BreakpointId #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BreakpointId #

toConstr :: BreakpointId -> Constr #

dataTypeOf :: BreakpointId -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BreakpointId) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BreakpointId) #

gmapT :: (forall b. Data b => b -> b) -> BreakpointId -> BreakpointId #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BreakpointId -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BreakpointId -> r #

gmapQ :: (forall d. Data d => d -> u) -> BreakpointId -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BreakpointId -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BreakpointId -> m BreakpointId #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BreakpointId -> m BreakpointId #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BreakpointId -> m BreakpointId #

Outputable BreakpointId # 
Instance details

Defined in GHC.Types.Tickish

Methods

ppr :: BreakpointId -> SDoc #

Eq BreakpointId # 
Instance details

Defined in GHC.Types.Tickish

Ord BreakpointId # 
Instance details

Defined in GHC.Types.Tickish

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

  • imodBreaks_breakInfo :: !(IntMap CgBreakInfo)

    Access code-gen time information about a breakpoint, indexed by InternalBreakpointId.

  • imodBreaks_modBreaks :: !ModBreaks

    Store the ModBreaks for this module

    Recall Note [Breakpoint identifiers]: for some module A, an *occurrence* of a breakpoint in A may have been inlined from some breakpoint *defined* in module B.

    This ModBreaks contains information regarding all the breakpoints defined in the module this InternalModBreaks corresponds to. It does not necessarily have information regarding all the breakpoint occurrences registered in imodBreaks_breakInfo. Some of those occurrences may refer breakpoints inlined from other modules.

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

  • cgb_tyvars :: ![IfaceTvBndr]

    Type variables in scope at the breakpoint

  • cgb_vars :: ![Maybe (IfaceIdBndr, Word)]
     
  • cgb_resty :: !IfaceType
     
  • cgb_tick_id :: !(Either InternalBreakLoc BreakpointId)

    This field records the original breakpoint tick identifier for this internal breakpoint info. It is used to convert a breakpoint *occurrence* index (InternalBreakpointId) into a *definition* index (BreakpointId).

    The modules of breakpoint occurrence and breakpoint definition are not necessarily the same: See Note [Breakpoint identifiers].

    If there is no original tick identifier (that is, the breakpoint was created during code generation), we re-use the BreakpointId of something else. It would also be reasonable to have an Either something BreakpointId for cgb_tick_id, but currently we can always re-use a source-level BreakpointId. In the case of step-out, see Note [Debugger: Stepout internal break locs]

Instances

Instances details
Outputable CgBreakInfo # 
Instance details

Defined in GHC.ByteCode.Breakpoints

Methods

ppr :: CgBreakInfo -> SDoc #

Internal breakpoint identifier

type BreakInfoIndex = Int #

Internal breakpoint info index