pub struct Table {
pub name: String,
pub func: usize,
pub cells: Vec<usize>,
}Expand description
One jump table of one function, kept out of the instructions.
A table is data the function reads, and gcc and clang put it in .rodata rather than in the
code. Keeping it there keeps data out of the lines the instruction fetcher reads and keeps the
executable sections to what is executed, which is also what a size counted by section is
measuring. The cost is that the two ends of every cell are now in different sections, so each
cell is a relocation the linker fills in rather than a number the assembler writes, which is
what gas does with the same .long .L3-.L4 when the .L4 is in .rodata.
Each cell is still the distance from the front of the table to a block, so the code that reads one is the same code wherever the table is.
Fields§
§name: StringThe name the instruction that reads it gives it, which is local to this file.
func: usizeWhich of Text::funcs it belongs to.
cells: Vec<usize>Where each cell’s block is, counted from Extent::start of that function.
Trait Implementations§
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.