tenzr::JitCache¶
Process-wide cache of compiled executables keyed by namespaced structural hashes.
#include <jit_cache.h>
Public Functions¶
| Name | |
|---|---|
| JitCache & | Instance() Access the singleton cache. |
| uint64_t | DomainKey(uint64_t domain, uint64_t hash) Combine a domain tag with a structural hash to form a namespaced cache key. |
| JitCache() =default | |
| ~JitCache() Drop every cached executable on shutdown. |
|
| JitCache(const JitCache & ) =delete | |
| JitCache & | operator=(const JitCache & ) =delete |
| std::shared_ptr< CachedExecutable > | Get(uint64_t hash) Look up an executable by hash, returning null on a miss. |
| void | Put(uint64_t hash, std::shared_ptr< CachedExecutable > exec) Insert or replace the executable stored for a hash. |
| bool | Contains(uint64_t hash) const Whether an executable exists for a hash. |
| size_t | Size() const Number of cached executables. |
| void | Clear() Drop every cached executable. |
Public Attributes¶
| Name | |
|---|---|
| constexpr uint64_t | kEagerKeyDomain Domain tags keep eager-AST and JIT-signature keys in disjoint namespaces. |
| constexpr uint64_t | kJitKeyDomain |
Public Functions Documentation¶
function Instance¶
Access the singleton cache.
Return: Reference to the singleton JitCache.
Get the process-wide JIT executable cache.
function DomainKey¶
Combine a domain tag with a structural hash to form a namespaced cache key.
function JitCache¶
function ~JitCache¶
Drop every cached executable on shutdown.
function JitCache¶
function operator=¶
function Get¶
Look up an executable by hash, returning null on a miss.
Parameters:
- hash Structural AST hash.
Return: The cached executable, or nullptr on a miss.
Look up a cached executable by graph hash.
function Put¶
Insert or replace the executable stored for a hash.
Parameters:
- hash Structural AST hash.
- exec Compiled executable to cache.
Insert or replace the executable stored under hash.
function Contains¶
Whether an executable exists for a hash.
Parameters:
- hash Structural AST hash.
Return: true when present.
Test whether an executable is cached for hash.
function Size¶
Number of cached executables.
Return: Cache entry count.
Number of executables currently cached.
function Clear¶
Drop every cached executable.
Remove every cached executable.
Public Attributes Documentation¶
variable kEagerKeyDomain¶
Domain tags keep eager-AST and JIT-signature keys in disjoint namespaces.