pub struct RegTape { /* private fields */ }Expand description
Low-level tape for use with the Fidget virtual machine (or to be lowered further into machine instructions).
Implementations§
Source§impl RegTape
impl RegTape
Sourcepub fn new<const N: usize>(ssa: &SsaTape) -> Self
pub fn new<const N: usize>(ssa: &SsaTape) -> Self
Lowers the tape to assembly with a particular register limit
Note that if you also want to simplify the tape, it’s more efficient
to use VmData::simplify, which
simultaneously simplifies and performs register allocation in a
single pass.
Sourcepub fn repack(&mut self)
pub fn repack(&mut self)
Repacks registers by frequency (so that register 0 is the most frequent)
Sourcepub fn repack_map(&self) -> HashMap<u8, u8>
pub fn repack_map(&self) -> HashMap<u8, u8>
Returns a map for register repacking
The map repacks registers in the tape by frequency, so that register 0 is the most frequent.
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Returns the number of unique register and memory locations that are used by this tape.
Sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &RegOp>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &RegOp>
Returns a front-to-back iterator
This is the opposite of evaluation order; it will visit the root of the tree first, and end at the leaves.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RegTape
impl<'de> Deserialize<'de> for RegTape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> IntoIterator for &'a RegTape
impl<'a> IntoIterator for &'a RegTape
Auto Trait Implementations§
impl Freeze for RegTape
impl RefUnwindSafe for RegTape
impl Send for RegTape
impl Sync for RegTape
impl Unpin for RegTape
impl UnsafeUnpin for RegTape
impl UnwindSafe for RegTape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.