-
Notifications
You must be signed in to change notification settings - Fork 472
Implement tables & multiple memories #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
What is the plan with the |
Excellent question. I meant to merge everything into binary-0xc eventually. But I'm still cleaning up the stack branch somewhat, and I suppose reviewing it may also take some time. So I didn't want everything else to block on that. Guess that means that I gonna have a merge-conflict fest at some point... |
In the tests it looks like |
See the first comment above. ;) |
Ok, sorry, I thought it was just about tables. |
The s-expr changes lgtm |
I think we also need new syntax for importing a tables/memories; we currently use: |
@lukewagner, yes, as noted in the comment, this PR does not yet implement imports/exports (just like the PR #313 for globals). WebAssembly/design#682 is pretty large a change, so I wanted to divide the changes somewhat. |
Any concerns about landing this? |
righto, generally lgtm |
v8x16.shuffle and v8x16.swizzle is now i8x16.shuffle and i8x16.swizzle respectively. Fixed WebAssembly#316.
This updates `basic.tentative.any.js` and `identity.tentative.any.js` tests to use the new instructions (`try_table` and `throw_ref`). In addition to converting existing tests to use the new instruction while maintaining the semantics, I added a new test in `basic.tentative.any.js` that makes use of all four `catch` clause variants to show all catch clauses works well in JS API tests. These new tests reauire `--js-flags=--experimental-wasm-exnref` argument to chrome, which is not currently supported in WPT out of the box. I've instead confirmed these run with chrome web tests infrastructure (https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_tests.md#Running-Web-Tests).
As of WebAssembly/design#682. Still misses import/export abilities.
This changes & extends the S-expression syntax for tables and memories in the following way:
In particular, memory segments are no longer part of the
memory
definition, in anticipation of the ability to import memory. Same for tables. This also mirrors the Wasm section structure more closely.However, it is pretty tedious to count table elements in the common case, so the following shorthand is available:
which pretty much behaves like the previous table syntax.
For symmetry, I introduced the analogous shorthand for memories, which turns out to be useful in tests as well:
where
<size>
is the strings' total length in (rounded up) page units.In the future, we can extend this syntax to name tables and memories, e.g.: