Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Add nullref #295

Merged
merged 2 commits into from
May 23, 2022
Merged

Add nullref #295

merged 2 commits into from
May 23, 2022

Conversation

rossberg
Copy link
Member

@rossberg rossberg commented May 4, 2022

Bring back the nullref type.

  • In binary, it's a heaptype encoded as -0x12 (previously used for anyref, now unused).
  • In text, nullref is shorthand for (ref null none), where none is the name for the bottom heap type (chosen as opposite to any).

No changes needed to the interpreter other than supporting it in binary and text format and allowing it in the validator. The rest of the change is merely renaming and reordering.

@rossberg rossberg mentioned this pull request May 4, 2022
@titzer
Copy link
Contributor

titzer commented May 4, 2022

I think it'd be best to avoid reusing the code for anyref just yet., in particular we may want to revisit #271. That introduced a mode where an engine still has to model externref to pass the old spec and also model anyref to pass the GC spec.

@rossberg
Copy link
Member Author

rossberg commented May 5, 2022

@titzer, if you need that mode flag anyway, wouldn't it trivially enable interpreting the code accordingly as well?

@titzer
Copy link
Contributor

titzer commented May 12, 2022

@rossberg I think it will be safer to use a new code to separate this PR (which is completely reasonable) from that other discussion.

@rossberg
Copy link
Member Author

Okay, I changed the code to 0x1b for now, assuming that we'll eventually do a code space cleanup anyway. PTAL.

Copy link
Contributor

@titzer titzer left a comment

Choose a reason for hiding this comment

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

lgtm

@rossberg rossberg merged commit 1a58101 into main May 23, 2022
@rossberg rossberg deleted the nullref branch May 23, 2022 14:15
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