ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Runtime.Interpreter.Types.SymbolCache

Description

The SymbolCache is used to cache lookups for specific symbols when using the interpreter.

Synopsis

- 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
  - = 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
- interpretedInterpSymbol :: InterpSymbol 'Interpreted -> FastString

# Documentation

data InterpSymbolCache #

Constructors

InterpSymbolCache |
Fields 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 () #

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

Instances details

Outputable (InterpSymbol s) # |
Instance details 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 #

interpretedInterpSymbol :: InterpSymbol 'Interpreted -> FastString #