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

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.

主站蜘蛛池模板: 新疆| 毕节市| 文化| 蛟河市| 海淀区| 澳门| 三亚市| 云梦县| 遵义市| 鹤岗市| 柏乡县| 平南县| 漠河县| 五莲县| 留坝县| 离岛区| 抚顺市| 洛宁县| 当阳市| 大同县| 赣榆县| 革吉县| 云霄县| 常山县| 海丰县| 隆林| 怀远县| 无棣县| 余干县| 田东县| 五莲县| 赤峰市| 霞浦县| 山西省| 巩留县| 乐东| 大英县| 宜州市| 霞浦县| 荆州市| 宝应县|