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

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.

主站蜘蛛池模板: 青浦区| 弥勒县| 英吉沙县| 共和县| 谷城县| 大姚县| 鹤岗市| 惠州市| 会理县| 霍林郭勒市| 沾益县| 石河子市| 南昌市| 江津市| 城固县| 昌吉市| 浮山县| 太谷县| 香河县| 辽宁省| 红河县| 玉林市| 肇庆市| 内黄县| 大庆市| 壶关县| 鲜城| 札达县| 江陵县| 牙克石市| 绥德县| 龙口市| 英吉沙县| 临湘市| 宁化县| 兴山县| 阳泉市| 防城港市| 余姚市| 惠水县| 泰州市|