Skip to content

Update to latest Binaryen & introduce anyref #800

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 10 commits into from
Sep 10, 2019
Merged

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Aug 29, 2019

This PR moves us to the bleeding edge again by integrating new shiny Binaryen features. In particular:

  • Preliminary support for anyref as an opague type behind the --enable reference-types flag. Still misses checks all over the place to distinguish between an internal (integer) reference and an external (anyref) reference, but passes a simple test for declaring anyref parameters and return types and passing them around. Don't get too excited yet.

  • The atomic.fence instruction

  • Various flags for features the compiler doesn't utilize yet, like nontrapping float to int, exception handling and tail calls.

  • Bindings for the try, throw, rethrow, br_on_exn family of instructions.

  • Event API to declare exception events.

  • Bindings for the push and pop instructions.

  • Bindings for the return_call and return_call_indirect instructions.

  • Bindings for the new qfma/qfms SIMD instructions.

  • Proper ids of the nontrapping float to int instructions.

  • Some early bindings for Reflect and console to showcase the concept of working with anyref.

  • A mechanism to run code pre and post instantiation in tests, e.g. to populate imports

  • Updated tests for the various feature flags

@dcodeIO
Copy link
Member Author

dcodeIO commented Aug 29, 2019

The respective test case now also showcases a bit how working with anyref does work.

As far as I can tell we are still missing

  • ref.null, so we need to import an anyref null value
  • ref.is_null, so we need to import a helper function
  • ref.func, so we can't wrap an internal function
  • ref.eq, so we need to import a helper function

to make this more convenient. Also, without a way to initialize anyref typed globals, like from ref.null, these won't work currently (except if imported).

@jtenner
Copy link
Contributor

jtenner commented Aug 29, 2019

What a time to be alive!

@MaxGraey
Copy link
Member

MaxGraey commented Sep 6, 2019

Hey. It seems this more complex PR than just update binaryen 😃 Probably better rename it? And also create another PR with updated to latest binaryen and new dist files because WebAssembly Studio currently broken

@MaxGraey
Copy link
Member

MaxGraey commented Sep 10, 2019

I guess TODO point (with WebAssembly/binaryen#2317) could be already checked)

@dcodeIO dcodeIO changed the title Update to latest Binaryen Update to latest Binaryen & introduce anyref Sep 10, 2019
@MaxGraey
Copy link
Member

wdyt bump version to 0.8.0?

@MaxGraey
Copy link
Member

wdyt bump version to 0.8.0?

After merge this PR, sin/cos, improved parseFloat and fix for module resolver

@dcodeIO
Copy link
Member Author

dcodeIO commented Sep 10, 2019

wdyt bump version to 0.8.0 after merge this PR, sin/cos, improved parseFloat and fix for module resolver

Sure, why not.

This PR should be good now even with WebAssembly/binaryen#2336 not yet landed (utilizes a constant as a workaround until then).

@dcodeIO dcodeIO requested a review from MaxGraey September 10, 2019 17:20
Copy link
Member

@MaxGraey MaxGraey left a comment

Choose a reason for hiding this comment

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

LGTM

@dcodeIO dcodeIO merged commit 4ad12c1 into master Sep 10, 2019
@dcodeIO dcodeIO deleted the update-binaryen2 branch November 8, 2019 02:00
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.

3 participants