WebAssembly / custom-page-sizes

Other
3 stars 1 forks source link

Fill out the validation and execution sections of the overview #8

Closed fitzgen closed 5 months ago

fitzgen commented 5 months ago

This commit fills out the TODO placeholders for the details of validation and execution in the overview. I think everything here should be pretty much what folks expect. The only surprise, perhaps, is the special casing to disallow growing a memory that has a page size of 1 to length 2**32 - 1 to avoid ambiguities on the result of memory.grow instructions.

I believe I've enumerated everywhere in the spec that page sizes are referenced; actually making the spec changes should be pretty easy after this change. But first, I wanted to get the overview document into a place where it is pretty much complete.

I'll leave this PR up for a few days for folks to comment on and provide feedback.

rossberg commented 5 months ago

The only surprise, perhaps, is the special casing to disallow growing a memory that has a page size of 1 to length 2**32 - 1 to avoid ambiguities on the result of memory.grow instructions.

Wasm does not impose this restriction for tables, which have the exact same problem. We accepted the ambiguity of 0xffff_ffff returned from grow there, so we should be consistent here.

fitzgen commented 5 months ago

Wasm does not impose this restriction for tables, which have the exact same problem. We accepted the ambiguity of 0xffff_ffff returned from grow there, so we should be consistent here.

I didn't think about tables, but you are right! I'll update this PR in a bit to remove that special casing and be consistent.

fitzgen commented 5 months ago

I'll update this PR in a bit to remove that special casing and be consistent.

Done!

fitzgen commented 5 months ago

Alright it's been a few days, going to go ahead and merge this.