-
Notifications
You must be signed in to change notification settings - Fork 479
Add import section to modules #54
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
@@ -172,13 +168,13 @@ expr: | |||
( if <expr> <expr> ) ;; = (if <expr> <expr> (nop)) | |||
( loop <expr>* ) ;; = (loop (block <expr>*)) | |||
( label <name>? <expr>* ) ;; = (label (block <expr>*)) | |||
( break <var> <expr>* ) | |||
( break <var> <expr> ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this just be ( break ) now? I believe the expression list was used as a return value to the label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right there a bug here, but, because labels still return a value (this patches changes that from value list
to value option
) this should be (break <var> <expr>?)
.
LGTM |
Thanks for reviewing. I'm inclined to wait for @rossberg-chromium to return before merging, unless he was going to be offline for a while. Anyone know? |
@rossberg-chromium Updated |
Could you do the corresponding change in AstSemantics before merging? The idea sounds fine to me, I just want to make sure the more-oft-observed design repo gets a say in this! |
@jfbastien I was about to say that this PR simply implements what's already in |
LGTM |
Add import section to modules
Revert "Check for invalid extend operation (WebAssembly#64)" This reverts commit eb056c8. Revert "Implement extend instructions in interpreter (WebAssembly#60)" This reverts commit 2f7592b. Revert "Fix naming of `iextend` macro in math.def (WebAssembly#56)" This reverts commit ae08b5e. Revert "Add spec text for extend operators (WebAssembly#54)" This reverts commit a4cb852.
This adds the new operations, as well as the new data and element segment formats. Implemented: * Text parsing/writing * Binary encoding/decoding * Validation TODO: * Tests * DataCount section * Proper encoding of passive element segments (using ref.null etc) * Evaluation
Stack types are contravariant in all their parameters, including the return stack reference.
Merge with upstreams
This patch builds on #53 and implements imports of builtin functions as discussed in #47. The main difference is that, instead of injecting imports into the index space of functions (such that, after importing a function you call it with
(call ...)
, the patch creates a separate index space for imports that are called through a new(call_import ...)
. The reason for this is that I think it makes everything (codegen, spec, impl) simpler.