| Safe Haskell | Ignore |
|---|---|
| Language | GHC2021 |
GHC.Runtime.Interpreter.Types
Contents
Description
Types used by the runtime interpreter
Synopsis
- data Interp = Interp {}
- data InterpInstance = ExternalInterp !ExtInterp
- data InterpProcess = InterpProcess {
- interpPipe :: !Pipe
- interpHandle :: !ProcessHandle
- interpLock :: !(MVar ())
- data ExtInterp
- type ExtInterpStatusVar d = MVar (InterpStatus (ExtInterpInstance d))
- data ExtInterpInstance c = ExtInterpInstance {
- instProcess :: !InterpProcess
- instPendingFrees :: !(MVar [HValueRef])
- instExtra :: !c
- data ExtInterpState cfg details = ExtInterpState {
- interpConfig :: !cfg
- interpStatus :: !(ExtInterpStatusVar details)
- data InterpStatus inst
- = InterpPending
- | InterpRunning !inst
- data InterpSymbolCache = InterpSymbolCache {
- interpClosureCache :: MVar (SymbolCache "closure")
- interpConInfoCache :: MVar (SymbolCache "con_info")
- interpStaticInfoCache :: MVar (SymbolCache "static_info")
- interpBytesCache :: MVar (SymbolCache "bytes")
- interpFaststringCache :: MVar (UniqFM FastString (Ptr ()))
- mkInterpSymbolCache :: IO InterpSymbolCache
- lookupInterpSymbolCache :: forall (s :: SuffixOrInterpreted). InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ()))
- updateInterpSymbolCache :: forall (s :: SuffixOrInterpreted). InterpSymbol s -> InterpSymbolCache -> Ptr () -> IO ()
- purgeInterpSymbolCache :: InterpSymbolCache -> IO ()
- data InterpSymbol (s :: SuffixOrInterpreted) where
- IClosureSymbol :: Name -> InterpSymbol ('Suffix "closure")
- IConInfoSymbol :: Name -> InterpSymbol ('Suffix "con_info")
- IStaticInfoSymbol :: Name -> InterpSymbol ('Suffix "static_info")
- IBytesSymbol :: Name -> InterpSymbol ('Suffix "bytes")
- IFaststringSymbol :: FastString -> InterpSymbol 'Interpreted
- data SuffixOrInterpreted
- interpSymbolName :: forall (s :: Symbol). InterpSymbol ('Suffix s) -> Name
- interpSymbolSuffix :: forall (s :: Symbol). InterpSymbol ('Suffix s) -> String
- eliminateInterpSymbol :: forall (s :: SuffixOrInterpreted) r. InterpSymbol s -> (InterpSymbol 'Interpreted -> r) -> (forall (x :: Symbol). InterpSymbol ('Suffix x) -> r) -> r
- interpretedInterpSymbol :: InterpSymbol 'Interpreted -> FastString
- interpreterProfiled :: Interp -> Bool
- interpreterDynamic :: Interp -> Bool
- type IServ = ExtInterpState IServConfig ()
- data IServConfig = IServConfig {
- iservConfProgram :: !String
- iservConfOpts :: ![String]
- iservConfProfiled :: !Bool
- iservConfDynamic :: !Bool
- iservConfHook :: !(Maybe (CreateProcess -> IO ProcessHandle))
- iservConfTrace :: IO ()
- type JSInterp = ExtInterpState JSInterpConfig JSInterpExtra
- data JSInterpExtra = JSInterpExtra {
- instStdIn :: !Handle
- instFinderCache :: !FinderCache
- instFinderOpts :: !FinderOpts
- instJSState :: !(MVar JSState)
- instGhciUnitId :: !UnitId
- data JSInterpConfig = JSInterpConfig {}
- data JSState = JSState {
- jsLinkState :: !LinkPlan
- jsServerStarted :: !Bool
- data NodeJsSettings = NodeJsSettings {}
- defaultNodeJsSettings :: NodeJsSettings
- type WasmInterp = ExtInterpState WasmInterpConfig ()
- data WasmInterpConfig = WasmInterpConfig {
- wasmInterpDyLD :: !FilePath
- wasmInterpLibDir :: FilePath
- wasmInterpOpts :: ![String]
- wasmInterpBrowser :: !Bool
- wasmInterpBrowserHost :: !String
- wasmInterpBrowserPort :: !Int
- wasmInterpBrowserRedirectWasiConsole :: !Bool
- wasmInterpBrowserPuppeteerLaunchOpts :: !(Maybe String)
- wasmInterpBrowserPlaywrightBrowserType :: !(Maybe String)
- wasmInterpBrowserPlaywrightLaunchOpts :: !(Maybe String)
- wasmInterpTargetPlatform :: !Platform
- wasmInterpProfiled :: !Bool
- wasmInterpHsSoSuffix :: !String
- wasmInterpUnitState :: !UnitState
Documentation
Interpreter
Constructors
| Interp | |
Fields
| |
data InterpInstance #
Constructors
| ExternalInterp !ExtInterp | External interpreter |
data InterpProcess #
Constructors
| InterpProcess | |
Fields
| |
type ExtInterpStatusVar d = MVar (InterpStatus (ExtInterpInstance d)) #
data ExtInterpInstance c #
Common field between native external interpreter and the JS one
Constructors
| ExtInterpInstance | |
Fields
| |
data ExtInterpState cfg details #
External interpreter
The external interpreter is spawned lazily (on first use) to avoid slowing down sessions that don't require it. The contents of the MVar reflects the state of the interpreter (running or not).
Constructors
| ExtInterpState | |
Fields
| |
data InterpStatus inst #
Status of an external interpreter
Constructors
| InterpPending | Not spawned yet |
| InterpRunning !inst | Running |
InterpSymbolCache
data InterpSymbolCache #
Constructors
| InterpSymbolCache | |
Fields
| |
lookupInterpSymbolCache :: forall (s :: SuffixOrInterpreted). InterpSymbol s -> InterpSymbolCache -> IO (Maybe (Ptr ())) #
updateInterpSymbolCache :: forall (s :: SuffixOrInterpreted). InterpSymbol s -> InterpSymbolCache -> Ptr () -> IO () #
purgeInterpSymbolCache :: InterpSymbolCache -> IO () #
Clear all symbol caches.
data InterpSymbol (s :: SuffixOrInterpreted) where #
Constructors
| IClosureSymbol :: Name -> InterpSymbol ('Suffix "closure") | |
| IConInfoSymbol :: Name -> InterpSymbol ('Suffix "con_info") | |
| IStaticInfoSymbol :: Name -> InterpSymbol ('Suffix "static_info") | |
| IBytesSymbol :: Name -> InterpSymbol ('Suffix "bytes") | |
| IFaststringSymbol :: FastString -> InterpSymbol 'Interpreted |
Instances
| Outputable (InterpSymbol s) # | |
Defined in GHC.Runtime.Interpreter.Types.SymbolCache Methods ppr :: InterpSymbol s -> SDoc # | |
data SuffixOrInterpreted #
Constructors
| Suffix Symbol | |
| Interpreted |
interpSymbolName :: forall (s :: Symbol). InterpSymbol ('Suffix s) -> Name #
interpSymbolSuffix :: forall (s :: Symbol). InterpSymbol ('Suffix s) -> String #
eliminateInterpSymbol :: forall (s :: SuffixOrInterpreted) r. InterpSymbol s -> (InterpSymbol 'Interpreted -> r) -> (forall (x :: Symbol). InterpSymbol ('Suffix x) -> r) -> r #
interpreterProfiled :: Interp -> Bool #
Interpreter uses Profiling way
interpreterDynamic :: Interp -> Bool #
Interpreter uses Dynamic way
IServ
type IServ = ExtInterpState IServConfig () #
data IServConfig #
Configuration needed to spawn an external interpreter
Constructors
| IServConfig | |
Fields
| |
JSInterp
data JSInterpExtra #
Constructors
| JSInterpExtra | |
Fields
| |
data JSInterpConfig #
Constructors
| JSInterpConfig | |
Fields
| |
Constructors
| JSState | |
Fields
| |
data NodeJsSettings #
NodeJs configuration
Constructors
| NodeJsSettings | |
Fields
| |
type WasmInterp = ExtInterpState WasmInterpConfig () #
data WasmInterpConfig #
Constructors
| WasmInterpConfig | |
Fields
| |