Class Instruction
Represents a single instruction in a WebAssembly function body.
Assembly: WaaS.Core.dll
View Source
public abstract class Instruction
Derived:
Expand
WaaS.Models.BinaryBoolInstruction<TValue, TValueType>, WaaS.Models.BinaryInstruction<TValue, TValueType>, WaaS.Models.BlockDelimiterInstruction, WaaS.Models.BlockInstruction, WaaS.Models.Br, WaaS.Models.BrIf, WaaS.Models.BrTable, WaaS.Models.Call, WaaS.Models.CallIndirect, WaaS.Models.Const<TValue, TValueType>, WaaS.Models.Drop, WaaS.Models.GlobalGet, WaaS.Models.GlobalSet, WaaS.Models.Load<TValue, TValueType, TReadValue>, WaaS.Models.LocalGet, WaaS.Models.LocalSet, WaaS.Models.LocalTee, WaaS.Models.MemoryCopy, WaaS.Models.MemoryFill, WaaS.Models.MemoryGrow, WaaS.Models.MemorySize, WaaS.Models.Nop, WaaS.Models.Return, WaaS.Models.Select, WaaS.Models.Store<TValue, TValueType, TWriteValue>, WaaS.Models.UnaryBoolInstruction<TValue, TValueType>, WaaS.Models.UnaryInstruction<TValue, TValueType>, WaaS.Models.UnaryInstruction<TValue1, TValueType1, TValue2, TValueType2>, WaaS.Models.Unreachable
Properties
Index
Index of the instruction in the function body.
View Source
public uint Index { get; }
Methods
Execute(WasmStackFrame)
Executes the instruction.
View Source
public abstract void Execute(WasmStackFrame current)
Parameters
Type | Name |
---|---|
WaaS.Runtime.WasmStackFrame | current |
PreValidateStackState(in ValidationContext)
Get the number of values to pop and push from the stack to validate stack depth.
View Source
public abstract (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
public abstract void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |
WaaS.Models.ValidationBlockStackState | stackState |
Validate(in ValidationContext)
Validates the instruction.
View Source
public virtual void Validate(in ValidationContext context)
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |