ghc-9.6.2: The GHC API
Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file LICENSE)
MaintainerJeffrey Young <> Luite Stegeman <> Sylvain Henry <> Josh Meredith <>
Safe HaskellSafe-Inferred



Types and utility functions used in the JS RTS.



traceRts :: StgToJSConfig -> JExpr -> JStat Source #

Syntactic sugar, i.e., a Haskell function which generates useful JS code. Given a JExpr, ex, inject a trace statement on ex in the compiled JS program

assertRts :: ToJExpr a => StgToJSConfig -> JExpr -> a -> JStat Source #

Syntactic sugar. Given a JExpr, ex which is assumed to be a predicate, and a message m, assert that 'not ex' is True, if not throw an exception in JS land with message m.

clName :: JExpr -> JExpr Source #

name of the closure c

clTypeName :: JExpr -> JExpr Source #

Type name of the closure c

stackFrameSize Source #


:: JExpr

assign frame size to this

-> JExpr

stack frame header function

-> JStat

size of the frame, including header

withRegs :: StgReg -> StgReg -> (StgReg -> JStat) -> JStat Source #

Perform the computation f, on the range of registers bounded by start and end.