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 Code generation of Expressions
Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.StgToJS.Expr

Description

Synopsis

- genExpr :: HasDebugCallStack => ExprCtx -> CgStgExpr -> G (JStat, ExprResult)
- genEntryType :: HasDebugCallStack => [Id] -> G CIType
- loadLiveFun :: [Id] -> G JStat
- genStaticRefsRhs :: CgStgRhs -> G CIStatic
- genStaticRefs :: LiveVars -> G CIStatic
- genBody :: HasDebugCallStack => ExprCtx -> Id -> StgReg -> [Id] -> CgStgExpr -> G JStat

# Documentation

genExpr :: HasDebugCallStack => ExprCtx -> CgStgExpr -> G (JStat, ExprResult) Source #

Evaluate an expression in the given expression context (continuation)

genEntryType :: HasDebugCallStack => [Id] -> G CIType Source #

Generate the entry function types for identifiers. Note that this only returns either `CIThunk` or `CIFun`. Everything else (PAP Blackhole etc.) is filtered as not a RuntimeRepKinded type.

loadLiveFun :: [Id] -> G JStat Source #

Given a set of `Id`s, bind each `Id` to the appropriate data fields in N registers. This assumes these data fields have already been populated in the registers. For the empty, singleton, and binary case use register 1, for any more use as many registers as necessary.

genStaticRefsRhs :: CgStgRhs -> G CIStatic Source #

genStaticRefs :: LiveVars -> G CIStatic Source #

genBody :: HasDebugCallStack => ExprCtx -> Id -> StgReg -> [Id] -> CgStgExpr -> G JStat Source #

Generate the body of an object