官术网_书友最值得收藏!

WebAssembly store and object caches

Before digging into interactions, let's discuss the relationship between JavaScript and WebAssembly in the context of execution. The Core Specification contains the following description in the Execution section:

"WebAssembly code is executed when instantiating a module or invoking an exported function on the resulting module instance.

Execution behavior is defined in terms of an abstract machine that models the program state. It includes a stack, which records operand values and control constructs, and an abstract store containing global state."

Under the hood, JavaScript uses something called agents to manage execution. The store being referred to in the definition is contained within an agent. The following diagram represents a JavaScript agent:

JavaScript agent elements

The store represents the state of the abstract machine. WebAssembly operations take a store and return an updated store. Each agent is associated with caches that map JavaScript objects to WebAssembly addresses. So why is this important? It represents the underlying method of interaction between WebAssembly modules and JavaScript. The JavaScript objects correspond to the WebAssembly namespace within the JavaScript API. With that in mind, let's dig into the interface.

主站蜘蛛池模板: 宜丰县| 天长市| 石狮市| 图木舒克市| 固始县| 汨罗市| 秭归县| 拜泉县| 大安市| 洛南县| 祥云县| 陆河县| 灯塔市| 富平县| 南阳市| 华阴市| 长汀县| 阿巴嘎旗| 离岛区| 青神县| 宝坻区| 八宿县| 绩溪县| 仪陇县| 宾川县| 格尔木市| 东阿县| 威海市| 鄱阳县| 恩施市| 如东县| 张北县| 黄浦区| 南溪县| 乐陵市| 亳州市| 建昌县| 呼和浩特市| 安溪县| 新竹市| 桓仁|