pub struct EagerTestInstructionFetcher<'a> { /* private fields */ }Expand description
Eager instruction fetcher walks instructions that EagerTestInstructions decoded upfront.
This is a plain Copy cursor without a destructor, see EagerTestInstructions for why.
Trait Implementations§
Source§impl<'a> Clone for EagerTestInstructionFetcher<'a>
impl<'a> Clone for EagerTestInstructionFetcher<'a>
Source§fn clone(&self) -> EagerTestInstructionFetcher<'a>
fn clone(&self) -> EagerTestInstructionFetcher<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for EagerTestInstructionFetcher<'a>
Source§impl Debug for EagerTestInstructionFetcher<'_>
impl Debug for EagerTestInstructionFetcher<'_>
Source§impl<Memory> InstructionFetcher<ContractInstruction, Memory> for EagerTestInstructionFetcher<'_>where
Memory: VirtualMemory,
impl<Memory> InstructionFetcher<ContractInstruction, Memory> for EagerTestInstructionFetcher<'_>where
Memory: VirtualMemory,
Source§fn peek_instruction(
&mut self,
_memory: &Memory,
) -> FetchInstructionResult<ContractInstruction>
fn peek_instruction( &mut self, _memory: &Memory, ) -> FetchInstructionResult<ContractInstruction>
Source§unsafe fn advance(&mut self, instruction_size: u8)
unsafe fn advance(&mut self, instruction_size: u8)
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>
Source§impl<Memory> ProgramCounter<u64, Memory> for EagerTestInstructionFetcher<'_>where
Memory: VirtualMemory,
impl<Memory> ProgramCounter<u64, Memory> for EagerTestInstructionFetcher<'_>where
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
Moves within the decoded stream instead of resolving an address and converting it back,
which is what going through Self::set_pc() would do.
One comparison and one test are all this needs to recognize every target it cannot resolve:
one past the end of the decoded stream, a backwards branch that ran off its start, and an
unaligned one. The return trap sits outside the decoded stream, so a branch to it fails the
bounds check here too and is answered by Self::failed_branch() like any other target
this refuses.
Source§unsafe fn failed_branch(
&mut self,
memory: &Memory,
) -> Result<ControlFlow<()>, ExecutionError<u64>>
unsafe fn failed_branch( &mut self, memory: &Memory, ) -> Result<ControlFlow<()>, ExecutionError<u64>>
Turns the refused target back into an address and hands it to Self::set_pc(), which is
where the rules about what is and is not an instruction address live.
Source§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>>
Source§fn old_pc(&self, instruction_size: u8) -> Address
fn old_pc(&self, instruction_size: u8) -> Address
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>,
ExecutionResult::Branch, continuing offset bytes from the instruction being
executed. Read moreAuto Trait Implementations§
impl<'a> !Send for EagerTestInstructionFetcher<'a>
impl<'a> !Sync for EagerTestInstructionFetcher<'a>
impl<'a> Freeze for EagerTestInstructionFetcher<'a>
impl<'a> RefUnwindSafe for EagerTestInstructionFetcher<'a>
impl<'a> Unpin for EagerTestInstructionFetcher<'a>
impl<'a> UnsafeUnpin for EagerTestInstructionFetcher<'a>
impl<'a> UnwindSafe for EagerTestInstructionFetcher<'a>
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,
§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> ⓘ
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> ⓘ
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