Struct cranelift_interpreter::frame::Frame

source ·
pub struct Frame<'a> { /* private fields */ }
Expand description

Holds the mutable elements of an interpreted function call.

Implementations§

source§

impl<'a> Frame<'a>

source

pub fn new(function: &'a Function) -> Self

Construct a new Frame for a function. This allocates a slot in the hash map for each SSA Value (renamed to ValueRef here) which should mean that no additional allocations are needed while interpreting the frame.

source

pub fn get(&self, name: ValueRef) -> &DataValue

Retrieve the actual value associated with an SSA reference.

source

pub fn get_all(&self, names: &[ValueRef]) -> Vec<DataValue>

Retrieve multiple SSA references; see get.

source

pub fn set(&mut self, name: ValueRef, value: DataValue) -> Option<DataValue>

Assign value to the SSA reference name.

source

pub fn set_all(&mut self, names: &[ValueRef], values: Vec<DataValue>)

Assign to multiple SSA references; see set.

source

pub fn rename(&mut self, old_names: &[ValueRef], new_names: &[ValueRef])

Rename all of the SSA references in old_names to those in new_names. This will remove any old references that are not in old_names. TODO This performs an extra allocation that could be removed if we copied the values in the right order (i.e. when modifying in place, we need to avoid changing a value before it is referenced).

source

pub fn entries_mut(&mut self) -> &mut [Option<DataValue>]

Accessor for the current entries in the frame.

source

pub fn function(&self) -> &'a Function

Accessor for the Function of this frame.

Trait Implementations§

source§

impl<'a> Debug for Frame<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Frame<'a>

§

impl<'a> RefUnwindSafe for Frame<'a>

§

impl<'a> Send for Frame<'a>

§

impl<'a> Sync for Frame<'a>

§

impl<'a> Unpin for Frame<'a>

§

impl<'a> UnwindSafe for Frame<'a>

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>,

§

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>,

§

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.