| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unison.Runtime.Machine
Synopsis
- type ActiveThreads = Maybe (IORef (Set ThreadId))
- data CCache prof = CCache {
- sandboxed :: Bool
- tracer :: Bool -> Val -> Tracer
- profiler :: !prof
- srcCombs :: TVar (EnumMap Word64 Combs)
- combs :: TVar (EnumMap Word64 MCombs)
- combRefs :: TVar (EnumMap Word64 Reference)
- baseNums :: TVar (EnumMap Word64 Word64)
- cacheableCombs :: TVar (EnumSet Word64)
- optInfos :: TVar (OptInfos Reference Symbol)
- freshTm :: TVar Word64
- freshRecSchema :: TVar Word64
- intermed :: TVar (Map Reference (SuperGroup Reference Symbol))
- refTm :: TVar (Map Reference Word64)
- recordRefs :: TVar (BiMap RecordSchema RecordRef)
- sandbox :: TVar (Map Reference (Set Reference))
- recordFieldMappings :: TVar RecordFieldMappings
- nativeCells :: TVar NativeCellPool
- jit :: !JIT
- type Combs = GCombs Void CombIx
- data Tracer
- apply0 :: RuntimeProfiler p => Maybe (XStack -> IO ()) -> CCache p -> ActiveThreads -> Word64 -> IO ()
- boxSlot :: Stack -> Int -> IO Val
- baseCCache :: JIT -> Bool -> IO (CCache ())
- initialNativeCells :: Int
- cacheAdd :: RuntimeProfiler p => [(Reference, Code Reference)] -> CCache p -> IO [Reference]
- cacheAdd0 :: RuntimeProfiler p => Set Reference -> [(Reference, Code Reference)] -> [(Reference, Set Reference)] -> CCache p -> IO ()
- eval0 :: RuntimeProfiler p => CCache p -> ActiveThreads -> MSection -> IO ()
- expandSandbox :: Map Reference (Set Reference) -> [(Reference, SuperGroup Reference Symbol)] -> [(Reference, Set Reference)]
- mCombVal :: CombIx -> MComb -> Val
- preEvalTopLevelConstants :: RuntimeProfiler p => EnumMap Word64 (GCombs Val CombIx) -> EnumMap Word64 (GCombs Val CombIx) -> CCache p -> IO ()
- rCombSection :: EnumMap Word64 MCombs -> CombIx -> MComb
- refLookup :: String -> Map Reference Word64 -> Reference -> Word64
- refNumTm :: CCache prof -> Reference -> IO Word64
- refNumsTm :: CCache prof -> IO (Map Reference Word64)
- refNumsTy :: CCache prof -> IO (Map Reference Word64)
- reifyValue :: CCache p -> Referenced Value -> IO (Either [Reference] Val)
- resolveSection :: CCache p -> Section -> IO MSection
Documentation
type ActiveThreads = Maybe (IORef (Set ThreadId)) Source #
A ref storing every currently active thread. This is helpful for cleaning up orphaned threads when the main process completes.
We track threads when running in a host process like UCM,
otherwise, in one-off environments Nothing is used and we don't bother tracking forked threads since they'll be
cleaned up automatically on process termination.
Constructors
| CCache | |
Fields
| |
apply0 :: RuntimeProfiler p => Maybe (XStack -> IO ()) -> CCache p -> ActiveThreads -> Word64 -> IO () Source #
boxSlot :: Stack -> Int -> IO Val Source #
The boxed form of the wide variable whose value slot is slot i
(boxVal on the stack).
initialNativeCells :: Int Source #
How many native code cells a fresh cache starts with. Each is 16 bytes.
cacheAdd :: RuntimeProfiler p => [(Reference, Code Reference)] -> CCache p -> IO [Reference] Source #
cacheAdd0 :: RuntimeProfiler p => Set Reference -> [(Reference, Code Reference)] -> [(Reference, Set Reference)] -> CCache p -> IO () Source #
eval0 :: RuntimeProfiler p => CCache p -> ActiveThreads -> MSection -> IO () Source #
expandSandbox :: Map Reference (Set Reference) -> [(Reference, SuperGroup Reference Symbol)] -> [(Reference, Set Reference)] Source #
preEvalTopLevelConstants :: RuntimeProfiler p => EnumMap Word64 (GCombs Val CombIx) -> EnumMap Word64 (GCombs Val CombIx) -> CCache p -> IO () Source #
refNumsTy :: CCache prof -> IO (Map Reference Word64) Source #
The process-wide type numbering (Unison.Runtime.TypeNumbers).
reifyValue :: CCache p -> Referenced Value -> IO (Either [Reference] Val) Source #