Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

New segment encoding - #130

Merged
lars-t-hansen merged 7 commits into
WebAssembly:masterfrom
lars-t-hansen:new-segment-encoding
Dec 16, 2019
Merged

lars-t-hansen merged 7 commits into
WebAssembly:masterfrom
lars-t-hansen:new-segment-encoding

Conversation

@lars-t-hansen

@lars-t-hansen lars-t-hansen commented Nov 21, 2019 •

Copy link
Copy Markdown
Contributor

Resolve TODOs and other outstanding issues; update the overview to the new encoding spec; add forward references to reference-types and multi-memory proposals where appropriate.

Pertains to #116.

@lars-t-hansen

Copy link
Copy Markdown
Contributor Author

@rossberg, ptal and make sure i did not undo any of your work when i merged :-) If it looks OK you can go ahead and merge (I don't think I have privileges).

@rossberg rossberg 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.

LGTM (Sorry for the delay, I was OOO for the last two weeks.)

@lars-t-hansen
lars-t-hansen merged commit 82be3c0 into WebAssembly:master Dec 16, 2019
each segment, if reading the source or writing the destination would
go out of bounds, then instantiation fails at that point. Data that
had already been written for previous (in-bounds) segments stays
written.

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.

While for all other instructions the bounds checks are done before copying/initialization and partial copying does not occur, does partial copying occur for active segment initialization?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each segment is bounds-checked and initialized individually, in-order. If a segment fails a bounds check, previous segments will stay written, but the oob segment will not do any partial write, and the rest of the segments will not be written (immediate trap).

Initialization can be thought of as iteratively doing init -> drop on the active segment declarations. The bounds checking comes precisely from the behaviour of init. In the MVP, by contrast, all segments are bounds-checked before any are written.

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.

Oh, right, partial write does not occur within a segment. Thanks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants