Skip to content
Snippets Groups Projects
Commit c468d12e authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Bug 1703105 - wasm: Add testing utilities for running wasm spec test suite. r=lth

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
parent 3b7739ec
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment