Given a locals signature index, determine the abilities for each signature token. Restricted for
determining abilities at the top-level only. This is reflected in the use of
state.instantiation[..]
as the kind context.
Given a signature token, returns the abilities of this token in the module context, and
instantiation for the function.
Construct a struct from abstract values on the stack
The struct is stored in the register after creation
Whether the function acquires any global resources or not
Check whether the local at index
is of the given availability
Check whether the local at index
exists
Check whether the local at index
has the given ability
Insert the register value into the locals at index
Set the availability of local at index
Put copy of the local at index
in register
Put reference to local at index
in register
TODO: This is a temporary function that represents memory
safety for a reference. This should be removed and replaced
with appropriate memory safety premises when the borrow checking
infrastructure is fully implemented.
index
is Some(i)
if the instruction can be memory safe when operating
on non-reference types.
Dereference the value stored in the register. If the value is not a reference, or
the register is empty, return an error.
Perform a binary operation using the top two values on the stack as operands.
Simulate calling the function at function_index
Pop the number of stack values required to call the function
at function_index
Determine whether the stack is at least of size index
. If the optional abstract_value
argument is some AbstractValue
, check whether the type at index
is that abstract_value.
Determine the abstract value at index
is of the given kind, if it exists.
If it does not exist, return false
.
Determine whether the stack contains an integer value at given index.
Determine whether two tokens on the stack have the same type
Determine whether the stack has a reference at index
with the given mutability.
If mutable
is Either
then the reference can be either mutable or immutable
Determine if a struct (of the given signature) is at the top of the stack
The struct_index
can be Some(index)
to check for a particular struct,
or None
to just check that there is a a struct.
Determine whether an abstract value on the stack and a abstract value in the locals have the
same type
Pop from the top of the stack.
Push given abstract_value to the top of the stack.
Push to the top of the stack from the register.
Push a reference to a register value with the given mutability.
Determine whether an abstract value on the stack that is a reference points to something of the
same type as another abstract value on the stack
Determine whether the function at the given index can be constructed from the values on
the stack.
Determine whether the struct at the given index can be constructed from the values on
the stack.
Note that this function is bidirectional; if there is an instantiation, we check it. Otherwise,
we infer the types that are needed.
Push the field at field_index
of a struct as an AbstractValue
to the stack
Pop the number of stack values required to construct the struct
at struct_index
Push the fields of a struct as AbstractValue
s to the stack
Determine if a struct at the given index is a resource