WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.13k stars 445 forks source link

[interpreter] Support nested invoke/get in test scripts #1590

Open rossberg opened 1 year ago

rossberg commented 1 year ago

Also adds set action to mutate globals. See script.wast for examples.

@titzer, PTAL. Should fix #1568.

This was straightforward to implement, except for the JS conversion, which caused quite some headache because wrapper modules generated for actions on types inexpressible in JS are no longer closed now but need to take their arguments as imports. This is largely untested.

rossberg commented 1 year ago

Okay, JS conversion is completely broken right now. To support multiple imports in Wasm wrappers, the implementation needs a complete refactor. I'll look into it, but might no find time for a little while.

rossberg commented 1 year ago

I did a rewrite of most of the JS converter and it now can handle wrapper modules with an arbitrary number of imports. It also made the code more readable.

rossberg commented 1 year ago

@titzer, are you content with this? If so, can you approve the PR?