HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Moduleghc-9.14.1GHC2021

GHC.ByteCode.Types

Bytecode assembler types

  • 24 types
  • 8 values
  • Packageghc-9.14.1
  • Exports32
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceTypes.hs
datadata CompiledByteCode
#

Constructors

Instances1Outputable
datadata BCOByteArray a
#

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.

Instances3Show, Binary
newtypenewtype RegBitmap
#
Instances10Enum, Eq, Integral, Num, Ord, Real, …
newtypenewtype ByteOff
#

Constructors

Instances8Enum, Eq, Integral, Num, Ord, Real, …
newtypenewtype WordOff
#

Constructors

Instances8Enum, Eq, Integral, Num, Ord, Real, …
newtypenewtype HalfWord
#

Constructors

Instances8Enum, Eq, Integral, Num, Ord, Real, …
datadata BCONPtr
#

Constructors

Instances1NFData
datadata 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.

Instances4Functor, Foldable, Traversable, NFData
valuefromSmallArray :: 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.

Mod Breaks

3 declarations
datadata 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

datadata 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

Instances5Eq, Data, Ord, NFData, Outputable
typetype BreakTickIndex = Int
#

Breakpoint tick index newtype BreakTickIndex = BreakTickIndex Int deriving (Eq, Ord, Data, Ix, NFData, Outputable)

Internal Mod Breaks

3 declarations
datadata 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

datadata 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
    • 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]

Instances1Outputable

Internal breakpoint identifier

datadata InternalBreakpointId
#

Internal breakpoint identifier

Indexes into the structures in the InternalModBreaks produced during ByteCode generation. See Note [Breakpoint identifiers]

Constructors

Instances4Eq, Ord, NFData, Outputable