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.
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
Add new compound Signature, Struct and Array types #3012
Add new compound Signature, Struct and Array types #3012
Changes from 1 commit
927bd6d
e84664f
185f887
415353f
941bde4
37eb81f
f4067bd
5146da2
7299028
a8dce05
e006f21
a41c3d5
2764af7
8e159d1
f1a25a4
1e901fc
34c2b55
b4ffb98
12183ec
e2f3281
fbb0897
cda1056
5ba1afc
8bf1906
eb11e41
3761ed5
7da7012
c2cf485
06cb1a3
dac491d
656f0a3
adb4332
7e46013
8aa4b5d
4ed19aa
fc05734
94e2f61
959aba1
e7eeb50
b72890c
a9affcf
40f3a1a
accd33d
d92e416
e8e111d
9517da1
c20b61f
f6b9f83
0de9d01
0cdc596
85fb78f
cecf38a
fa620d9
9d206af
b8d6faf
fd81477
5d617c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Since
Type
s are small anyway we are either pushing itsuintptr_t
id or an equally sized reference, so that's mostly style, right?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.
Side note: binaryen master is still in a weird state where we've changed anyref to externref, but the other reference types changes haven't yet been applied; in this case, there is no longer any subtyping relationship, so I assume this method needs to be refactored out as part of removing nullref, adding an immediate type tag to
ref.null
, etc.Apologies if this causes issues for folks, I only had spare cycles to do the initial work.
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.
Thanks for the reminder. Plan forward might be:
nullref
, addeqref
,i31ref
and the newanyref
alongside initial handling of the new compound typesref.null
andref.is_null
alongside adding the new GC instructionsThere 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.
That seems good to me. Apologies if it was already top of mind 🤡
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.
cc @aheejin, who I think was planning to make some changes to reflect the current state of reference types. It would be good to coordinate with her on who is going to make what changes.
On topic here, I think it would be best to keep passing the types directly here. The extra indirection of passing a reference (which means the values must be in memory rather than in registers) is unnecessary. The only reason we use
const Type&
foroperator==
and friends is that those are the standard kinds of types used for those operator overloads.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.
I have a half-baked (or, more precisely, quarter-baked) patch for bringing reference types proposal up to date in my local machine, which I started some weeks ago and didn't get around to finish. I'm now trying to pick up the patch.. Do you need that changes for GC? I don't want to block you from proceeding to wait for my patch, but at the same time, I think it is good to add that reference type patch separately from GC and make sure all existing (and to-be-updated) tests the fuzzer pass with reference types proposal, because currently the fuzzer is testing reference type instructions already.
I was away for most of the last week. I was gonna make this change this week, but please let me know if your plan is blocked by this or interfere with this schedule, in which case we can change the plan. I wasn't able to take a look at this patch yet, but I think I'll soon.
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.
The GC proposal restores
anyref
andnullref
, so all we really need to do right now is add anexternref
type. But some current uses ofanyref
might need to useexternref
instead. @aheejin, you'll have a better idea than me whether it's better to rename the currentanyref
toexternref
then add a newanyref
as part of the GC work or to just add a newexternref
to what we already have.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.
I'm confused.
nullref
? After the recent reference type changes, every reference type can be nullified, or in other words, have a null value. Why would we need to restore a separatenullref
type? I think what you quoted is just not up-to-date, no?anyref
;anyref
andexternref
seem to be two separate types.anyref
is a supertype of all reftypes whileexternref
is not.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.
Iiuc there is no
nullref
anymore.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.
Aha, I've been looking at the wrong GC document. Thanks for the clarification, @dcodeIO!