Skip to content

wasmparser: Get more GC spec tests passing - #1346

Merged
fitzgen merged 3 commits into
bytecodealliance:mainfrom
fitzgen:br-on-cast
Jan 2, 2024
Merged

fitzgen merged 3 commits into
bytecodealliance:mainfrom
fitzgen:br-on-cast

Conversation

@fitzgen

@fitzgen fitzgen commented Dec 21, 2023

Copy link
Copy Markdown
Member

Newly passing tests:

  • br_on_cast.wast
  • br_on_cast_fail.wast
  • struct.wast

Newly implemented instructions:

  • struct.new
  • struct.get
  • struct.get_s
  • struct.get_u
  • struct.set
  • br_on_cast
  • br_on_cast_fail

@fitzgen
fitzgen requested a review from alexcrichton December 21, 2023 00:39
Newly passing tests:

* `br_on_cast.wast`
* `br_on_cast_fail.wast`
* `struct.wast`

Newly implemented instructions:

* `struct.new`
* `struct.get`
* `struct.get_s`
* `struct.get_u`
* `struct.set`
* `br_on_cast`
* `br_on_cast_fail`
The `extern.wast` test was already passing.

The `ref_eq.wast` test required implementing `ref.eq`, which is very simple.

And now all of the GC spec tests are passing!
@fitzgen

fitzgen commented Dec 21, 2023

Copy link
Copy Markdown
Member Author

Added another commit and now all GC spec tests are passing!

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎊

Comment thread crates/wasm-encoder/src/core/code.rs Resolved
Comment thread crates/wasmparser/src/binary_reader.rs Resolved
Comment thread crates/wasmparser/src/validator/core.rs Resolved
Comment on lines +241 to +244
fn field_index(&mut self, idx: u32) -> Result<()> {
write!(&mut self.printer.result, "{idx}")?;
Ok(())
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would you be up for threading field names through here? (or is there not a subsection of the name custom section to specify field names yet?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is a fields subsection of the name custom section in the spec appendix, but we don't parse it at all in wasmprinter yet. I'd prefer to leave this for a follow up PR.

Comment thread crates/wasmprinter/src/operator.rs Resolved
@fitzgen
fitzgen enabled auto-merge (squash) January 2, 2024 19:02
@fitzgen
fitzgen merged commit 810a98c into bytecodealliance:main Jan 2, 2024
@fitzgen
fitzgen deleted the br-on-cast branch January 3, 2024 16:27
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.

2 participants