pub struct Jit {
pub stats: JitStats,
/* private fields */
}Expand description
A JIT backend: compiles blocks on first use and runs them thereafter.
Holding the JITModule means compiled code lives as long as this does.
Fields§
§stats: JitStatsImplementations§
Source§impl Jit
impl Jit
pub fn new() -> Self
Sourcepub fn try_compile(
&mut self,
ctx: &Context<'_>,
block: BlockId,
) -> Result<(), Unsupported>
pub fn try_compile( &mut self, ctx: &Context<'_>, block: BlockId, ) -> Result<(), Unsupported>
Compiles block without running it, reporting why if it is declined.
For tooling that wants to report coverage over a module.
Sourcepub fn run_block(
&mut self,
ctx: &Context<'_>,
emu: &mut StandaloneEmulator<VmMemory>,
block: BlockId,
start: usize,
chain: bool,
) -> Result<Option<Executed>, EmulatorErrorKind>
pub fn run_block( &mut self, ctx: &Context<'_>, emu: &mut StandaloneEmulator<VmMemory>, block: BlockId, start: usize, chain: bool, ) -> Result<Option<Executed>, EmulatorErrorKind>
Runs block as native code from body index start, if it has any.
Returns Ok(None) when the block is not compiled, which is the caller’s
signal to run it on the interpreter instead, and Ok(Some(_)) when it
ran, saying where the interpreter continues.
Trait Implementations§
Source§impl BlockExecutor for Jit
Lets a Jit be installed on a machine as its block executor.
impl BlockExecutor for Jit
Lets a Jit be installed on a machine as its block executor.
Auto Trait Implementations§
impl !Freeze for Jit
impl !RefUnwindSafe for Jit
impl !Send for Jit
impl !Sync for Jit
impl !UnwindSafe for Jit
impl Unpin for Jit
impl UnsafeUnpin for Jit
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