Class UnaryInstruction<TValue1, TValueType1, TValue2, TValueType2>
Base class for unary operator instructions with different input and output types.
Assembly: WaaS.Core.dll
public abstract class UnaryInstruction<TValue1, TValueType1, TValue2, TValueType2> : Instruction where TValue1 : unmanaged where TValueType1 : struct, IValueType<TValue1> where TValue2 : unmanaged where TValueType2 : struct, IValueType<TValue2>
Inheritance: System.Object -> WaaS.Models.Instruction
Derived:
Expand
WaaS.Models.ConvertI32F32S, WaaS.Models.ConvertI32F32U, WaaS.Models.ConvertI32F64S, WaaS.Models.ConvertI32F64U, WaaS.Models.ConvertI64F32S, WaaS.Models.ConvertI64F32U, WaaS.Models.ConvertI64F64S, WaaS.Models.ConvertI64F64U, WaaS.Models.DemoteF64F32, WaaS.Models.ExtendS, WaaS.Models.ExtendU, WaaS.Models.PromoteF32F64, WaaS.Models.ReinterpretF32I32, WaaS.Models.ReinterpretF64I64, WaaS.Models.ReinterpretI32F32, WaaS.Models.ReinterpretI64F64, WaaS.Models.TruncF32I32S, WaaS.Models.TruncF32I32U, WaaS.Models.TruncF32I64S, WaaS.Models.TruncF32I64U, WaaS.Models.TruncF64I32S, WaaS.Models.TruncF64I32U, WaaS.Models.TruncF64I64S, WaaS.Models.TruncF64I64U, WaaS.Models.WrapI64I32
Methods
Execute(WasmStackFrame)
Executes the instruction.
View Source
public override void Execute(WasmStackFrame current)
Parameters
| Type | Name |
|---|---|
| WaaS.Runtime.WasmStackFrame | current |
Operate(TValue1)
View Source
protected abstract TValue2 Operate(TValue1 value)
Returns
<TValue2>
Parameters
| Type | Name |
|---|---|
<TValue1> | value |
PreValidateStackState(in ValidationContext)
Get the number of values to pop and push from the stack to validate stack depth.
View Source
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
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
| Type | Name |
|---|---|
| WaaS.Models.ValidationContext | context |
| WaaS.Models.ValidationBlockStackState | stackState |