pub struct ImmediateSlots(u64);Expand description
A bitmask, tracking which 4-byte slots have been written via set_immediates.
Bit N corresponds to bytes [N4 .. N4+4).
Tuple Fields§
§0: u64Implementations§
Source§impl ImmediateSlots
impl ImmediateSlots
pub const fn from_raw(raw: u64) -> Self
Sourcepub const fn from_range(offset: u32, size_bytes: u32) -> Self
pub const fn from_range(offset: u32, size_bytes: u32) -> Self
Compute the bitmask for a byte range [offset .. offset + size_bytes).
Sourcepub fn from_type(
ty: &TypeInner,
offset: u32,
types: &UniqueArena<Type>,
gctx: GlobalCtx<'_>,
) -> Self
pub fn from_type( ty: &TypeInner, offset: u32, types: &UniqueArena<Type>, gctx: GlobalCtx<'_>, ) -> Self
Compute the slots occupied by a type at a given byte offset, excluding padding between struct members.
Sourcepub const fn contains(self, other: Self) -> bool
pub const fn contains(self, other: Self) -> bool
Returns true if self contains all bits in other.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the bits in self that are not set in other.
Sourcepub fn size_for_module(module: &Module) -> u32
pub fn size_for_module(module: &Module) -> u32
Returns the byte size of the var<immediate> type in a module.
Zero if the module has no var<immediate>.
Sourcepub(crate) fn for_pointer(
pointer: Handle<Expression>,
global: Handle<GlobalVariable>,
expression_arena: &Arena<Expression>,
global_vars: &Arena<GlobalVariable>,
types: &UniqueArena<Type>,
) -> Self
pub(crate) fn for_pointer( pointer: Handle<Expression>, global: Handle<GlobalVariable>, expression_arena: &Arena<Expression>, global_vars: &Arena<GlobalVariable>, types: &UniqueArena<Type>, ) -> Self
Compute the immediate slot bitmask for a pointer expression that refers to (part of) an immediate global variable.
global is the handle of the immediate global variable that this
pointer derives from (obtained from assignable_global).
Trait Implementations§
Source§impl BitOr for ImmediateSlots
impl BitOr for ImmediateSlots
Source§impl BitOrAssign for ImmediateSlots
impl BitOrAssign for ImmediateSlots
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreSource§impl Clone for ImmediateSlots
impl Clone for ImmediateSlots
Source§fn clone(&self) -> ImmediateSlots
fn clone(&self) -> ImmediateSlots
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImmediateSlots
impl Debug for ImmediateSlots
Source§impl Default for ImmediateSlots
impl Default for ImmediateSlots
Source§fn default() -> ImmediateSlots
fn default() -> ImmediateSlots
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ImmediateSlots
impl<'de> Deserialize<'de> for ImmediateSlots
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ImmediateSlots
impl Display for ImmediateSlots
Source§impl PartialEq for ImmediateSlots
impl PartialEq for ImmediateSlots
Source§impl Serialize for ImmediateSlots
impl Serialize for ImmediateSlots
impl Copy for ImmediateSlots
impl Eq for ImmediateSlots
impl StructuralPartialEq for ImmediateSlots
Auto Trait Implementations§
impl Freeze for ImmediateSlots
impl RefUnwindSafe for ImmediateSlots
impl Send for ImmediateSlots
impl Sync for ImmediateSlots
impl Unpin for ImmediateSlots
impl UnwindSafe for ImmediateSlots
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more