Skip to content
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
Merged

Conversation

dcodeIO
Copy link
Member

@dcodeIO 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 Support constant globals in precompute pass 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.

…again

Avoids wrapping an undocumented function within 'memory.size' for example.
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 Compare July 19, 2018 20:49
@dcodeIO dcodeIO merged commit 39b489b into master Jul 20, 2018
@dcodeIO dcodeIO deleted the breaking-changes branch July 23, 2018 12:25
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.

None yet

1 participant