Skip to content

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

Merged
merged 5 commits into from
Sep 15, 2015
Merged

Add import section to modules #54

merged 5 commits into from
Sep 15, 2015

Conversation

lukewagner
Copy link
Member

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.

@lukewagner lukewagner mentioned this pull request Sep 10, 2015
@@ -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> )
Copy link
Member

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.

Copy link
Member Author

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>?).

@kg
Copy link
Contributor

kg commented Sep 11, 2015

LGTM

@lukewagner
Copy link
Member Author

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?

@lukewagner
Copy link
Member Author

@rossberg-chromium Updated

@jfbastien
Copy link
Member

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!

@lukewagner
Copy link
Member Author

@jfbastien I was about to say that this PR simply implements what's already in design (most of the interesting stuff we're discussing, like the overloading, is in host/, not spec/), but I forgot that I did add call_import which should indeed be reflected in AstSemantics.md#call.

@rossberg
Copy link
Member

LGTM

lukewagner added a commit that referenced this pull request Sep 15, 2015
Add import section to modules
@lukewagner lukewagner merged commit 82d273b into master Sep 15, 2015
@lukewagner lukewagner deleted the imports branch September 15, 2015 16:06
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
littledan pushed a commit to littledan/spec that referenced this pull request Mar 4, 2018
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.
eqrion pushed a commit to eqrion/wasm-spec that referenced this pull request Jul 18, 2019
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
alexcrichton pushed a commit to alexcrichton/spec that referenced this pull request Nov 18, 2019
awendland pushed a commit to awendland/webassembly-spec-abstypes that referenced this pull request Mar 26, 2020
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Aug 30, 2024
Stack types are contravariant in all their parameters, including the return
stack reference.
rossberg pushed a commit that referenced this pull request Nov 6, 2024
dhil added a commit to dhil/webassembly-spec that referenced this pull request Dec 3, 2024
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.

5 participants