Struct bytecode_interpreter::concrete::local_state::LocalState
source · pub struct LocalState { /* private fields */ }
Implementations§
source§impl LocalState
impl LocalState
pub fn new(slots: Vec<LocalSlot>) -> Self
sourcepub fn has_value(&self, index: TempIndex) -> bool
pub fn has_value(&self, index: TempIndex) -> bool
Check whether the local slot at index
holds a value
sourcepub fn get_value(&self, index: TempIndex) -> TypedValue
pub fn get_value(&self, index: TempIndex) -> TypedValue
Get the value held in local slot index
. Panics if the slot does not hold a value
sourcepub fn put_value_override(&mut self, index: TempIndex, val: TypedValue)
pub fn put_value_override(&mut self, index: TempIndex, val: TypedValue)
Put the value held in local slot index
. Override if the slot already holds a value
sourcepub fn put_value(&mut self, index: TempIndex, val: TypedValue)
pub fn put_value(&mut self, index: TempIndex, val: TypedValue)
Put the value held in local slot index
. Panics if the slot already holds a value
sourcepub fn del_value(&mut self, index: TempIndex) -> TypedValue
pub fn del_value(&mut self, index: TempIndex) -> TypedValue
Delete the value held in local slot index
. Panics if the slot does not hold a value
sourcepub fn save_destroyed_arg(&mut self, index: TempIndex, val: TypedValue)
pub fn save_destroyed_arg(&mut self, index: TempIndex, val: TypedValue)
Save a mutable argument that is destroyed
sourcepub fn load_destroyed_arg(&mut self, index: TempIndex) -> TypedValue
pub fn load_destroyed_arg(&mut self, index: TempIndex) -> TypedValue
Load a mutable argument that is destroyed
sourcepub fn get_pc(&self) -> CodeOffset
pub fn get_pc(&self) -> CodeOffset
Get the current PC location (i.e., which bytecode to be executed)
sourcepub fn set_pc(&mut self, pc: CodeOffset)
pub fn set_pc(&mut self, pc: CodeOffset)
Set the PC location to jump to on next execution
sourcepub fn ready_pc_for_next_instruction(&mut self)
pub fn ready_pc_for_next_instruction(&mut self)
Decide the PC location for next bytecode instruction
sourcepub fn collect_pointers(&self) -> BTreeMap<TempIndex, &Pointer>
pub fn collect_pointers(&self) -> BTreeMap<TempIndex, &Pointer>
Collect the pointers of the underlying values in the local slots
sourcepub fn transit_to_post_abort(&mut self, info: AbortInfo)
pub fn transit_to_post_abort(&mut self, info: AbortInfo)
Mark that an abort is raised and we will be executing the abort action next
sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Check whether execution of the current function is finished or not
sourcepub fn is_post_abort(&self) -> bool
pub fn is_post_abort(&self) -> bool
Check whether we are executing in a post-abort status
sourcepub fn terminate_with_abort(&mut self, abort_info: AbortInfo)
pub fn terminate_with_abort(&mut self, abort_info: AbortInfo)
Mark that the current function terminated with an abort
sourcepub fn terminate_with_return(&mut self, ret_vals: Vec<TypedValue>)
pub fn terminate_with_return(&mut self, ret_vals: Vec<TypedValue>)
Mark that the current function terminated with return values
sourcepub fn into_termination_status(self) -> TerminationStatus
pub fn into_termination_status(self) -> TerminationStatus
Consume and reduce the state into termination status