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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-10.0.0.20260917GHC2024

GHC.StgToJS.Types

Module that holds the Types required for the StgToJS pass

  • 33 types
  • 6 values
datadata GenGroupState
#

The JS code generator state relevant for the current binding group

Constructors

datadata StgToJSConfig
#

The Configuration record for the StgToJS pass

datadata ClosureInfo
#

Closure info table

Constructors

Instances3Eq, Show, Binary
datadata CIRegs
#

Closure information, ClosureInfo, registers

Constructors

Instances4Eq, Ord, Show, Binary
  • Eq CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
datadata CILayout
#

Closure Information, ClosureInfo, layout

Constructors

Instances4Eq, Ord, Show, Binary
  • Eq CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
datadata CIType
#

The type of ClosureInfo

Constructors

Instances4Eq, Ord, Show, Binary
  • Eq CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
newtypenewtype CIStatic
#

Static references that must be kept alive

Instances6Eq, Show, Semigroup, Monoid, Binary, ToJExpr
  • Eq CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Semigroup CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Monoid CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
  • ToJExpr CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types

    static refs: array = references, null = nothing to report note: only works after all top-level objects have been created

datadata JSRep
#

JS primitive representations

Constructors

  • PtrV

    pointer = reference to heap object (closure object), lifted or not. Can also be some RTS object (e.g. TVar#, MVar#, MutVar#, Weak#)

  • VoidV

    no fields

  • DoubleV

    A Double: one field

  • IntV

    An Int (32bit because JS): one field

  • LongV

    A Long: two fields one for the upper 32bits, one for the lower (NB: JS is little endian)

  • AddrV

    a pointer not to the heap: two fields, array + index

  • ObjV

    some JS object, user supplied, be careful around these, can be anything

  • ArrV

    boxed array

Instances7Bounded, Enum, Eq, Ord, Show, Binary, …
  • Bounded JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Enum JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Eq JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
  • ToJExpr JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
datadata IdType
#

The type of identifiers. These determine the suffix of generated functions in JS Land. For example, the entry function for the Just constructor is a IdConEntry which compiles to: function h$ghczminternalZCGHCziInternalziMaybeziJust_con_e() { return h$rs() }; which just returns whatever the stack point is pointing to. Whereas the entry function to Just is an IdEntry and does the work. It compiles to: function h$ghczminternalZCGHCziInternalziMaybeziJust_e() { var h$$baseZCGHCziMaybezieta_8KXnScrCjF5 = h$r2; h$r1 = h$c1(h$ghczminternalZCGHCziInternalziMaybeziJust_con_e, h$$ghczminternalZCGHCziInternalziMaybezieta_8KXnScrCjF5); return h$rs(); }; Which loads some payload from register 2, and applies the Constructor Entry function for the Just to the payload, returns the result in register 1 and returns whatever is on top of the stack

Constructors

Instances3Enum, Eq, Ord
  • Enum IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Eq IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
datadata IdKey
#

Keys to differentiate Ident's in the ID Cache

Constructors

Instances2Eq, Ord
  • Eq IdKeyDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord IdKeyDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
datadata StackSlot
#

A Stack Slot is either known or unknown. We avoid maybe here for more strictness.

Constructors

Instances2Eq, Ord
  • Eq StackSlotDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord StackSlotDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
datadata StaticVal
#

Constructors

Instances3Eq, Show, Binary
  • Eq StaticValDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show StaticValDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary StaticValDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
datadata StaticUnboxed
#
Instances4Eq, Ord, Show, Binary
datadata StaticArg
#

Static Arguments. Static Arguments are things that are statically allocated, i.e., they exist at program startup. These are static heap objects or literals or things that have been floated to the top level binding by ghc.

Constructors

Instances4Eq, Show, Outputable, Binary
datadata StaticLit
#

A Static literal value

Constructors

Instances5Eq, Show, Outputable, Binary, ToJExpr
datadata LinkableUnit
#

data used to generate one ObjBlock in our object file

Constructors

datadata JSFFIType
#
Instances5Enum, Eq, Ord, Show, Binary
  • Enum JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Eq JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Ord JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Show JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Types
  • Binary JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.Object · orphan
datadata PrimRes
#

A Primop result is either an inlining of some JS payload, or a primitive call to a JS function defined in Shim files in base.

Constructors

  • PrimInline JStgStat

    primop is inline, result is assigned directly

  • PRPrimCall JStgStat

    primop is async call, primop returns the next function to run. result returned to stack top in registers

datadata ClosureType
#

A Closure is one of six types

Constructors

  • Thunk

    The closure is a THUNK

  • Fun

    The closure is a Function

  • Pap

    The closure is a Partial Application

  • Con

    The closure is a Constructor

  • Blackhole

    The closure is a Blackhole

  • StackFrame

    The closure is a stack frame

Instances7Bounded, Enum, Eq, Ord, Show, Ix, …
datadata ThreadStatus
#

A thread is in one of 4 states

Constructors

Instances5Bounded, Enum, Eq, Ord, Show