Struct cretonne_codegen::ir::jumptable::JumpTableData [−][src]
pub struct JumpTableData { /* fields omitted */ }
Contents of a jump table.
All jump tables use 0-based indexing and are expected to be densely populated. They don't need to be completely populated, though. Individual entries can be missing.
Methods
impl JumpTableData
[src]
impl JumpTableData
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new empty jump table.
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
Create a new empty jump table with the specified capacity.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Get the number of table entries.
pub fn set_entry(&mut self, idx: usize, dest: Ebb)
[src]
pub fn set_entry(&mut self, idx: usize, dest: Ebb)
Set a table entry.
The table will grow as needed to fit idx
.
pub fn push_entry(&mut self, dest: Ebb)
[src]
pub fn push_entry(&mut self, dest: Ebb)
Append a table entry.
pub fn clear_entry(&mut self, idx: usize)
[src]
pub fn clear_entry(&mut self, idx: usize)
Clear a table entry.
The br_table
instruction will fall through if given an index corresponding to a cleared
table entry.
pub fn get_entry(&self, idx: usize) -> Option<Ebb>
[src]
pub fn get_entry(&self, idx: usize) -> Option<Ebb>
Get the entry for idx
, or None
.
ⓘImportant traits for Entries<'a>pub fn entries(&self) -> Entries
[src]
pub fn entries(&self) -> Entries
Enumerate over all (idx, dest)
pairs in the table in order.
This returns an iterator that skips any empty slots in the table.
pub fn branches_to(&self, ebb: Ebb) -> bool
[src]
pub fn branches_to(&self, ebb: Ebb) -> bool
Checks if any of the entries branch to ebb
.
pub fn as_mut_slice(&mut self) -> &mut [PackedOption<Ebb>]
[src]
pub fn as_mut_slice(&mut self) -> &mut [PackedOption<Ebb>]
Access the whole table as a mutable slice.
Trait Implementations
impl Clone for JumpTableData
[src]
impl Clone for JumpTableData
fn clone(&self) -> JumpTableData
[src]
fn clone(&self) -> JumpTableData
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Display for JumpTableData
[src]
impl Display for JumpTableData
Auto Trait Implementations
impl Send for JumpTableData
impl Send for JumpTableData
impl Sync for JumpTableData
impl Sync for JumpTableData