struct State<'i> {
pub global_map: GlobalMap,
pub stack_frame: StackFrame<'i>,
pub stack: Vec<StackFrame<'i>>,
pub memory: Memory,
pub ir: &'i TranslationUnit,
}
Fields§
§global_map: GlobalMap
Maps each global variable to a pointer value.
When a function call occurs, registers
can be initialized by global_registers
stack_frame: StackFrame<'i>
§stack: Vec<StackFrame<'i>>
§memory: Memory
§ir: &'i TranslationUnit
Implementations§
Source§impl<'i> State<'i>
impl<'i> State<'i>
fn new( ir: &'i TranslationUnit, args: Vec<Value>, ) -> Result<State<'i>, InterpreterError>
fn alloc_global_variables(&mut self) -> Result<(), InterpreterError>
fn alloc_local_variables(&mut self) -> Result<(), InterpreterError>
fn write_args( &mut self, bid_init: BlockId, args: Vec<Value>, ) -> Result<(), InterpreterError>
fn step(&mut self) -> Result<Option<Value>, InterpreterError>
fn run(&mut self) -> Result<Value, InterpreterError>
fn interp_args( &self, signature: &FunctionSignature, args: &[Operand], ) -> Result<Vec<Value>, InterpreterError>
fn interp_jump( &mut self, arg: &JumpArg, ) -> Result<Option<Value>, InterpreterError>
fn interp_block_exit( &mut self, block_exit: &BlockExit, ) -> Result<Option<Value>, InterpreterError>
fn interp_instruction( &mut self, instruction: &Instruction, ) -> Result<(), InterpreterError>
fn interp_operand(&self, operand: &Operand) -> Result<Value, InterpreterError>
fn interp_constant(&self, value: Constant) -> Value
fn interp_ptr( &mut self, pointer: &Value, ) -> Result<(usize, isize, Dtype), InterpreterError>
Trait Implementations§
impl<'i> StructuralPartialEq for State<'i>
Auto Trait Implementations§
impl<'i> Freeze for State<'i>
impl<'i> RefUnwindSafe for State<'i>
impl<'i> Send for State<'i>
impl<'i> Sync for State<'i>
impl<'i> Unpin for State<'i>
impl<'i> UnwindSafe for State<'i>
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
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>
Converts
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>
Converts
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