| 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 | None |
| Language | GHC2021 |
GHC.StgToJS.ExprCtx
Contents
Description
Synopsis
- data ExprCtx
- initExprCtx :: Id -> ExprCtx
- ctxIsEvaluated :: Id -> Bool
- ctxSetSrcSpan :: RealSrcSpan -> ExprCtx -> ExprCtx
- ctxSrcSpan :: ExprCtx -> Maybe RealSrcSpan
- ctxSetTop :: Id -> ExprCtx -> ExprCtx
- ctxTarget :: ExprCtx -> [TypedExpr]
- ctxSetTarget :: [TypedExpr] -> ExprCtx -> ExprCtx
- ctxClearLneFrame :: ExprCtx -> ExprCtx
- ctxUpdateLneFrame :: [(Id, Int)] -> [Id] -> ExprCtx -> ExprCtx
- ctxLneFrameVars :: ExprCtx -> [(Id, Int)]
- ctxLneFrameSize :: ExprCtx -> Int
- ctxIsLneBinding :: ExprCtx -> Id -> Bool
- ctxIsLneLiveVar :: ExprCtx -> Id -> Bool
- ctxLneBindingStackSize :: ExprCtx -> Id -> Maybe Int
- ctxLneShrinkStack :: ExprCtx -> Int -> ExprCtx
Documentation
Context into which an expression is evaluated
Instances
| Outputable ExprCtx # | |
Defined in GHC.StgToJS.ExprCtx | |
initExprCtx :: Id -> ExprCtx #
Initialize an expression context in the context of the given top-level binding Id
ctxIsEvaluated :: Id -> Bool #
Predicate: do we know for sure that the given Id is evaluated?
ctxSetSrcSpan :: RealSrcSpan -> ExprCtx -> ExprCtx #
Set source location
ctxSrcSpan :: ExprCtx -> Maybe RealSrcSpan #
Source location
ctxSetTarget :: [TypedExpr] -> ExprCtx -> ExprCtx #
Set target
Let-no-escape
ctxClearLneFrame :: ExprCtx -> ExprCtx #
Remove information about the current LNE frame
ctxLneFrameVars :: ExprCtx -> [(Id, Int)] #
Contents of current LNE frame
Variables and their index on the stack
ctxLneFrameSize :: ExprCtx -> Int #
Cache the length of ctxLneFrameVars
ctxIsLneBinding :: ExprCtx -> Id -> Bool #
Does the given Id correspond to a LNE binding
ctxIsLneLiveVar :: ExprCtx -> Id -> Bool #
Does the given Id correspond to a LNE live var on the stack
ctxLneBindingStackSize :: ExprCtx -> Id -> Maybe Int #
Return the LNE stack size associated to the given Id. Return Nothing when the Id doesn't correspond to a LNE binding.
ctxLneShrinkStack :: ExprCtx -> Int -> ExprCtx #
Shrink the LNE stack to the given size