Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Remove funcref as a subtype of anyref #85

Merged
merged 7 commits into from
May 9, 2020

Conversation

eqrion
Copy link
Contributor

@eqrion eqrion commented May 5, 2020

This is the equivalent of the syntax changes in WebAssembly/reference-types/pull/87. I have a corresponding patch in SpiderMonkey that tests this out with the semantics changes as well.

It may be good to hold off on merging this until the upstream PR is closer to merging, to track any changes. I'm posting this now to just get ready for when that is.

eqrion added 2 commits May 5, 2020 13:33
No functional changes. This will help parsing of type-immediate
ref.null and ref.is_null. Eventually we may be able to combine
TableElemType with RefType as well.
crates/wast/src/ast/types.rs Outdated Show resolved Hide resolved
#[allow(missing_docs)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)]
pub enum RefType<'a> {
Func,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a few comments to the variants here? The first two I think are reference-types proposal types, the next is exception handling, and everything else is the gc proposal, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the case. I've added some comments explaining the types.

parser.parse::<kw::r#extern>()?;
Ok(RefType::Extern)
} else if l.peek::<kw::any>() {
parser.parse::<kw::any>()?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any old tests using (ref any) after everything is renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there shouldn't really be any. Might be some in wabt, but they'll update at some point. I've removed the alias for this form.

@eqrion eqrion force-pushed the subtype branch 2 times, most recently from d7bff68 to c5ef489 Compare May 5, 2020 19:11
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a new file accidentally snuck in but otherwise with the upstream spec now merged I think we can go ahead and land this.

&#39; Outdated Show resolved Hide resolved
eqrion added 5 commits May 8, 2020 20:13
The type uses the formal reference-types production, so it's `ref.null
any` not `ref.null anyref`.

The elem segment parser also had to be updated to check the type of
ref.null used is compatible with the element segment type. This is
tricky with subtypes, so for now it just does strict equality.
`anyref` is going to be a tricky thing to rename, if even possible. For
now an alias seems to be reasonable.
This is unfortunate, but I don't see a way around it if we want to not
be blocked on wabt. At the least, we do have extensive test coverage in
spidermonkey for these testsuites that will continue.
@eqrion
Copy link
Contributor Author

eqrion commented May 9, 2020

Yes, let's merge this and get a new version when you get a chance!

@alexcrichton alexcrichton merged commit 22bf1b4 into bytecodealliance:master May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants