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§
Sourcefn relative_jump(&mut self, offset: isize)
fn relative_jump(&mut self, offset: isize)
Relative jumps does not require checking for overflow
Sourcefn absolute_jump(&mut self, offset: usize)
fn absolute_jump(&mut self, offset: usize)
Absolute jumps require checking for overflow and if target is a jump destination from jump table.
Sourcefn is_valid_legacy_jump(&mut self, offset: usize) -> bool
fn is_valid_legacy_jump(&mut self, offset: usize) -> bool
Check legacy jump destination from jump table.