pub struct JitRuntime {
pub hot_threshold: u32,
/* private fields */
}Available on crate feature
jit only.Expand description
Runtime-wide JIT state: compiled traces are shared; each worker thread owns
its own Cranelift module for compilation (the private module_local helper).
Fields§
§hot_threshold: u32Implementations§
Source§impl JitRuntime
impl JitRuntime
pub fn new(chunk: Arc<Chunk>, hot_threshold: u32) -> Self
pub fn with_default_threshold(chunk: Arc<Chunk>) -> Self
Sourcepub fn matches_chunk(&self, vm_chunk: &Arc<Chunk>) -> bool
pub fn matches_chunk(&self, vm_chunk: &Arc<Chunk>) -> bool
True when vm_chunk is the same image as the JIT cache.
Sourcepub fn reload(&self, chunk: Arc<Chunk>)
pub fn reload(&self, chunk: Arc<Chunk>)
Replace the bytecode image and discard stale compiled traces.
pub fn get_trace(&self, key: &TraceKey) -> Option<JitEntryCopy>
pub fn is_failed(&self, key: &TraceKey) -> bool
pub fn mark_failed(&self, key: TraceKey)
pub fn insert_trace(&self, key: TraceKey, trace: CompiledTrace)
pub fn record_hot_hit(&self, key: TraceKey) -> bool
Auto Trait Implementations§
impl !Freeze for JitRuntime
impl Forget for JitRuntime
impl Move for JitRuntime
impl RefUnwindSafe for JitRuntimewhere
RwLock<Arc<Chunk>>: RefUnwindSafe,
RwLock<TraceCache>: RefUnwindSafe,
Mutex<HotCounter>: RefUnwindSafe,
impl Send for JitRuntime
impl Sync for JitRuntime
impl Unpin for JitRuntime
impl UnsafeUnpin for JitRuntimewhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const ArcInner<Chunk> is !null: UnsafeUnpin,
PhantomData<ArcInner<Chunk>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(TraceKey, CompiledTrace)>: UnsafeUnpin,
PhantomData<(TraceKey, ())>: UnsafeUnpin,
PhantomData<(TraceKey, u32)>: UnsafeUnpin,
impl UnwindSafe for JitRuntimewhere
RwLock<Arc<Chunk>>: UnwindSafe,
RwLock<TraceCache>: UnwindSafe,
Mutex<HotCounter>: UnwindSafe,
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
Mutably borrows from an owned value. Read more