revm_interpreter/
instruction_context.rs1use crate::{interpreter_types::Jumps, Interpreter, InterpreterTypes};
2
3use super::Instruction;
4
5pub struct InstructionContext<'a, H: ?Sized, ITy: InterpreterTypes> {
6 pub host: &'a mut H,
7 pub interpreter: &'a mut Interpreter<ITy>,
8}
9
10impl<H: ?Sized, ITy: InterpreterTypes> InstructionContext<'_, H, ITy> {
11 #[inline]
15 pub(crate) fn step(self, instruction_table: &[Instruction<ITy, H>; 256]) {
16 let opcode = self.interpreter.bytecode.opcode();
18
19 self.interpreter.bytecode.relative_jump(1);
23
24 instruction_table[opcode as usize](self)
26 }
27}