Skip to main content

Class Instruction

Represents a single instruction in a WebAssembly function body.

Assembly: WaaS.Core.dll
View Source
Declaration
public abstract class Instruction

Derived:

Expand

Properties

Index

Index of the instruction in the function body.

View Source
Declaration
public uint Index { get; }

Methods

Execute(WasmStackFrame)

Executes the instruction.

View Source
Declaration
public abstract void Execute(WasmStackFrame current)
Parameters
TypeName
WaaS.Runtime.WasmStackFramecurrent

PreValidateStackState(in ValidationContext)

Get the number of values to pop and push from the stack to validate stack depth.

View Source
Declaration
public abstract (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns

System.ValueTuple<System.UInt32,System.UInt32>

Parameters
TypeName
WaaS.Models.ValidationContextcontext

ValidateStackState(in ValidationContext, ref ValidationBlockStackState)

Simulates stack operations to validate the stack state.

View Source
Declaration
public abstract void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
TypeName
WaaS.Models.ValidationContextcontext
WaaS.Models.ValidationBlockStackStatestackState

Validate(in ValidationContext)

Validates the instruction.

View Source
Declaration
public virtual void Validate(in ValidationContext context)
Parameters
TypeName
WaaS.Models.ValidationContextcontext