pub struct LazyInstructionFetcher { /* private fields */ }Expand description
Lazy instruction fetcher implementation
Implementations§
Source§impl LazyInstructionFetcher
impl LazyInstructionFetcher
Sourcepub unsafe fn new(return_trap_address: u64, pc: u64) -> Self
pub unsafe fn new(return_trap_address: u64, pc: u64) -> Self
Create a new instance.
return_trap_address is the address at which the interpreter will stop execution
(gracefully).
§Safety
The program counter must be valid and aligned, the instructions processed must be valid and end with a jump instruction.
Trait Implementations§
Source§impl Clone for LazyInstructionFetcher
impl Clone for LazyInstructionFetcher
Source§fn clone(&self) -> LazyInstructionFetcher
fn clone(&self) -> LazyInstructionFetcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LazyInstructionFetcher
Source§impl Debug for LazyInstructionFetcher
impl Debug for LazyInstructionFetcher
Source§impl<Memory> InstructionFetcher<ContractInstruction, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> InstructionFetcher<ContractInstruction, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
Source§fn peek_instruction(
&mut self,
memory: &Memory,
) -> FetchInstructionResult<ContractInstruction>
fn peek_instruction( &mut self, memory: &Memory, ) -> FetchInstructionResult<ContractInstruction>
Read the instruction at the current position, leaving the program counter on it. Read more
Source§unsafe fn advance(&mut self, instruction_size: u8)
unsafe fn advance(&mut self, instruction_size: u8)
Move the program counter past an instruction of
instruction_size bytes that
Self::peek_instruction() has just returned. Read moreSource§fn fetch_instruction(
&mut self,
memory: &Memory,
) -> FetchInstructionResult<ContractInstruction>
fn fetch_instruction( &mut self, memory: &Memory, ) -> FetchInstructionResult<ContractInstruction>
Fetch a single instruction at a specified address and advance the program counter on
successful fetch. Read more
Source§impl<Memory> ProgramCounter<u64, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> ProgramCounter<u64, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
Source§unsafe fn try_set_pc_relative(
&mut self,
instruction_size: u8,
offset: i32,
) -> bool
unsafe fn try_set_pc_relative( &mut self, instruction_size: u8, offset: i32, ) -> bool
Move
offset bytes from the instruction being executed for targets this can resolve. Read moreSource§unsafe fn failed_branch(
&mut self,
memory: &Memory,
) -> Result<ControlFlow<()>, ExecutionError<u64>>
unsafe fn failed_branch( &mut self, memory: &Memory, ) -> Result<ControlFlow<()>, ExecutionError<u64>>
Say what is wrong with the target
Self::try_set_pc_relative() refused. Read moreSource§fn set_pc(
&mut self,
memory: &Memory,
pc: u64,
) -> Result<ControlFlow<()>, ExecutionError<u64>>
fn set_pc( &mut self, memory: &Memory, pc: u64, ) -> Result<ControlFlow<()>, ExecutionError<u64>>
Set the current value of the program counter
Source§fn old_pc(&self, instruction_size: u8) -> Address
fn old_pc(&self, instruction_size: u8) -> Address
Get the previous value of the program counter before executing an
instruction. Read moreSource§fn set_pc_relative(
&mut self,
memory: &Memory,
instruction_size: u8,
offset: i32,
) -> Result<ControlFlow<()>, ExecutionError<Address>>where
Self: ProgramCounter<Address, Memory>,
fn set_pc_relative(
&mut self,
memory: &Memory,
instruction_size: u8,
offset: i32,
) -> Result<ControlFlow<()>, ExecutionError<Address>>where
Self: ProgramCounter<Address, Memory>,
Apply
ExecutionResult::Branch, continuing offset bytes from the instruction being
executed. Read moreAuto Trait Implementations§
impl Freeze for LazyInstructionFetcher
impl RefUnwindSafe for LazyInstructionFetcher
impl Send for LazyInstructionFetcher
impl Sync for LazyInstructionFetcher
impl Unpin for LazyInstructionFetcher
impl UnsafeUnpin for LazyInstructionFetcher
impl UnwindSafe for LazyInstructionFetcher
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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 more