Global

Global

data class Global

Represents a global in a WasmModule.

From the docs:


global ::= {type globaltype, init expr}

Each global stores a single value of the given global type. Its 𝗍𝗒𝗉𝖾 also specifies whether a global is immutable or mutable. Moreover, each global is initialized with an 𝗂𝗇𝗂𝗍 value given by a constant initializer expression.

Globals are referenced through global indices, starting with the smallest index not referencing a global import.

Fields

Name Description
val id: Global
val globalType: GlobalType
val initExpression: Expression

Constructors

<init>

constructor(id: Global, globalType: GlobalType, initExpression: Expression)

Represents a global in a WasmModule.

From the docs:


global ::= {type globaltype, init expr}

Each global stores a single value of the given global type. Its 𝗍𝗒𝗉𝖾 also specifies whether a global is immutable or mutable. Moreover, each global is initialized with an 𝗂𝗇𝗂𝗍 value given by a constant initializer expression.

Globals are referenced through global indices, starting with the smallest index not referencing a global import.

Parameters

Name Description
id: Global
globalType: GlobalType
initExpression: Expression

Extensions

validate

fun Global.validate(context: Module): Module

Validates the Global node.

Receiver

Name Description
Global

Parameters

Name Description
context: Module

ReturnValue

Name Description
Module