[−][src]Struct cranelift_interpreter::frame::Frame
Holds the mutable elements of an interpretation. At some point I thought about using Cell/RefCell to do field-level mutability, thinking that otherwise I would have to pass around a mutable object (for inst and registers) and an immutable one (for function, could be self)--in the end I decided to do exactly that but perhaps one day that will become untenable.
Fields
function: &'a Function
The currently executing function.
Implementations
impl<'a> Frame<'a>
[src]
pub fn new(function: &'a Function) -> Self
[src]
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.
pub fn get(&self, name: &ValueRef) -> &DataValue
[src]
Retrieve the actual value associated with an SSA reference.
pub fn get_all(&self, names: &[ValueRef]) -> Vec<DataValue>
[src]
Retrieve multiple SSA references; see get
.
pub fn set(&mut self, name: ValueRef, value: DataValue) -> Option<DataValue>
[src]
Assign value
to the SSA reference name
.
pub fn set_all(&mut self, names: &[ValueRef], values: Vec<DataValue>)
[src]
Assign to multiple SSA references; see set
.
pub fn rename(&mut self, old_names: &[ValueRef], new_names: &[ValueRef])
[src]
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).
Trait Implementations
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,