WebAssembly abstract address
ID: webassembly-abstract-address
A WebAssembly abstract address identifies an allocated runtime entity in the appropriate component of the WebAssembly store. Its kind distinguishes a function, memory, table or other entity. It differs from a module-local index and from an offset into WebAssembly linear memory.[ref]
WebAssembly Core Specification by the W3C WebAssembly Community Group. Execution, Runtime Structure: Addresses and Module Instances
For an original lookup example, let the store's memory at address 0 contain bytes
10,11,12, and its memory at address 1 contain 20,21,22. A WebAssembly module instance maps local memory indices 0,1 to store addresses 1,0. Accessing its local memory index 0 at byte offset 2 therefore gives 22; local memory index 1 at the same offset gives 12.The numerical labels need their context. A memory address 1 and a function address 1 select different store components. Byte offset 1 instead selects a location within an already selected memory. Thus writing down the integer 1 alone does not specify which of these references is intended.
The example uses invented store indices, not host-machine pointers observed from an engine. The specification uses abstract addresses to describe how runtime references resolve. WebAssembly module declarations supply local indices, instantiation establishes their runtime mappings, and memory instructions apply offsets within the selected object.[ref]
WebAssembly Core Specification by the W3C WebAssembly Community Group. Runtime Structure: Store, Addresses and Module Instances
New to topics? Read the docs here!