pub struct AbstractState {
    pub instantiation: Vec<AbilitySet>,
    pub module: InstantiableModule,
    pub acquires_global_resources: Vec<StructDefinitionIndex>,
    pub call_graph: CallGraph,
    /* private fields */
}
Expand description

An AbstractState represents an abstract view of the execution of the Move VM. Rather than considering values of items on the stack or in the locals, we only consider their type, represented by a AbstractValue and their availibility, represented by the BorrowState.

Fields

instantiation: Vec<AbilitySet>

A vector of type kinds for any generic function type parameters of the function that we are in.

module: InstantiableModule

The module state

acquires_global_resources: Vec<StructDefinitionIndex>

The global resources acquired by the function corresponding to this abstract state

call_graph: CallGraph

Implementations

Create a new AbstractState with empty stack, locals, and register

Create a new AbstractState given a list of SignatureTokens that will be the (available) locals that the state will have, as well as the module state

Get the register value

Get the register value and set it to None

Set the register value and set it to None

Add a AbstractValue to the stack

Add a AbstractValue to the stack from the register If the register is None return a VMError

Remove an AbstractValue from the stack if it exists to the register If it does not exist return a VMError.

Get the AbstractValue at index index on the stack if it exists. Index 0 is the top of the stack.

Get the length of the stack.

Check if the local at index i exists

Get the local at index i if it exists

Place the local at index i if it exists into the register If it does not exist return a VMError.

Place a reference to the local at index i if it exists into the register If it does not exist return a VMError.

Set the availability of the local at index i If it does not exist return a VMError.

Check whether a local is in a particular BorrowState If the local does not exist return a VMError.

Check whether a local has a particular Ability If the local does not exist return a VMError.

Insert a local at index i as Available

Insert a local at index i as Available from the register If the register value is None return a VMError.

Get all of the locals

Set the abstract state to be aborted when a precondition of an instruction fails. (This will happen if NEGATE_PRECONDITIONs is true).

Whether the state is aborted

Set the abstract state to allow generation of control flow operations.

Predicate determining if control flow instructions can be generated.

The final state is one where the stack is empty

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more