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

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.

主站蜘蛛池模板: 平昌县| 读书| 东台市| 柳州市| 南靖县| 尉犁县| 贵港市| 台安县| 永德县| 盘锦市| 桂阳县| 璧山县| 静宁县| 泉州市| 芜湖县| 洪雅县| 加查县| 五峰| 荣成市| 栖霞市| 海口市| 米易县| 汝州市| 台州市| 泰州市| 合肥市| 巴马| 宝坻区| 祁连县| 鄂托克前旗| 梅州市| 美姑县| 荔浦县| 峡江县| 平定县| 丽江市| 嘉鱼县| 淮阳县| 绥中县| 仁布县| 黑河市|