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

Implement data.drop and memory.init and get the rest of the bulk memory spec tests passing #1264

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Mar 9, 2020

This PR adds support for

  • passive data segments
  • the data.drop instruction
  • the memory.init instruction

and gets the final handful of bulk memory spec tests passing. They all pass now!

This adds support for passive data segments and the `memory.init` instruction
from the bulk memory operations proposal. Passive data segments are stored on
the Wasm module and then `memory.init` instructions copy their contents into
memory.
This allows wasm modules to deallocate passive data segments that it doesn't
need anymore. We keep track of which segments have not been dropped on an
`Instance` and when dropping them, remove the entry from the instance's hash
map. The module always needs all of the segments for new instantiations.
This requires special casing an expected error message for an `assert_trap`,
since the expected error message contains the index of an uninitialized table
element, but our trap implementation doesn't save that diagnostic information
and shepherd it out.
@fitzgen fitzgen changed the title Enable the already-passing bulk-memoryoperations/imports.wast test Implement data.drop and memory.init and get the rest of bulk memory passing Mar 9, 2020
@fitzgen fitzgen changed the title Implement data.drop and memory.init and get the rest of bulk memory passing Implement data.drop and memory.init and get the rest of the bulk memory spec tests passing Mar 9, 2020
@alexcrichton alexcrichton merged commit 674a620 into bytecodealliance:master Mar 10, 2020
@fitzgen fitzgen deleted the enable-already-passing-bulk-memory-test branch March 10, 2020 16:39
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