revm_interpreter::interpreter_types

Trait Jumps

Source
pub trait Jumps {
    // Required methods
    fn relative_jump(&mut self, offset: isize);
    fn absolute_jump(&mut self, offset: usize);
    fn is_valid_legacy_jump(&mut self, offset: usize) -> bool;
    fn pc(&self) -> usize;
    fn opcode(&self) -> u8;
}
Expand description

Trait for interpreter to be able to jump.

Required Methods§

Source

fn relative_jump(&mut self, offset: isize)

Relative jumps does not require checking for overflow

Source

fn absolute_jump(&mut self, offset: usize)

Absolute jumps require checking for overflow and if target is a jump destination from jump table.

Source

fn is_valid_legacy_jump(&mut self, offset: usize) -> bool

Check legacy jump destination from jump table.

Source

fn pc(&self) -> usize

Return current program counter.

Source

fn opcode(&self) -> u8

Instruction opcode

Implementors§