Class BlockInstruction
Base of block instructions.
Assembly: WaaS.Core.dll
View Source
Declaration
public abstract class BlockInstruction : Instruction
Inheritance: System.Object -> WaaS.Models.Instruction
Derived:
WaaS.Models.Block, WaaS.Models.If, WaaS.Models.Loop
Properties
BlockType
View Source
Declaration
public BlockType BlockType { get; }
End
View Source
Declaration
public End End { get; }
ParameterTypes
Types of the values the block takes from the enclosing stack. Available after validation.
View Source
Declaration
public ReadOnlyMemory<ValueType> ParameterTypes { get; }
ResultTypes
Types of the values the block leaves on the enclosing stack. Available after validation.
View Source
Declaration
public ReadOnlyMemory<ValueType> ResultTypes { get; }
Arity
Number of the values a branch to this block carries.
View Source
Declaration
public abstract uint Arity { get; }
Methods
Validate(in ValidationContext)
Validates the instruction.
View Source
Declaration
public override void Validate(in ValidationContext context)
Parameters
| Type | Name |
|---|---|
| WaaS.Models.ValidationContext | context |
PreValidateStackState(in ValidationContext)
Get the number of values to pop and push from the stack to validate stack depth.
View Source
Declaration
public override (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns
System.ValueTuple<System.UInt32,System.UInt32>
Parameters
| Type | Name |
|---|---|
| WaaS.Models.ValidationContext | context |
ValidateStackState(in ValidationContext, ref ValidationBlockStackState)
Simulates stack operations to validate the stack state.
View Source
Declaration
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
| Type | Name |
|---|---|
| WaaS.Models.ValidationContext | context |
| WaaS.Models.ValidationBlockStackState | stackState |
Execute(WasmStackFrame)
Executes the instruction.
View Source
Declaration
public override sealed void Execute(WasmStackFrame current)
Parameters
| Type | Name |
|---|---|
| WaaS.Runtime.WasmStackFrame | current |
InjectDelimiter(BlockDelimiterInstruction)
View Source
Declaration
public virtual void InjectDelimiter(BlockDelimiterInstruction delimiter)
Parameters
| Type | Name |
|---|---|
| WaaS.Models.BlockDelimiterInstruction | delimiter |