pub(crate) struct OrcJitState {
pub(crate) global: &'static GlobalOrcJit,
pub(crate) jd_guard: Arc<JitDylibGuard>,
pub(crate) staged_functions: HashMap<u32, FunctionValue<'static>, FxBuildHasher>,
pub(crate) pending_symbols: Vec<(CString, usize)>,
pub(crate) loaded_trackers: Vec<ResourceTracker>,
pub(crate) committed_functions: HashMap<u32, usize, FxBuildHasher>,
pub(crate) last_compiled_object: Option<Vec<u8>>,
pub(crate) clear_pool_counter: u32,
}Expand description
ORC JIT state for the LLVM backend (JIT mode only).
The LLVM context is owned separately (via tscx) and persists across JIT resets.
Each compiler gets its own JITDylib in the global LLJIT for symbol isolation.
Fields§
§global: &'static GlobalOrcJitReference to the global LLJIT instance.
jd_guard: Arc<JitDylibGuard>Shared guard that owns the JITDylib. The JD is not recycled until all
Arc<JitDylibGuard> holders (including external callers) are dropped.
Declared before loaded_trackers so it drops first: removeJITDylib
(called in JitDylibGuard::drop) clears the JITDylib internally and
must run while the tracker handles are still live.
staged_functions: HashMap<u32, FunctionValue<'static>, FxBuildHasher>Functions in the current staging module (not yet committed to JIT).
pending_symbols: Vec<(CString, usize)>Absolute symbols collected during translation, flushed to the global builtins JITDylib before commit.
loaded_trackers: Vec<ResourceTracker>Resource trackers for committed JIT modules, used for code removal.
committed_functions: HashMap<u32, usize, FxBuildHasher>Maps committed function ID → index into loaded_trackers.
last_compiled_object: Option<Vec<u8>>Cached object buffer from the last commit_staged_module, captured via
ObjectTransformLayer.
clear_pool_counter: u32Counter for throttling SymbolStringPool::clearDeadEntries() calls.
Implementations§
Source§impl OrcJitState
impl OrcJitState
pub(crate) fn new( debug_support: bool, profiling_support: bool, simple_perf: bool, ) -> Result<Self>
Sourcepub(crate) fn clear(&mut self) -> Result<()>
pub(crate) fn clear(&mut self) -> Result<()>
Clears all code and symbols from this compiler’s JITDylib.
Sourcepub(crate) fn maybe_clear_dead_pool_entries(&mut self)
pub(crate) fn maybe_clear_dead_pool_entries(&mut self)
Periodically clears dead entries from the global SymbolStringPool.
clearDeadEntries is O(pool_size), so we throttle it to avoid
O(N²) total cost over many compilations.
pub(crate) fn jd(&self) -> JITDylibRef
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrcJitState
impl RefUnwindSafe for OrcJitState
impl !Send for OrcJitState
impl !Sync for OrcJitState
impl Unpin for OrcJitState
impl UnsafeUnpin for OrcJitState
impl UnwindSafe for OrcJitState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 160 bytes