Skip to content

Merge from upstream spec v1.1#148

Merged
binji merged 99 commits intomasterfrom
merge-upstream
Jan 17, 2020
Merged

Merge from upstream spec v1.1#148
binji merged 99 commits intomasterfrom
merge-upstream

Conversation

@binji
Copy link
Copy Markdown
Member

@binji binji commented Jan 16, 2020

Fixes #146.

rossberg and others added 30 commits February 11, 2019 17:31
Caches the generated Wasm buffer instead of re-generating
it for each test.

Refs WebAssembly/spec#972
This speeds up the WasmModuleBuilder enormously. It follows this V8-side
CL: https://crrev.com/c/1508352
It also adopts a few other minor changes to the wasm-module-builder.js
file from the v8 side.
Updating the wasm-module-builder.js broke the jsapi tests. I was under
the impression that travis would run them, but it seems like this is
not the case. Rolling the updated version to v8 failed then:
https://crrev.com/c/1516684

This fixes two things:
1) {toBuffer} returns a Uint8Array as before, not an ArrayBuffer,
2) {addExplicitSection} expects a byte sequence, hence pass the
   truncated buffer instead of the {Binary} object.
The store variable was not defined before it was used, and the result was not
saved.
The full error message generated by the interpreter is "unreachable executed", but all of the other tests check for just "unreachable".
Ms2ger and others added 24 commits September 11, 2019 13:34
…p strings. (#1076)

One test in elem.wast expects the trap message "uninitialized element 7",
which requires wasm runtimes to be able to print the element index. This
is obviously nice for humans, but can be inconvenient to implement in wasm
implementations which use signals to implement traps, as it requires special
code to preserve the element index.

Other tests eg. in imports.wast don't include the number in the expected
message.

It seems better to allow implementations to decide for themselves
whether to print the index number, rather than having it be an outright
requirement of the spec test.
convert_wast_to_js uses multiprocessing to parallelize compilation of
wast test cases. When an error happens, the logging code expects the
result to be a process exit code and a CompletedProcess instance.

This isn't possible, so this commit updates the result to be a
CompletedProcess and modifies the code to manually check the exit code.
I will be taking over Dan's duties as editor.
Similar to #1076, don't include index numbers in expected error messages
from validation. This allows implementations to avoid creating
dynamically formatted strings for validation error messages. Admittedly
this isn't a huge burden, but it does seem like something that shouldn't
be required to pass the spec test.
* Test that INT_MIN/0 gets a divide-by-zero trap.

* Test Unicode characters that differ with NFC, NFD, NFKC, and NFKD.

There are three characters whose normalization forms under NFC, NFD, NFKC,
and NFKD are all different. Test them.

* Add a testcase for unreachable in an if-then with no else.
according to
https://webassembly.github.io/spec/core/exec/instructions.html#exec-return
the `Return` instruction pops the top of the stack, until the next
frame. The equivalent in the reference interpreter should be to set
the value stack to `[]`. This is what is happening for `Break` as well.
So for consistency, also do it here.

This has no visible effect: If the first instruction is `Returning`, the
stack is ignored.
The URL points to latest spec draft so it should be just ECMAScript and not ES2018. This also make it consistent with [WebAssembly JS API Normative Reference](https://www.w3.org/TR/2019/PR-wasm-js-api-1-20191001/#normative)
@binji
Copy link
Copy Markdown
Member Author

binji commented Jan 16, 2020

There were only a few merge conflicts:

  • document/core/appendix/index-instructions.rst: re-aligned the table
  • document/js-api/index.bs:
    • updated init_store => store_init
    • update the Memory.buffer accessor to use **this**
  • interpreter/script/run.ml: trivial merge resolution
  • interpreter/text/arrange.ml:
    • memop function has a sz parameter
    • fix the wat output of RMW instructions (_u comes last)

@binji binji requested a review from rossberg January 16, 2020 22:07
Copy link
Copy Markdown
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@binji binji merged commit 400628e into master Jan 17, 2020
@binji binji deleted the merge-upstream branch January 17, 2020 19:37
@binji
Copy link
Copy Markdown
Member Author

binji commented Jan 17, 2020

Whoops, accidentally pushed this as a squash commit w/ GH UI. I've force-pushed a merge commit instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge conflicts with spec master