Implement conversion of test scripts to JavaScript#337
Closed
rossberg wants to merge 11 commits intobinary-0xcfrom
Closed
Implement conversion of test scripts to JavaScript#337rossberg wants to merge 11 commits intobinary-0xcfrom
rossberg wants to merge 11 commits intobinary-0xcfrom
Conversation
Member
Author
|
Extended to also support cross-converting Updated original comment. |
Member
Author
|
Any opposition to landing this and #341 ? Together these patches should enable using ml-proto directly for the same functionality as sexpr2wasm, especially for 0xc tests. |
Contributor
|
lgtm |
Member
Author
|
Conflicts resolved and merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that the interpreter is almost 0xc-complete, this should come in handy.
This patch extends the script language with a couple of meta facilities. The first is quoting of scripts (by wrapping them into
(script <name>? ...)); this binds a script in the same way a module def binds a module. The second is the extension of theoutputcommand to.jstarget files, which converts the referenced script to an equivalent JS runner.More importantly, you can access these facilities with simple command line switches. For example,
will convert a test script to self-contained JavaScript, with all Wasm modules embedded as binary strings.
Caveat: All
invoke's currently become calls directly from JavaScript, no module wrappers. Thus tests involving i64 params/results do not work yet. Will be addressed in a follow-up.[Edit]
Extended to also support converting whole scripts to modified
.wastfiles:When the output file extension is
.bin.wast, then all embedded modules are represented as binary strings, otherwise textual. The only exception are modules in a newly introducedassert_malformedcommand, which retain their original format, since cross-coding is meaningless in that case.The test runner is updated to use this functionality.