HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.StgToJS.Types

Module that holds the Types required for the StgToJS pass

  • 32 types
  • 4 values
  • Packageghc-9.10.3
  • Exports36
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceTypes.hs
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
#

Information relevenat to code generation for closures.

Constructors

Instances3Eq, Show, Binary
datadata CILayout
#

Closure Information, ClosureInfo, layout

Constructors

Instances4Eq, Ord, Show, Binary
datadata CIType
#

The type of ClosureInfo

Constructors

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

Static references that must be kept alive

Instances6Eq, Show, Semigroup, Monoid, Binary, ToJExpr
  • Eq CIStaticDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Show CIStaticDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Semigroup CIStaticDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Monoid CIStaticDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Binary CIStaticDefined in ghc-9.10.3 · GHC.StgToJS.Object · orphan
  • ToJExpr CIStaticDefined in ghc-9.10.3 · 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-9.10.3 · GHC.StgToJS.Types
  • Enum JSRepDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Eq JSRepDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Ord JSRepDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Show JSRepDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Binary JSRepDefined in ghc-9.10.3 · GHC.StgToJS.Object · orphan
  • ToJExpr JSRepDefined in ghc-9.10.3 · 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-9.10.3 · GHC.StgToJS.Types
  • Eq IdTypeDefined in ghc-9.10.3 · GHC.StgToJS.Types
  • Ord IdTypeDefined in ghc-9.10.3 · GHC.StgToJS.Types
datadata IdKey
#

Keys to differentiate Ident's in the ID Cache

Constructors

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

Constructors

Instances3Eq, 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 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

Instances6Bounded, Enum, Eq, Ord, Show, ToJExpr
datadata ThreadStatus
#

A thread is in one of 4 states

Constructors

Instances5Bounded, Enum, Eq, Ord, Show