MemoryInstruction

MemoryInstruction

sealed class MemoryInstruction

Base class for all Instructions dealing with memory.

From

the docs:

Instructions in this group are concerned with linear memory.

Memory is accessed with load and store instructions for the different value types. They all take a memory immediate MemArg that contains an address offset and the expected alignment (expressed as the exponent of a power of 2). Integer loads and stores can optionally specify a storage size that is smaller than the bit width of the respective value type. In the case of loads, a sign extension mode sx is then required to select appropriate behavior.

The static address offset is added to the dynamic address operand, yielding a 33 bit effective address that is the zero-based index at which the memory is accessed. All values are read and written in little endian byte order. A trap results if any of the accessed memory bytes lies outside the address range implied by the memory’s current size.


instr  ::= inn.load memarg
           fnn.load memarg
           inn.store memarg
           fnn.store memarg
           inn.load8_sx memarg
           inn.load16_sx memarg
           i64.load32_sx memarg
           inn.store8 memarg
           inn.store16 memarg
           i64.store32 memarg
           memory.size
           memory.grow

Extensions

validate

fun Instruction.validate(context: FunctionBody): FunctionBody

Validates the Instruction.

Receiver

Name Description
Instruction

Parameters

Name Description
context: FunctionBody

ReturnValue

Name Description
FunctionBody