pub struct JumpTable {
pub(crate) jump: BTreeMap<u16, Jump>,
pub(crate) func: BTreeMap<u32, u16>,
pub(crate) code: Code,
}
Expand description
Jump table implementation.
Fields§
§jump: BTreeMap<u16, Jump>
Jump table.
func: BTreeMap<u32, u16>
Function table.
code: Code
Code section.
Implementations§
Source§impl JumpTable
impl JumpTable
Sourcepub fn shift_pc(&mut self, start: u16, offset: u16) -> Result<()>
pub fn shift_pc(&mut self, start: u16, offset: u16) -> Result<()>
Shift program counter for all items.
Sourcepub fn shift_targets(&mut self) -> Result<()>
pub fn shift_targets(&mut self) -> Result<()>
Shift the target program counters.
Calculating target pc from the offset of original pc.
Sourcepub fn shift_target(&mut self, ptr: u16, offset: u16) -> Result<()>
pub fn shift_target(&mut self, ptr: u16, offset: u16) -> Result<()>
Shift the program counter of targets with given ptr and offset.
- shift code section.
- shift label targets.
- shift function targets.
Sourcepub fn shift_label_pc(&mut self, start: u16, offset: u16) -> Result<()>
pub fn shift_label_pc(&mut self, start: u16, offset: u16) -> Result<()>
Shift program counter for labels.
Source§impl JumpTable
impl JumpTable
Source§impl JumpTable
impl JumpTable
Sourcepub fn call_offset(&mut self, func: u32, offset: u16) -> Result<()>
pub fn call_offset(&mut self, func: u32, offset: u16) -> Result<()>
Register program counter to the function table.
Sourcepub fn code_offset(&mut self, offset: u16)
pub fn code_offset(&mut self, offset: u16)
Register the start of the program counter of the code section.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JumpTable
impl RefUnwindSafe for JumpTable
impl Send for JumpTable
impl Sync for JumpTable
impl Unpin for JumpTable
impl UnwindSafe for JumpTable
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