官网: Change History
Multiple values
- Function types allow more than one result.
适配go语言等函数多返回值的特性。 - Block types can be arbitrary function types.
控制块带参数,适配C语言等内联函数的展开。Wasm1.0里调用内联函数使用的是call
指令。
- Function types allow more than one result.
Reference types
- Added
funcref
andexternref
as new value types and respective.
表元素增加新类型。externref
allows modules to hold references to objects provided by the host environment; in other words, you can pass a JavaScript object to your .wasm module. The .wasm module can’t really do much with the object via the type. What’s more important is that the module is holding a reference to a garbage collected object on the JavaScript heap. 持有外部引用,为将来wasm引入GC准备。 参看Upcoming Features and Proposals
- Added
Bulk memory
- New memory instructions:
memory.fill
,memory.init
,memory.copy
,data.drop
.
对应C里的memcpy
,memmove
等,目的提高处理大块内存的性能。Wasm1.0里使用load
,store
指令操作内存,只能处理基本类型的数值。
- New memory instructions:
Multiple table
coming soon