Skip to main content

Jit

Struct Jit 

Source
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: JitStats

Implementations§

Source§

impl Jit

Source

pub fn new() -> Self

Source

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.

Source

pub fn run_block( &mut self, ctx: &Context<'_>, emu: &mut StandaloneEmulator<VmMemory>, block: BlockId, chain: bool, ) -> Result<Option<Executed>, EmulatorErrorKind>

Runs block as native code, 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(n)) when it ran, where n is the number of body instructions it retired.

Trait Implementations§

Source§

impl BlockExecutor for Jit

Lets a Jit be installed on a machine as its block executor.

Source§

fn run_block( &mut self, ctx: &Context<'_>, emu: &mut StandaloneEmulator<VmMemory>, block: BlockId, chain: bool, ) -> Result<Option<Executed>, EmulatorErrorKind>

Runs everything in block except its terminator. Read more
Source§

impl Default for Jit

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.