Kwasm.ast.instruction
package kwasm.ast.instruction
Classes
Name | Description |
---|---|
sealed class ControlInstruction
|
Base class for all control Instruction implementations. From the docs: Structured control instructions can bind an optional symbolic label identifier. The same label
identifier may optionally be repeated after the corresponding
All other control instruction are represented verbatim.
Note The side condition stating that the identifier context |
data class Expression
|
Representation of an "expression" in WASM. According to the docs, an Expression is a possibly-empty list of Instructions. |
interface Instruction
|
Base for all instruction AstNode implementations. |
interface BlockInstruction
|
Base for all instruction AstNode implementations which are "block" instructions. |
interface MarkerInstruction
|
Represents a marker (either start or end) of a flattened BlockInstruction. |
interface BlockStart
|
Marker of the start of a flattened BlockInstruction. The endPosition is used to know which instruction should be jumped-to when leaving the BlockInstruction. |
interface BlockEnd
|
Marker of the end of BlockInstruction, during execution, the startPosition should be used to locate the start of the block which is then used to locate the first instruction after the original BlockInstruction (may not always be the next instruction after a BlockEnd, for example, the BlockEnds used for each branch of an if instruction). |
interface Argument
|
Defines an AstNode which represents an argument to an Instruction. |
class MemArg
|
Represents an Argument to a memory Instruction. From the docs: The offset and alignment immediates to memory instructions are optional. The offset
defaults to |
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 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.
|
sealed class NumericConstantInstruction
|
Base for all numeric Constant implementations. See the docs for more information. |
sealed class NumericInstruction
|
Defines the various numeric Instruction variants. See more in the docs. |
sealed class ParametricInstruction
|
Defines the various parametric Instruction variants. See more in the docs. |
sealed class VariableInstruction
|
Base for all variable Instruction implementations. See the docs for more information. |
Methods
flatten
fun List<Instruction>.flatten(startPosition: Int): List<Instruction>
Receiver
Name | Description |
---|---|
List<Instruction>
|
Parameters
Name | Description |
---|---|
startPosition: Int
|
ReturnValue
Name | Description |
---|---|
List<Instruction>
|
Flattens the receiving List of Instructions into a new list, keeping track of the startPosition and appropriately passing it to the children, so that BlockStart and BlockEnd instances can be created correctly.