+15
−11
Loading
This commit adds new utilities for running the wasm spec test suite with
a custom wast2js translator.
The overall approach is to re-use WebAssembly.Global as a tagged
value container so that JS may examine and create these values
in a lossless manner.
Specifically:
* wasmGlobalsEqual - compares two globals for equality
* wasmGlobalToString - debugging util for raw representation details
* wasmGlobalFromArrayBuffer - create a POD value type from bytes
* wasmGlobalExtractLane - extract a lane from a v128 value, as a global
* wasmLosslessInvoke - call a wasm function, taking globals as parameters and
returning globals as results.
See the new test harness [1] for context of how these functions will
be used.
The addition of `wasmLosslessInvoke` causes a slight tweak to the stub
layer so that interpreter entries can pass and receive v128 values. This
functionality is only allowed for `wasmLosslessInvoke` and is guarded
against explicitly.
[1] https://github.com/eqrion/wasm-generate-testsuite/blob/master/wast2js/src/harness.js
Differential Revision: https://phabricator.services.mozilla.com/D111225