pub enum ControlFlow<'a> {
Assign(SmallVec<[DataValue; 1]>),
Continue,
ContinueAt(Block, SmallVec<[DataValue; 1]>),
Call(&'a Function, SmallVec<[DataValue; 1]>),
ReturnCall(&'a Function, SmallVec<[DataValue; 1]>),
Return(SmallVec<[DataValue; 1]>),
Trap(CraneliftTrap),
}Expand description
Enumerate the ways in which the control flow can change based on a single step in a Cranelift interpreter.
Variants§
Assign(SmallVec<[DataValue; 1]>)
Return one or more values from an instruction to be assigned to a left-hand side, e.g.:
in v0 = iadd v1, v2, the sum of v1 and v2 is assigned to v0.
Continue
Continue to the next available instruction, e.g.: in nop, we expect to resume execution
at the instruction after it.
ContinueAt(Block, SmallVec<[DataValue; 1]>)
Jump to another block with the given parameters, e.g.: in
brif v0, block42(v1, v2), block97, if the condition is true, we continue execution at the
first instruction of block42 with the values in v1 and v2 filling in the block
parameters.
Call(&'a Function, SmallVec<[DataValue; 1]>)
Indicates a call the given Function with the supplied arguments.
ReturnCall(&'a Function, SmallVec<[DataValue; 1]>)
Indicates a tail call to the given Function with the supplied arguments.
Return(SmallVec<[DataValue; 1]>)
Return from the current function with the given parameters, e.g.: return [v1, v2].
Trap(CraneliftTrap)
Stop with a program-generated trap; note that these are distinct from errors that may occur during interpretation.