ghc-9.6.3: The GHC API

Copyright | (c) The University of Glasgow 2001
License | BSD-style (see the file LICENSE)
Maintainer | Jeffrey Young <jeffrey.young@iohk.io> Luite Stegeman <luite.stegeman@iohk.io> Sylvain Henry <sylvain.henry@iohk.io> Josh Meredith <josh.meredith@iohk.io>
Stability | experimental
Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.StgToJS.Types

Description

Module that holds the Types required for the StgToJS pass

Synopsis

- type G = StateT GenState IO
- data GenState = GenState {
  - gsSettings :: !StgToJSConfig
  - gsModule :: !Module
  - gsId :: !FastMutInt
  - gsIdents :: !IdCache
  - gsUnfloated :: !(UniqFM Id CgStgExpr)
  - gsGroup :: GenGroupState
  - gsGlobal :: [JStat]
  }
- data GenGroupState = GenGroupState {
  - ggsToplevelStats :: [JStat]
  - ggsClosureInfo :: [ClosureInfo]
  - ggsStatic :: [StaticInfo]
  - ggsStack :: [StackSlot]
  - ggsStackDepth :: Int
  - ggsExtraDeps :: Set OtherSymb
  - ggsGlobalIdCache :: GlobalIdCache
  - ggsForeignRefs :: [ForeignJSRef]
  }
- data StgToJSConfig = StgToJSConfig {
  - csInlinePush :: !Bool
  - csInlineBlackhole :: !Bool
  - csInlineLoadRegs :: !Bool
  - csInlineEnter :: !Bool
  - csInlineAlloc :: !Bool
  - csTraceRts :: !Bool
  - csAssertRts :: !Bool
  - csBoundsCheck :: !Bool
  - csDebugAlloc :: !Bool
  - csTraceForeign :: !Bool
  - csProf :: !Bool
  - csRuntimeAssert :: !Bool
  - csContext :: !SDocContext
  }
- data ClosureInfo = ClosureInfo {
  - ciVar :: Ident
  - ciRegs :: CIRegs
  - ciName :: FastString
  - ciLayout :: CILayout
  - ciType :: CIType
  - ciStatic :: CIStatic
  }
- data CIRegs
  - = CIRegsUnknown
  - | CIRegs {
    - ciRegsSkip :: Int
    - ciRegsTypes :: [VarType]
    }
- data CILayout
  - = CILayoutVariable
  - | CILayoutUnknown {
    - layoutSize :: !Int
    }
  - | CILayoutFixed {
    - layoutSize :: !Int
    - layout :: [VarType]
    }
- data CIType
  - = CIFun {
    - citArity :: !Int
    - citRegs :: !Int
    }
  - | CIThunk
  - | CICon {
    - citConstructor :: !Int
    }
  - | CIPap
  - | CIBlackhole
  - | CIStackFrame
- newtype CIStatic = CIStaticRefs {
  - staticRefs :: [FastString]
  }
- data VarType
  - = PtrV
  - | VoidV
  - | DoubleV
  - | IntV
  - | LongV
  - | AddrV
  - | RtsObjV
  - | ObjV
  - | ArrV
- data IdType
  - = IdPlain
  - | IdEntry
  - | IdConEntry
- data IdKey = IdKey !Int !Int !IdType
- data OtherSymb = OtherSymb !Module !FastString
- newtype IdCache = IdCache (Map IdKey Ident)
- newtype GlobalIdCache = GlobalIdCache (UniqFM Ident (IdKey, Id))
- data StackSlot
  - = SlotId !Id !Int
  - | SlotUnknown
- data StaticInfo = StaticInfo {
  - siVar :: !FastString
  - siVal :: !StaticVal
  - siCC :: !(Maybe Ident)
  }
- data StaticVal
  - = StaticFun !FastString [StaticArg]
  - | StaticThunk !(Maybe (FastString, [StaticArg]))
  - | StaticUnboxed !StaticUnboxed
  - | StaticData !FastString [StaticArg]
  - | StaticList [StaticArg] (Maybe FastString)
- data StaticUnboxed
  - = StaticUnboxedBool !Bool
  - | StaticUnboxedInt !Integer
  - | StaticUnboxedDouble !SaneDouble
  - | StaticUnboxedString !ByteString
  - | StaticUnboxedStringOffset !ByteString
- data StaticArg
  - = StaticObjArg !FastString
  - | StaticLitArg !StaticLit
  - | StaticConArg !FastString [StaticArg]
- data StaticLit
  - = BoolLit !Bool
  - | IntLit !Integer
  - | NullLit
  - | DoubleLit !SaneDouble
  - | StringLit !FastString
  - | BinLit !ByteString
  - | LabelLit !Bool !FastString
- data ForeignJSRef = ForeignJSRef {
  - foreignRefSrcSpan :: !FastString
  - foreignRefPattern :: !FastString
  - foreignRefSafety :: !Safety
  - foreignRefCConv :: !CCallConv
  - foreignRefArgs :: ![FastString]
  - foreignRefResult :: !FastString
  }
- data LinkableUnit = LinkableUnit {
  - luObjUnit :: ObjUnit
  - luIdExports :: [Id]
  - luOtherExports :: [FastString]
  - luIdDeps :: [Id]
  - luPseudoIdDeps :: [Unique]
  - luOtherDeps :: [OtherSymb]
  - luRequired :: Bool
  - luForeignRefs :: [ForeignJSRef]
  }
- data ObjUnit = ObjUnit {
  - oiSymbols :: ![FastString]
  - oiClInfo :: ![ClosureInfo]
  - oiStatic :: ![StaticInfo]
  - oiStat :: JStat
  - oiRaw :: !ByteString
  - oiFExports :: ![ExpFun]
  - oiFImports :: ![ForeignJSRef]
  }
- data ExpFun = ExpFun {
  - isIO :: !Bool
  - args :: [JSFFIType]
  - result :: !JSFFIType
  }
- data JSFFIType
  - = Int8Type
  - | Int16Type
  - | Int32Type
  - | Int64Type
  - | Word8Type
  - | Word16Type
  - | Word32Type
  - | Word64Type
  - | DoubleType
  - | ByteArrayType
  - | PtrType
  - | RefType
- data TypedExpr = TypedExpr {
  - typex_typ :: !PrimRep
  - typex_expr :: [JExpr]
  }
- data PrimRes
  - = PrimInline JStat
  - | PRPrimCall JStat
- data ExprResult
  - = ExprCont
  - | ExprInline (Maybe [JExpr])
- newtype ExprValData = ExprValData [JExpr]
- data ClosureType
  - = Thunk
  - | Fun
  - | Pap
  - | Con
  - | Blackhole
  - | StackFrame
- ctNum :: ClosureType -> Int
- ctJsName :: ClosureType -> String
- data ThreadStatus
  - = Running
  - | Blocked
  - | Finished
  - | Died
- threadStatusNum :: ThreadStatus -> Int
- threadStatusJsName :: ThreadStatus -> String

# Documentation

type G = StateT GenState IO Source #

A State monad over IO holding the generator state.

data GenState Source #

The JS code generator state

Constructors

GenState |

Fields

- gsSettings :: !StgToJSConfig

  codegen settings, read-only

- gsModule :: !Module

  current module

- gsId :: !FastMutInt

  unique number for the id generator

- gsIdents :: !IdCache

  hash consing for identifiers from a Unique

- gsUnfloated :: !(UniqFM Id CgStgExpr)

  unfloated arguments

- gsGroup :: GenGroupState

  state for the current binding group

- gsGlobal :: [JStat]

  global (per module) statements (gets included when anything else from the module is used)

data GenGroupState Source #

The JS code generator state relevant for the current binding group

Constructors

GenGroupState |

Fields

- ggsToplevelStats :: [JStat]

  extra toplevel statements for the binding group

- ggsClosureInfo :: [ClosureInfo]

  closure metadata (info tables) for the binding group

- ggsStatic :: [StaticInfo]

  static (CAF) data in our binding group

- ggsStack :: [StackSlot]

  stack info for the current expression

- ggsStackDepth :: Int

  current stack depth

- ggsExtraDeps :: Set OtherSymb

  extra dependencies for the linkable unit that contains this group

- ggsGlobalIdCache :: GlobalIdCache
- ggsForeignRefs :: [ForeignJSRef]

data StgToJSConfig Source #

The Configuration record for the StgToJS pass

Constructors

StgToJSConfig |

Fields

- csInlinePush :: !Bool
- csInlineBlackhole :: !Bool
- csInlineLoadRegs :: !Bool
- csInlineEnter :: !Bool
- csInlineAlloc :: !Bool
- csTraceRts :: !Bool
- csAssertRts :: !Bool
- csBoundsCheck :: !Bool
- csDebugAlloc :: !Bool
- csTraceForeign :: !Bool
- csProf :: !Bool

  Profiling enabled

- csRuntimeAssert :: !Bool

  Enable runtime assertions settings

- csContext :: !SDocContext

data ClosureInfo Source #

Information relevenat to code generation for closures.

Constructors

ClosureInfo |

Fields

- ciVar :: Ident

  object being infod

- ciRegs :: CIRegs

  size of the payload (in number of JS values)

- ciName :: FastString

  friendly name for printing

- ciLayout :: CILayout

  heap/stack layout of the object

- ciType :: CIType

  type of the object, with extra info where required

- ciStatic :: CIStatic

  static references of this object

#### Instances

Instances details

Generic ClosureInfo Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep ClosureInfo :: Type -> Type Source # Methods from :: ClosureInfo -> Rep ClosureInfo x Source # to :: Rep ClosureInfo x -> ClosureInfo Source #
Show ClosureInfo Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> ClosureInfo -> ShowS Source # show :: ClosureInfo -> String Source # showList :: [ClosureInfo] -> ShowS Source #
Binary ClosureInfo Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> ClosureInfo -> IO () Source # put :: BinHandle -> ClosureInfo -> IO (Bin ClosureInfo) Source # get :: BinHandle -> IO ClosureInfo Source #
Eq ClosureInfo Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ClosureInfo -> ClosureInfo -> Bool # (/=) :: ClosureInfo -> ClosureInfo -> Bool #
type Rep ClosureInfo Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep ClosureInfo = D1 ('MetaData "ClosureInfo" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "ClosureInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ciVar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: (S1 ('MetaSel ('Just "ciRegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CIRegs) :*: S1 ('MetaSel ('Just "ciName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FastString))) :*: (S1 ('MetaSel ('Just "ciLayout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CILayout) :*: (S1 ('MetaSel ('Just "ciType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CIType) :*: S1 ('MetaSel ('Just "ciStatic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CIStatic)))))

data CIRegs Source #

Closure information, `ClosureInfo`, registers

Constructors

CIRegsUnknown | A value witnessing a state of unknown registers
CIRegs |

Fields

- ciRegsSkip :: Int

  unused registers before actual args start

- ciRegsTypes :: [VarType]

  args

#### Instances

Instances details

Generic CIRegs Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep CIRegs :: Type -> Type Source # Methods from :: CIRegs -> Rep CIRegs x Source # to :: Rep CIRegs x -> CIRegs Source #
Show CIRegs Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> CIRegs -> ShowS Source # show :: CIRegs -> String Source # showList :: [CIRegs] -> ShowS Source #
NFData CIRegs Source # |
Instance details Defined in GHC.StgToJS.Types Methods rnf :: CIRegs -> () Source #
Binary CIRegs Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> CIRegs -> IO () Source # put :: BinHandle -> CIRegs -> IO (Bin CIRegs) Source # get :: BinHandle -> IO CIRegs Source #
Eq CIRegs Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: CIRegs -> CIRegs -> Bool # (/=) :: CIRegs -> CIRegs -> Bool #
Ord CIRegs Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: CIRegs -> CIRegs -> Ordering # (<) :: CIRegs -> CIRegs -> Bool # (<=) :: CIRegs -> CIRegs -> Bool # (>) :: CIRegs -> CIRegs -> Bool # (>=) :: CIRegs -> CIRegs -> Bool # max :: CIRegs -> CIRegs -> CIRegs # min :: CIRegs -> CIRegs -> CIRegs #
type Rep CIRegs Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep CIRegs = D1 ('MetaData "CIRegs" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "CIRegsUnknown" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CIRegs" 'PrefixI 'True) (S1 ('MetaSel ('Just "ciRegsSkip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "ciRegsTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [VarType])))

data CILayout Source #

Closure Information, `ClosureInfo`, layout

Constructors

CILayoutVariable | layout stored in object itself, first position from the start
CILayoutUnknown | fixed size, but content unknown (for example stack apply frame)

Fields

- layoutSize :: !Int

  closure size in array positions, including entry

CILayoutFixed | whole layout known

Fields

- layoutSize :: !Int

  closure size in array positions, including entry

- layout :: [VarType]

  The set of sized Types to layout

#### Instances

Instances details

Generic CILayout Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep CILayout :: Type -> Type Source # Methods from :: CILayout -> Rep CILayout x Source # to :: Rep CILayout x -> CILayout Source #
Show CILayout Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> CILayout -> ShowS Source # show :: CILayout -> String Source # showList :: [CILayout] -> ShowS Source #
NFData CILayout Source # |
Instance details Defined in GHC.StgToJS.Types Methods rnf :: CILayout -> () Source #
Binary CILayout Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> CILayout -> IO () Source # put :: BinHandle -> CILayout -> IO (Bin CILayout) Source # get :: BinHandle -> IO CILayout Source #
Eq CILayout Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: CILayout -> CILayout -> Bool # (/=) :: CILayout -> CILayout -> Bool #
Ord CILayout Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: CILayout -> CILayout -> Ordering # (<) :: CILayout -> CILayout -> Bool # (<=) :: CILayout -> CILayout -> Bool # (>) :: CILayout -> CILayout -> Bool # (>=) :: CILayout -> CILayout -> Bool # max :: CILayout -> CILayout -> CILayout # min :: CILayout -> CILayout -> CILayout #
type Rep CILayout Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep CILayout = D1 ('MetaData "CILayout" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "CILayoutVariable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CILayoutUnknown" 'PrefixI 'True) (S1 ('MetaSel ('Just "layoutSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "CILayoutFixed" 'PrefixI 'True) (S1 ('MetaSel ('Just "layoutSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "layout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [VarType]))))

data CIType Source #

The type of `ClosureInfo`

Constructors

CIFun |

Fields

- citArity :: !Int

  function arity

- citRegs :: !Int

  number of registers for the args

CIThunk | The closure is a THUNK
CICon | The closure is a Constructor

Fields

- citConstructor :: !Int

CIPap | The closure is a Partial Application
CIBlackhole | The closure is a black hole
CIStackFrame | The closure is a stack frame

#### Instances

Instances details

Generic CIType Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep CIType :: Type -> Type Source # Methods from :: CIType -> Rep CIType x Source # to :: Rep CIType x -> CIType Source #
Show CIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> CIType -> ShowS Source # show :: CIType -> String Source # showList :: [CIType] -> ShowS Source #
NFData CIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods rnf :: CIType -> () Source #
Binary CIType Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> CIType -> IO () Source # put :: BinHandle -> CIType -> IO (Bin CIType) Source # get :: BinHandle -> IO CIType Source #
Eq CIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: CIType -> CIType -> Bool # (/=) :: CIType -> CIType -> Bool #
Ord CIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: CIType -> CIType -> Ordering # (<) :: CIType -> CIType -> Bool # (<=) :: CIType -> CIType -> Bool # (>) :: CIType -> CIType -> Bool # (>=) :: CIType -> CIType -> Bool # max :: CIType -> CIType -> CIType # min :: CIType -> CIType -> CIType #
type Rep CIType Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep CIType = D1 ('MetaData "CIType" "GHC.StgToJS.Types" "ghc" 'False) ((C1 ('MetaCons "CIFun" 'PrefixI 'True) (S1 ('MetaSel ('Just "citArity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "citRegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "CIThunk" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CICon" 'PrefixI 'True) (S1 ('MetaSel ('Just "citConstructor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) :+: (C1 ('MetaCons "CIPap" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CIBlackhole" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CIStackFrame" 'PrefixI 'False) (U1 :: Type -> Type))))

newtype CIStatic Source #

Static references that must be kept alive

Constructors

CIStaticRefs |

Fields

- staticRefs :: [FastString]

#### Instances

Instances details

Monoid CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types Methods mempty :: CIStatic Source # mappend :: CIStatic -> CIStatic -> CIStatic Source # mconcat :: [CIStatic] -> CIStatic Source #
Semigroup CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types Methods (<>) :: CIStatic -> CIStatic -> CIStatic Source # sconcat :: NonEmpty CIStatic -> CIStatic Source # stimes :: Integral b => b -> CIStatic -> CIStatic Source #
Generic CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep CIStatic :: Type -> Type Source # Methods from :: CIStatic -> Rep CIStatic x Source # to :: Rep CIStatic x -> CIStatic Source #
Show CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> CIStatic -> ShowS Source # show :: CIStatic -> String Source # showList :: [CIStatic] -> ShowS Source #
ToJExpr CIStatic Source # | static refs: array = references, null = nothing to report note: only works after all top-level objects have been created
Instance details Defined in GHC.StgToJS.Types Methods toJExpr :: CIStatic -> JExpr Source # toJExprFromList :: [CIStatic] -> JExpr Source #
Binary CIStatic Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> CIStatic -> IO () Source # put :: BinHandle -> CIStatic -> IO (Bin CIStatic) Source # get :: BinHandle -> IO CIStatic Source #
Eq CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: CIStatic -> CIStatic -> Bool # (/=) :: CIStatic -> CIStatic -> Bool #
type Rep CIStatic Source # |
Instance details Defined in GHC.StgToJS.Types type Rep CIStatic = D1 ('MetaData "CIStatic" "GHC.StgToJS.Types" "ghc" 'True) (C1 ('MetaCons "CIStaticRefs" 'PrefixI 'True) (S1 ('MetaSel ('Just "staticRefs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FastString])))

data VarType Source #

Free variable types

Constructors

PtrV | pointer = reference to heap object (closure object)
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
RtsObjV | some RTS object from GHCJS (for example TVar#, MVar#, MutVar#, Weak#)
ObjV | some JS object, user supplied, be careful around these, can be anything
ArrV | boxed array

#### Instances

Instances details

Bounded VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods minBound :: VarType Source # maxBound :: VarType Source #
Enum VarType Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

succ :: VarType -> VarType Source #

pred :: VarType -> VarType Source #

toEnum :: Int -> VarType Source #

fromEnum :: VarType -> Int Source #

enumFrom :: VarType -> [VarType] Source #

enumFromThen :: VarType -> VarType -> [VarType] Source #

enumFromTo :: VarType -> VarType -> [VarType] Source #

enumFromThenTo :: VarType -> VarType -> VarType -> [VarType] Source #

Generic VarType Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep VarType :: Type -> Type Source # Methods from :: VarType -> Rep VarType x Source # to :: Rep VarType x -> VarType Source #
Show VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> VarType -> ShowS Source # show :: VarType -> String Source # showList :: [VarType] -> ShowS Source #
NFData VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods rnf :: VarType -> () Source #
ToJExpr VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods toJExpr :: VarType -> JExpr Source # toJExprFromList :: [VarType] -> JExpr Source #
Binary VarType Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> VarType -> IO () Source # put :: BinHandle -> VarType -> IO (Bin VarType) Source # get :: BinHandle -> IO VarType Source #
Eq VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: VarType -> VarType -> Bool # (/=) :: VarType -> VarType -> Bool #
Ord VarType Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: VarType -> VarType -> Ordering # (<) :: VarType -> VarType -> Bool # (<=) :: VarType -> VarType -> Bool # (>) :: VarType -> VarType -> Bool # (>=) :: VarType -> VarType -> Bool # max :: VarType -> VarType -> VarType # min :: VarType -> VarType -> VarType #
type Rep VarType Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep VarType = D1 ('MetaData "VarType" "GHC.StgToJS.Types" "ghc" 'False) (((C1 ('MetaCons "PtrV" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VoidV" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DoubleV" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IntV" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "LongV" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AddrV" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RtsObjV" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ObjV" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ArrV" 'PrefixI 'False) (U1 :: Type -> Type)))))

data IdType Source #

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$baseZCGHCziMaybeziJust_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$baseZCGHCziMaybeziJust_e() { var h$$baseZCGHCziMaybezieta_8KXnScrCjF5 = h$r2; h$r1 = h$c1(h$baseZCGHCziMaybeziJust_con_e, h$$baseZCGHCziMaybezieta_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

IdPlain | A plain identifier for values, no suffix added
IdEntry | An entry function, suffix = "_e" in `makeIdentForId`
IdConEntry | A Constructor entry function, suffix = "_con_e" in `makeIdentForId`

#### Instances

Instances details

Enum IdType Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

succ :: IdType -> IdType Source #

pred :: IdType -> IdType Source #

toEnum :: Int -> IdType Source #

fromEnum :: IdType -> Int Source #

enumFrom :: IdType -> [IdType] Source #

enumFromThen :: IdType -> IdType -> [IdType] Source #

enumFromTo :: IdType -> IdType -> [IdType] Source #

enumFromThenTo :: IdType -> IdType -> IdType -> [IdType] Source #

Eq IdType Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: IdType -> IdType -> Bool # (/=) :: IdType -> IdType -> Bool #
Ord IdType Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: IdType -> IdType -> Ordering # (<) :: IdType -> IdType -> Bool # (<=) :: IdType -> IdType -> Bool # (>) :: IdType -> IdType -> Bool # (>=) :: IdType -> IdType -> Bool # max :: IdType -> IdType -> IdType # min :: IdType -> IdType -> IdType #

data IdKey Source #

Keys to differentiate Ident's in the ID Cache

Constructors

IdKey !Int !Int !IdType |

#### Instances

Instances details

Eq IdKey Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: IdKey -> IdKey -> Bool # (/=) :: IdKey -> IdKey -> Bool #
Ord IdKey Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: IdKey -> IdKey -> Ordering # (<) :: IdKey -> IdKey -> Bool # (<=) :: IdKey -> IdKey -> Bool # (>) :: IdKey -> IdKey -> Bool # (>=) :: IdKey -> IdKey -> Bool # max :: IdKey -> IdKey -> IdKey # min :: IdKey -> IdKey -> IdKey #

data OtherSymb Source #

Some other symbol

Constructors

OtherSymb !Module !FastString |

#### Instances

Instances details

Eq OtherSymb Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: OtherSymb -> OtherSymb -> Bool # (/=) :: OtherSymb -> OtherSymb -> Bool #
Ord OtherSymb Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: OtherSymb -> OtherSymb -> Ordering # (<) :: OtherSymb -> OtherSymb -> Bool # (<=) :: OtherSymb -> OtherSymb -> Bool # (>) :: OtherSymb -> OtherSymb -> Bool # (>=) :: OtherSymb -> OtherSymb -> Bool # max :: OtherSymb -> OtherSymb -> OtherSymb # min :: OtherSymb -> OtherSymb -> OtherSymb #

newtype IdCache Source #

The identifier cache indexed on `IdKey` local to a module

Constructors

IdCache (Map IdKey Ident) |

newtype GlobalIdCache Source #

The global Identifier Cache

Constructors

GlobalIdCache (UniqFM Ident (IdKey, Id)) |

data StackSlot Source #

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

Constructors

SlotId !Id !Int |
SlotUnknown |

#### Instances

Instances details

Eq StackSlot Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StackSlot -> StackSlot -> Bool # (/=) :: StackSlot -> StackSlot -> Bool #
Ord StackSlot Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: StackSlot -> StackSlot -> Ordering # (<) :: StackSlot -> StackSlot -> Bool # (<=) :: StackSlot -> StackSlot -> Bool # (>) :: StackSlot -> StackSlot -> Bool # (>=) :: StackSlot -> StackSlot -> Bool # max :: StackSlot -> StackSlot -> StackSlot # min :: StackSlot -> StackSlot -> StackSlot #

data StaticInfo Source #

Constructors

StaticInfo |

Fields

- siVar :: !FastString

  global object

- siVal :: !StaticVal

  static initialization

- siCC :: !(Maybe Ident)

  optional CCS name

#### Instances

Instances details

Generic StaticInfo Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep StaticInfo :: Type -> Type Source # Methods from :: StaticInfo -> Rep StaticInfo x Source # to :: Rep StaticInfo x -> StaticInfo Source #
Show StaticInfo Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> StaticInfo -> ShowS Source # show :: StaticInfo -> String Source # showList :: [StaticInfo] -> ShowS Source #
Binary StaticInfo Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> StaticInfo -> IO () Source # put :: BinHandle -> StaticInfo -> IO (Bin StaticInfo) Source # get :: BinHandle -> IO StaticInfo Source #
Eq StaticInfo Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StaticInfo -> StaticInfo -> Bool # (/=) :: StaticInfo -> StaticInfo -> Bool #
type Rep StaticInfo Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep StaticInfo = D1 ('MetaData "StaticInfo" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "StaticInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "siVar") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: (S1 ('MetaSel ('Just "siVal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StaticVal) :*: S1 ('MetaSel ('Just "siCC") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Ident)))))

data StaticVal Source #

Constructors

StaticFun !FastString [StaticArg] | heap object for function
StaticThunk !(Maybe (FastString, [StaticArg])) | heap object for CAF (field is Nothing when thunk is initialized in an alternative way, like string thunks through h$str)
StaticUnboxed !StaticUnboxed | unboxed constructor (Bool, Int, Double etc)
StaticData !FastString [StaticArg] | regular datacon app
StaticList [StaticArg] (Maybe FastString) | list initializer (with optional tail)

#### Instances

Instances details

Generic StaticVal Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep StaticVal :: Type -> Type Source # Methods from :: StaticVal -> Rep StaticVal x Source # to :: Rep StaticVal x -> StaticVal Source #
Show StaticVal Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> StaticVal -> ShowS Source # show :: StaticVal -> String Source # showList :: [StaticVal] -> ShowS Source #
Binary StaticVal Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> StaticVal -> IO () Source # put :: BinHandle -> StaticVal -> IO (Bin StaticVal) Source # get :: BinHandle -> IO StaticVal Source #
Eq StaticVal Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StaticVal -> StaticVal -> Bool # (/=) :: StaticVal -> StaticVal -> Bool #
type Rep StaticVal Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep StaticVal = D1 ('MetaData "StaticVal" "GHC.StgToJS.Types" "ghc" 'False) ((C1 ('MetaCons "StaticFun" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [StaticArg])) :+: C1 ('MetaCons "StaticThunk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe (FastString, [StaticArg]))))) :+: (C1 ('MetaCons "StaticUnboxed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StaticUnboxed)) :+: (C1 ('MetaCons "StaticData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [StaticArg])) :+: C1 ('MetaCons "StaticList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [StaticArg]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FastString))))))

data StaticUnboxed Source #

Constructors

StaticUnboxedBool !Bool |
StaticUnboxedInt !Integer |
StaticUnboxedDouble !SaneDouble |
StaticUnboxedString !ByteString |
StaticUnboxedStringOffset !ByteString |

#### Instances

Instances details

Generic StaticUnboxed Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep StaticUnboxed :: Type -> Type Source # Methods from :: StaticUnboxed -> Rep StaticUnboxed x Source # to :: Rep StaticUnboxed x -> StaticUnboxed Source #
Show StaticUnboxed Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> StaticUnboxed -> ShowS Source # show :: StaticUnboxed -> String Source # showList :: [StaticUnboxed] -> ShowS Source #
NFData StaticUnboxed Source # |
Instance details Defined in GHC.StgToJS.Types Methods rnf :: StaticUnboxed -> () Source #
Binary StaticUnboxed Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> StaticUnboxed -> IO () Source # put :: BinHandle -> StaticUnboxed -> IO (Bin StaticUnboxed) Source # get :: BinHandle -> IO StaticUnboxed Source #
Eq StaticUnboxed Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StaticUnboxed -> StaticUnboxed -> Bool # (/=) :: StaticUnboxed -> StaticUnboxed -> Bool #
Ord StaticUnboxed Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

compare :: StaticUnboxed -> StaticUnboxed -> Ordering #

(<) :: StaticUnboxed -> StaticUnboxed -> Bool #

(<=) :: StaticUnboxed -> StaticUnboxed -> Bool #

(>) :: StaticUnboxed -> StaticUnboxed -> Bool #

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

max :: StaticUnboxed -> StaticUnboxed -> StaticUnboxed #

min :: StaticUnboxed -> StaticUnboxed -> StaticUnboxed #

type Rep StaticUnboxed Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep StaticUnboxed = D1 ('MetaData "StaticUnboxed" "GHC.StgToJS.Types" "ghc" 'False) ((C1 ('MetaCons "StaticUnboxedBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: C1 ('MetaCons "StaticUnboxedInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer))) :+: (C1 ('MetaCons "StaticUnboxedDouble" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SaneDouble)) :+: (C1 ('MetaCons "StaticUnboxedString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString)) :+: C1 ('MetaCons "StaticUnboxedStringOffset" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString)))))

data StaticArg Source #

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

StaticObjArg !FastString | reference to a heap object
StaticLitArg !StaticLit | literal
StaticConArg !FastString [StaticArg] | unfloated constructor

#### Instances

Instances details

Generic StaticArg Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep StaticArg :: Type -> Type Source # Methods from :: StaticArg -> Rep StaticArg x Source # to :: Rep StaticArg x -> StaticArg Source #
Show StaticArg Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> StaticArg -> ShowS Source # show :: StaticArg -> String Source # showList :: [StaticArg] -> ShowS Source #
Binary StaticArg Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> StaticArg -> IO () Source # put :: BinHandle -> StaticArg -> IO (Bin StaticArg) Source # get :: BinHandle -> IO StaticArg Source #
Outputable StaticArg Source # |
Instance details Defined in GHC.StgToJS.Types Methods ppr :: StaticArg -> SDoc Source #
Eq StaticArg Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StaticArg -> StaticArg -> Bool # (/=) :: StaticArg -> StaticArg -> Bool #
type Rep StaticArg Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep StaticArg = D1 ('MetaData "StaticArg" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "StaticObjArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString)) :+: (C1 ('MetaCons "StaticLitArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StaticLit)) :+: C1 ('MetaCons "StaticConArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [StaticArg]))))

data StaticLit Source #

A Static literal value

Constructors

BoolLit !Bool |
IntLit !Integer |
NullLit |
DoubleLit !SaneDouble |
StringLit !FastString |
BinLit !ByteString |
LabelLit !Bool !FastString | is function pointer, label (also used for string / binary init)

#### Instances

Instances details

Generic StaticLit Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep StaticLit :: Type -> Type Source # Methods from :: StaticLit -> Rep StaticLit x Source # to :: Rep StaticLit x -> StaticLit Source #
Show StaticLit Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> StaticLit -> ShowS Source # show :: StaticLit -> String Source # showList :: [StaticLit] -> ShowS Source #
ToJExpr StaticLit Source # |
Instance details Defined in GHC.StgToJS.Types Methods toJExpr :: StaticLit -> JExpr Source # toJExprFromList :: [StaticLit] -> JExpr Source #
Binary StaticLit Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> StaticLit -> IO () Source # put :: BinHandle -> StaticLit -> IO (Bin StaticLit) Source # get :: BinHandle -> IO StaticLit Source #
Outputable StaticLit Source # |
Instance details Defined in GHC.StgToJS.Types Methods ppr :: StaticLit -> SDoc Source #
Eq StaticLit Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: StaticLit -> StaticLit -> Bool # (/=) :: StaticLit -> StaticLit -> Bool #
type Rep StaticLit Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep StaticLit = D1 ('MetaData "StaticLit" "GHC.StgToJS.Types" "ghc" 'False) ((C1 ('MetaCons "BoolLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :+: (C1 ('MetaCons "IntLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)) :+: C1 ('MetaCons "NullLit" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DoubleLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SaneDouble)) :+: C1 ('MetaCons "StringLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString))) :+: (C1 ('MetaCons "BinLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString)) :+: C1 ('MetaCons "LabelLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString)))))

data ForeignJSRef Source #

A foreign reference to some JS code

Constructors

ForeignJSRef |

Fields

- foreignRefSrcSpan :: !FastString
- foreignRefPattern :: !FastString
- foreignRefSafety :: !Safety
- foreignRefCConv :: !CCallConv
- foreignRefArgs :: ![FastString]
- foreignRefResult :: !FastString

#### Instances

Instances details

Generic ForeignJSRef Source # |
Instance details Defined in GHC.StgToJS.Types Associated Types type Rep ForeignJSRef :: Type -> Type Source # Methods from :: ForeignJSRef -> Rep ForeignJSRef x Source # to :: Rep ForeignJSRef x -> ForeignJSRef Source #
Binary ForeignJSRef Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> ForeignJSRef -> IO () Source # put :: BinHandle -> ForeignJSRef -> IO (Bin ForeignJSRef) Source # get :: BinHandle -> IO ForeignJSRef Source #
type Rep ForeignJSRef Source # |

Instance details

Defined in GHC.StgToJS.Types

type Rep ForeignJSRef = D1 ('MetaData "ForeignJSRef" "GHC.StgToJS.Types" "ghc" 'False) (C1 ('MetaCons "ForeignJSRef" 'PrefixI 'True) ((S1 ('MetaSel ('Just "foreignRefSrcSpan") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: (S1 ('MetaSel ('Just "foreignRefPattern") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString) :*: S1 ('MetaSel ('Just "foreignRefSafety") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Safety))) :*: (S1 ('MetaSel ('Just "foreignRefCConv") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CCallConv) :*: (S1 ('MetaSel ('Just "foreignRefArgs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [FastString]) :*: S1 ('MetaSel ('Just "foreignRefResult") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FastString)))))

data LinkableUnit Source #

data used to generate one ObjUnit in our object file

Constructors

LinkableUnit |

Fields

- luObjUnit :: ObjUnit

  serializable unit info

- luIdExports :: [Id]

  exported names from haskell identifiers

- luOtherExports :: [FastString]

  other exports

- luIdDeps :: [Id]

  identifiers this unit depends on

- luPseudoIdDeps :: [Unique]

  pseudo-id identifiers this unit depends on (fixme)

- luOtherDeps :: [OtherSymb]

  symbols not from a haskell id that this unit depends on

- luRequired :: Bool

  always link this unit

- luForeignRefs :: [ForeignJSRef]

data ObjUnit Source #

one toplevel block in the object file

Constructors

ObjUnit |

Fields

- oiSymbols :: ![FastString]

  toplevel symbols (stored in index)

- oiClInfo :: ![ClosureInfo]

  closure information of all closures in block

- oiStatic :: ![StaticInfo]

  static closure data

- oiStat :: JStat

  the code

- oiRaw :: !ByteString

  raw JS code

- oiFExports :: ![ExpFun]
- oiFImports :: ![ForeignJSRef]

data ExpFun Source #

Constructors

ExpFun |

Fields

- isIO :: !Bool
- args :: [JSFFIType]
- result :: !JSFFIType

#### Instances

Instances details

Show ExpFun Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> ExpFun -> ShowS Source # show :: ExpFun -> String Source # showList :: [ExpFun] -> ShowS Source #
Binary ExpFun Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> ExpFun -> IO () Source # put :: BinHandle -> ExpFun -> IO (Bin ExpFun) Source # get :: BinHandle -> IO ExpFun Source #
Eq ExpFun Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ExpFun -> ExpFun -> Bool # (/=) :: ExpFun -> ExpFun -> Bool #
Ord ExpFun Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: ExpFun -> ExpFun -> Ordering # (<) :: ExpFun -> ExpFun -> Bool # (<=) :: ExpFun -> ExpFun -> Bool # (>) :: ExpFun -> ExpFun -> Bool # (>=) :: ExpFun -> ExpFun -> Bool # max :: ExpFun -> ExpFun -> ExpFun # min :: ExpFun -> ExpFun -> ExpFun #

data JSFFIType Source #

Types of FFI values

Constructors

Int8Type |
Int16Type |
Int32Type |
Int64Type |
Word8Type |
Word16Type |
Word32Type |
Word64Type |
DoubleType |
ByteArrayType |
PtrType |
RefType |

#### Instances

Instances details

Enum JSFFIType Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

succ :: JSFFIType -> JSFFIType Source #

pred :: JSFFIType -> JSFFIType Source #

toEnum :: Int -> JSFFIType Source #

fromEnum :: JSFFIType -> Int Source #

enumFrom :: JSFFIType -> [JSFFIType] Source #

enumFromThen :: JSFFIType -> JSFFIType -> [JSFFIType] Source #

enumFromTo :: JSFFIType -> JSFFIType -> [JSFFIType] Source #

enumFromThenTo :: JSFFIType -> JSFFIType -> JSFFIType -> [JSFFIType] Source #

Show JSFFIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> JSFFIType -> ShowS Source # show :: JSFFIType -> String Source # showList :: [JSFFIType] -> ShowS Source #
Binary JSFFIType Source # |
Instance details Defined in GHC.StgToJS.Object Methods put_ :: BinHandle -> JSFFIType -> IO () Source # put :: BinHandle -> JSFFIType -> IO (Bin JSFFIType) Source # get :: BinHandle -> IO JSFFIType Source #
Eq JSFFIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: JSFFIType -> JSFFIType -> Bool # (/=) :: JSFFIType -> JSFFIType -> Bool #
Ord JSFFIType Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: JSFFIType -> JSFFIType -> Ordering # (<) :: JSFFIType -> JSFFIType -> Bool # (<=) :: JSFFIType -> JSFFIType -> Bool # (>) :: JSFFIType -> JSFFIType -> Bool # (>=) :: JSFFIType -> JSFFIType -> Bool # max :: JSFFIType -> JSFFIType -> JSFFIType # min :: JSFFIType -> JSFFIType -> JSFFIType #

data TypedExpr Source #

Typed expression

Constructors

TypedExpr |

Fields

- typex_typ :: !PrimRep
- typex_expr :: [JExpr]

#### Instances

Instances details

Outputable TypedExpr Source # |
Instance details Defined in GHC.StgToJS.Types Methods ppr :: TypedExpr -> SDoc Source #

data PrimRes Source #

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 JStat | primop is inline, result is assigned directly
PRPrimCall JStat | primop is async call, primop returns the next function to run. result returned to stack top in registers

data ExprResult Source #

Constructors

ExprCont |
ExprInline (Maybe [JExpr]) |

#### Instances

Instances details

Eq ExprResult Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ExprResult -> ExprResult -> Bool # (/=) :: ExprResult -> ExprResult -> Bool #

newtype ExprValData Source #

Constructors

ExprValData [JExpr] |

#### Instances

Instances details

Eq ExprValData Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ExprValData -> ExprValData -> Bool # (/=) :: ExprValData -> ExprValData -> Bool #

data ClosureType Source #

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

#### Instances

Instances details

Bounded ClosureType Source # |
Instance details Defined in GHC.StgToJS.Types Methods minBound :: ClosureType Source # maxBound :: ClosureType Source #
Enum ClosureType Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

succ :: ClosureType -> ClosureType Source #

pred :: ClosureType -> ClosureType Source #

toEnum :: Int -> ClosureType Source #

fromEnum :: ClosureType -> Int Source #

enumFrom :: ClosureType -> [ClosureType] Source #

enumFromThen :: ClosureType -> ClosureType -> [ClosureType] Source #

enumFromTo :: ClosureType -> ClosureType -> [ClosureType] Source #

enumFromThenTo :: ClosureType -> ClosureType -> ClosureType -> [ClosureType] Source #

Show ClosureType Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> ClosureType -> ShowS Source # show :: ClosureType -> String Source # showList :: [ClosureType] -> ShowS Source #
ToJExpr ClosureType Source # |
Instance details Defined in GHC.StgToJS.Types Methods toJExpr :: ClosureType -> JExpr Source # toJExprFromList :: [ClosureType] -> JExpr Source #
Eq ClosureType Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ClosureType -> ClosureType -> Bool # (/=) :: ClosureType -> ClosureType -> Bool #
Ord ClosureType Source # |
Instance details Defined in GHC.StgToJS.Types Methods compare :: ClosureType -> ClosureType -> Ordering # (<) :: ClosureType -> ClosureType -> Bool # (<=) :: ClosureType -> ClosureType -> Bool # (>) :: ClosureType -> ClosureType -> Bool # (>=) :: ClosureType -> ClosureType -> Bool # max :: ClosureType -> ClosureType -> ClosureType # min :: ClosureType -> ClosureType -> ClosureType #

ctNum :: ClosureType -> Int Source #

Convert `ClosureType` to an Int

ctJsName :: ClosureType -> String Source #

Convert `ClosureType` to a String

data ThreadStatus Source #

A thread is in one of 4 states

Constructors

Running | The thread is running
Blocked | The thread is blocked
Finished | The thread is done
Died | The thread has died

#### Instances

Instances details

Bounded ThreadStatus Source # |
Instance details Defined in GHC.StgToJS.Types Methods minBound :: ThreadStatus Source # maxBound :: ThreadStatus Source #
Enum ThreadStatus Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

succ :: ThreadStatus -> ThreadStatus Source #

pred :: ThreadStatus -> ThreadStatus Source #

toEnum :: Int -> ThreadStatus Source #

fromEnum :: ThreadStatus -> Int Source #

enumFrom :: ThreadStatus -> [ThreadStatus] Source #

enumFromThen :: ThreadStatus -> ThreadStatus -> [ThreadStatus] Source #

enumFromTo :: ThreadStatus -> ThreadStatus -> [ThreadStatus] Source #

enumFromThenTo :: ThreadStatus -> ThreadStatus -> ThreadStatus -> [ThreadStatus] Source #

Show ThreadStatus Source # |
Instance details Defined in GHC.StgToJS.Types Methods showsPrec :: Int -> ThreadStatus -> ShowS Source # show :: ThreadStatus -> String Source # showList :: [ThreadStatus] -> ShowS Source #
Eq ThreadStatus Source # |
Instance details Defined in GHC.StgToJS.Types Methods (==) :: ThreadStatus -> ThreadStatus -> Bool # (/=) :: ThreadStatus -> ThreadStatus -> Bool #
Ord ThreadStatus Source # |

Instance details

Defined in GHC.StgToJS.Types

Methods

compare :: ThreadStatus -> ThreadStatus -> Ordering #

(<) :: ThreadStatus -> ThreadStatus -> Bool #

(<=) :: ThreadStatus -> ThreadStatus -> Bool #

(>) :: ThreadStatus -> ThreadStatus -> Bool #

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

max :: ThreadStatus -> ThreadStatus -> ThreadStatus #

min :: ThreadStatus -> ThreadStatus -> ThreadStatus #

threadStatusNum :: ThreadStatus -> Int Source #

Convert the status of a thread in JS land to an Int

threadStatusJsName :: ThreadStatus -> String Source #

convert the status of a thread in JS land to a string