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

Rename memory instructions; Rework constant handling #177

Merged
merged 11 commits into from Jul 20, 2018

Conversation

1 participant
@dcodeIO
Copy link
Member

dcodeIO commented Jul 18, 2018

A relatively bulky collection of breaking, but mostly unavoidable, changes.

  • Renamed memory instructions as proposed by the bulk-memory-operations spec:

    • current_memory -> memory.size
    • grow_memory -> memory.grow
    • move_memory -> memory.copy (still polyfilled)
    • set_memory -> memory.fill (still polyfilled)
  • Moved memory management functions to the memory namespace as well:

    • allocate_memory-> memory.allocate
    • free_memory -> memory.free
    • compare_memory -> memory.compare
  • Removed automatic inlining of constant globals and leaves them for Binaryen to decide (see WebAssembly/binaryen#1622)

  • Improved 'const' enum compatibility. In turn can't export non-const enums anymore without mutable-globals explicitly activated

  • Improved module-level export generation so these properly export all relevant nested elements, using the correct topmost name

  • Enabled the @inline decorator for constant variables (for example used for NaN)

  • Added ERROR, WARNING and INFO macros that emit a user-defined diagnostic when encountered

  • Added experimental gc.iterateRoots builtin for potential use by a bundled GC

Feel free to dig through the changeset and point out strange things. It's likely that something broke.

dcodeIO added some commits Jul 18, 2018

Reintroduce builtin decorator so these can appear anywhere in stdlib …
…again

Avoids wrapping an undocumented function within 'memory.size' for example.
Inline isNaN and isFinite
Looking at our existing tests it seems that inlining these can be performed by reusing locals most of the time, and sometimes enables erasing quite a bit of unnecessary code when optimizing.

@dcodeIO dcodeIO force-pushed the breaking-changes branch 5 times, most recently from 202a7e6 to bfc1509 Jul 19, 2018

@dcodeIO dcodeIO force-pushed the breaking-changes branch from bfc1509 to f56face Jul 19, 2018

@dcodeIO dcodeIO merged commit 39b489b into master Jul 20, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@dcodeIO dcodeIO deleted the breaking-changes branch Jul 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment