Skip to main content

BackendAdapter

Struct BackendAdapter 

Source
pub struct BackendAdapter<B: JitBackend, P: HotnessPolicy = ThresholdPolicy> { /* private fields */ }
Expand description

Beadie wired to a single JIT backend.

Implementations§

Source§

impl<B: JitBackend> BackendAdapter<B>

Source

pub fn new(backend: B) -> Self

Source§

impl<B: JitBackend, P: HotnessPolicy> BackendAdapter<B, P>

Source

pub fn with_policy(backend: B, policy: P) -> Self

Source

pub fn register( &self, core: CoreHandle, on_invalidate: Option<Box<dyn Fn() + Send + Sync>>, ) -> BoundBead<B>

Source

pub fn on_invoke<F>(&self, bound: &BoundBead<B>, factory: F) -> Option<*mut ()>
where F: FnOnce(&Arc<Bead>) -> B::FunctionDef + Send + 'static,

Source

pub fn on_invoke_osr<F>( &self, bound: &BoundBead<B>, factory: F, ) -> Option<*mut ()>
where F: FnOnce(&Arc<Bead>) -> OsrBuild<B::FunctionDef> + Send + 'static,

OSR-aware dispatch.

The factory returns an OsrBuild — the backend function def plus one OsrEntry per hot loop header the compiled code will expose. The adapter compiles def via the backend and publishes both the main entry and the OSR table atomically on the bead.

Back-edge probes in the runtime use Bead::osr_entry to look up a resume point and transfer a live interpreter frame into native code.

Source

pub fn prune(&self)

Source

pub fn reload_all(&self) -> usize

Source

pub fn reload_matching(&self, pred: impl Fn(&Arc<Bead>) -> bool) -> usize

Source

pub fn chain_len(&self) -> usize

Source

pub fn beadie(&self) -> &Beadie<P>

Source

pub fn backend(&self) -> &Arc<B>

Auto Trait Implementations§

§

impl<B, P> Freeze for BackendAdapter<B, P>
where P: Freeze,

§

impl<B, P = ThresholdPolicy> !RefUnwindSafe for BackendAdapter<B, P>

§

impl<B, P> Send for BackendAdapter<B, P>

§

impl<B, P> Sync for BackendAdapter<B, P>

§

impl<B, P> Unpin for BackendAdapter<B, P>
where P: Unpin,

§

impl<B, P> UnsafeUnpin for BackendAdapter<B, P>
where P: UnsafeUnpin,

§

impl<B, P = ThresholdPolicy> !UnwindSafe for BackendAdapter<B, P>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.