Func

zio.wasm.Func
final case class Func(typ: TypeIdx, locals: Chunk[ValType], body: Expr)

The funcs component of a module defines a vector of functions with the following structure.

Functions are referenced through function indices, starting with the smallest index not referencing a function import.

Value parameters

body

The body is an instruction sequence that upon termination must produce a stack matching the function type’s result type.

locals

The locals declare a vector of mutable local variables and their types. These variables are referenced through local indices in the function’s body. The index of the first local is the smallest index not referencing a parameter.

typ

The type of a function declares its signature by reference to a type defined in the module. The parameters of the function are referenced through 0-based local indices in the function’s body; they are mutable.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def foldLeftRec[S](initial: S)(f: (S, Instr) => S): S
def mapInstr(f: Instr => Instr): Func

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product