pub struct BasicInterpreterState<Regs, Env, Memory, IF> {
pub regs: Regs,
pub env: Env,
pub memory: Memory,
pub instruction_fetcher: IF,
}Expand description
Basic interpreter state.
This is a simple container, which is not required to be used, is helpful for storing the whole state related to the interpreter together.
Fields§
§regs: RegsGeneral purpose registers
env: EnvExecution environment.
Extensions might use this to place additional constraints on Env to require additional
registers, handlers (like SystemInstructionHandler) or other resources. If no such
extension is used, () can be used as a placeholder.
memory: MemoryMemory
instruction_fetcher: IFInstruction fetcher
Implementations§
Source§impl<Regs, Env, Memory, IF> BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> BasicInterpreterState<Regs, Env, Memory, IF>
Sourcepub fn execute<I>(
&mut self,
) -> Result<(), ExecutionError<<<I as Instruction>::Reg as Register>::Type>>where
Regs: RegisterFile<<I as Instruction>::Reg>,
I: ExecutableInstruction<Regs, Env, Memory, IF>,
Memory: VirtualMemory,
IF: InstructionFetcher<I, Memory> + ProgramCounter<<<I as Instruction>::Reg as Register>::Type, Memory>,
pub fn execute<I>(
&mut self,
) -> Result<(), ExecutionError<<<I as Instruction>::Reg as Register>::Type>>where
Regs: RegisterFile<<I as Instruction>::Reg>,
I: ExecutableInstruction<Regs, Env, Memory, IF>,
Memory: VirtualMemory,
IF: InstructionFetcher<I, Memory> + ProgramCounter<<<I as Instruction>::Reg as Register>::Type, Memory>,
Execute the program with a given basic interpreter state.
The implementation is designed to be efficient with little left to optimize further. Though it is still possible to improve performance by applying additional constraints on the program.
Trait Implementations§
Auto Trait Implementations§
impl<Regs, Env, Memory, IF> Freeze for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> RefUnwindSafe for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> Send for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> Sync for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> Unpin for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> UnsafeUnpin for BasicInterpreterState<Regs, Env, Memory, IF>
impl<Regs, Env, Memory, IF> UnwindSafe for BasicInterpreterState<Regs, Env, Memory, IF>
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