pub enum Bytecode {
    Assign(AttrIdTempIndexTempIndexAssignKind),
    Call(AttrIdVec<TempIndex>, OperationVec<TempIndex>, Option<AbortAction>),
    Ret(AttrIdVec<TempIndex>),
    Load(AttrIdTempIndexConstant),
    Branch(AttrIdLabelLabelTempIndex),
    Jump(AttrIdLabel),
    Label(AttrIdLabel),
    Abort(AttrIdTempIndex),
    Nop(AttrId),
    SaveMem(AttrIdMemoryLabelQualifiedInstId<StructId>),
    SaveSpecVar(AttrIdMemoryLabelQualifiedInstId<SpecVarId>),
    Prop(AttrIdPropKindExp),
}
Expand description

The stackless bytecode.

Variants

Assign(AttrIdTempIndexTempIndexAssignKind)

Call(AttrIdVec<TempIndex>, OperationVec<TempIndex>, Option<AbortAction>)

Ret(AttrIdVec<TempIndex>)

Load(AttrIdTempIndexConstant)

Branch(AttrIdLabelLabelTempIndex)

Jump(AttrIdLabel)

Label(AttrIdLabel)

Abort(AttrIdTempIndex)

Nop(AttrId)

SaveMem(AttrIdMemoryLabelQualifiedInstId<StructId>)

SaveSpecVar(AttrIdMemoryLabelQualifiedInstId<SpecVarId>)

Prop(AttrIdPropKindExp)

Implementations

Return the destination(s) if self is a branch/jump instruction

Returns a mapping from labels to code offsets.

Return the successor offsets of this instruction. In addition to the code, a map of label to code offset need to be passed in.

Returns the code offsets at which the code exits(aborts or returns).

Remaps variables in the instruction.

Remaps variables in source position in the instruction.

Return the temporaries this instruction modifies and how the temporaries are modified.

For a temporary with TempIndex $t, if $t is modified by the instruction and

  1. $t is a value or an immutable reference, it will show up in the first Vec
  2. $t is a mutable reference and only its value is modified, not the reference itself, it will show up in the second Vec as ($t, false).
  3. $t is a mutable reference and the reference itself is modified (i.e., the location and path it is pointing to), it will show up in the second Vec as ($t, true).

Creates a format object for a bytecode in context of a function target.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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

Compare self to key and return true if they are equal.

Returns the argument unchanged.

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

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.