gwr/exec
Types
pub type BinaryOperationType {
IntegerBinaryOperation(
fn(spec.NumberType, Int, Int) -> Result(Int, trap.Trap),
)
FloatBinaryOperation(
fn(ieee_float.IEEEFloat, ieee_float.IEEEFloat) -> Result(
spec.Value,
trap.Trap,
),
)
}
Constructors
-
IntegerBinaryOperation( fn(spec.NumberType, Int, Int) -> Result(Int, trap.Trap), ) -
FloatBinaryOperation( fn(ieee_float.IEEEFloat, ieee_float.IEEEFloat) -> Result( spec.Value, trap.Trap, ), )
pub type ComparisonOperationType {
IntegerComparisonOperation(
fn(spec.NumberType, Int, Int) -> Result(Int, trap.Trap),
)
FloatComparisonOperation(
fn(ieee_float.IEEEFloat, ieee_float.IEEEFloat) -> Result(
Int,
trap.Trap,
),
)
}
Constructors
-
IntegerComparisonOperation( fn(spec.NumberType, Int, Int) -> Result(Int, trap.Trap), ) -
FloatComparisonOperation( fn(ieee_float.IEEEFloat, ieee_float.IEEEFloat) -> Result( Int, trap.Trap, ), )
pub type ConstValue {
IntegerConstValue(value: Int)
FloatConstValue(value: ieee_float.IEEEFloat)
}
Constructors
-
IntegerConstValue(value: Int) -
FloatConstValue(value: ieee_float.IEEEFloat)
pub type Jump {
Branch(target: List(spec.Instruction))
Return
}
Constructors
-
Branch(target: List(spec.Instruction)) -
Return
pub type State {
State(
module_instance: spec.ModuleInstance,
stack: stack.Stack,
store: spec.Store,
)
}
Constructors
-
State( module_instance: spec.ModuleInstance, stack: stack.Stack, store: spec.Store, )
pub type TestOperationType {
IntegerTestOperation(fn(Int) -> Result(Int, trap.Trap))
FloatTestOperation(
fn(ieee_float.IEEEFloat) -> Result(Int, trap.Trap),
)
}
Constructors
-
IntegerTestOperation(fn(Int) -> Result(Int, trap.Trap)) -
FloatTestOperation( fn(ieee_float.IEEEFloat) -> Result(Int, trap.Trap), )
pub type UnaryOperationType {
IntegerUnaryOperation(
fn(spec.NumberType, Int) -> Result(Int, trap.Trap),
)
FloatUnaryOperation(
fn(ieee_float.IEEEFloat) -> Result(spec.Value, trap.Trap),
)
}
Constructors
-
IntegerUnaryOperation( fn(spec.NumberType, Int) -> Result(Int, trap.Trap), ) -
FloatUnaryOperation( fn(ieee_float.IEEEFloat) -> Result(spec.Value, trap.Trap), )
Values
pub fn address_to_int(address: spec.Address) -> Int
pub fn address_to_string(address: spec.Address) -> String
pub fn append_memory(
to store: spec.Store,
append memory: spec.Memory,
) -> spec.Store
pub fn append_web_assembly_function(
to store: spec.Store,
append function: spec.Function,
using types_list: List(spec.FunctionType),
) -> Result(spec.Store, String)
pub fn builtin_float_to_ieee_float(
value: spec.FloatValue,
) -> ieee_float.IEEEFloat
pub fn enter_with_label(
stack: stack.Stack,
store: spec.Store,
label: spec.Label,
instructions: List(spec.Instruction),
parameters: List(stack.StackEntry),
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_block(
stack: stack.Stack,
store: spec.Store,
block_type: spec.BlockType,
instructions: List(spec.Instruction),
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_br(
stack: stack.Stack,
store: spec.Store,
index: Int,
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_br_if(
stack: stack.Stack,
store: spec.Store,
index: Int,
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_call(
stack: stack.Stack,
store: spec.Store,
index: Int,
) -> Result(#(stack.Stack, spec.Store), trap.Trap)
pub fn evaluate_const(
stack: stack.Stack,
type_: spec.NumberType,
value: ConstValue,
) -> Result(stack.Stack, trap.Trap)
https://webassembly.github.io/spec/core/exec/instructions.html#t-mathsf-xref-syntax-instructions-syntax-instr-numeric-mathsf-const-c
pub fn evaluate_expression(
stack: stack.Stack,
store: spec.Store,
instructions: List(spec.Instruction),
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_iadd(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_iand(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_iclz(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ictz(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_idiv_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_idiv_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ieq(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ieqz(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_iextend16_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_iextend32_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_iextend8_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_if_else(
stack: stack.Stack,
store: spec.Store,
block_type: spec.BlockType,
if_instructions: List(spec.Instruction),
else_: option.Option(spec.Instruction),
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_ige_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ige_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_igt_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_igt_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ile_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ile_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ilt_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ilt_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_imul(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ine(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_invoke(
stack: stack.Stack,
store: spec.Store,
address: spec.Address,
) -> Result(#(stack.Stack, spec.Store), trap.Trap)
pub fn evaluate_ior(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ipopcnt(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_irem_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_irem_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_irotl(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_irotr(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ishl(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ishr_s(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ishr_u(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_isub(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_ixor(
stack: stack.Stack,
type_: spec.NumberType,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_local_get(
stack: stack.Stack,
index: Int,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_local_set(
stack: stack.Stack,
index: Int,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_local_tee(
stack: stack.Stack,
index: Int,
) -> Result(stack.Stack, trap.Trap)
pub fn evaluate_loop(
stack: stack.Stack,
store: spec.Store,
block_type: spec.BlockType,
instructions: List(spec.Instruction),
) -> Result(
#(stack.Stack, spec.Store, option.Option(Jump)),
trap.Trap,
)
pub fn evaluate_return(
stack: stack.Stack,
) -> Result(#(stack.Stack, option.Option(Jump)), trap.Trap)
pub fn evaluate_with_frame(
stack: stack.Stack,
store: spec.Store,
frame: spec.Frame,
instructions: List(spec.Instruction),
) -> Result(#(stack.Stack, spec.Store), trap.Trap)
pub fn exit_with_label(
stack: stack.Stack,
label: spec.Label,
) -> Result(stack.Stack, trap.Trap)
pub fn expand_block_type(
framestate: spec.FrameState,
block_type: spec.BlockType,
) -> Result(spec.FunctionType, trap.Trap)
pub fn ieee_float_to_builtin_float(
value: ieee_float.IEEEFloat,
) -> Result(spec.FloatValue, trap.Trap)
pub fn initialize(
from module: spec.Module,
) -> Result(State, String)
pub fn invoke(
state: State,
address: spec.Address,
arguments: List(spec.Value),
) -> Result(#(State, List(spec.Value)), trap.Trap)
pub fn unwind_stack(
stack: stack.Stack,
) -> Result(stack.Stack, trap.Trap)
pub fn update_references(
from store: spec.Store,
with new_module_instance: spec.ModuleInstance,
) -> spec.Store