-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
FF125 WAS multi memory ff125 #32919
FF125 WAS multi memory ff125 #32919
Conversation
@MendyBerger First draft of this done. It's like "minimum viable product". I expect to add more, but I want this in place as a link for the release note which I will craft on Friday. Then hope to go back and look at the other PR for getting sidebar etc. |
@@ -284,45 +284,93 @@ const global = new WebAssembly.Global({ value: "i32", mutable: true }, 0); | |||
|
|||
### WebAssembly Memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @MendyBerger This is the same example, I've just restructured this to more clearly separate the theoretical bits from the example, and the bits about memory vs the logging. Also cross linked to the instructions.
NOTE, some things we can't link to that it would be nice to are: import
, data
, memory
. The last one being the most important - the instruction to actually declare memory. Don't know if you're interested in creating instruction pages for those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to, but unfortunately, I've got limited time right now.
Might have more time in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More than fair enough.
47a2666
to
4503ab7
Compare
@MendyBerger (and @pepelsbey if you want to get involved). We have an FF release next week so it would be great if I could get this reviewed and merged as soon as possible. I am aware that if this goes in it will not be complete, because I still need to update the remaining instructions. But it will have the core information on how to use the feature. I expect to do the remaining work early next week, but would be good to get this looked at before then. |
…llee/content into wasm_multi_memory_ff125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!
Sorry I didn't review until now. Was swamped the last few days, and missed your note about needing it before Friday.
--- | ||
|
||
{{WebAssemblySidebar}} | ||
|
||
The **`load`** instructions, are used to load a number from memory onto the stack. | ||
The **`load`** [memory instructions](/en-US/docs/WebAssembly/Reference/Memory) are used to are used to load a number from memory onto the stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double "are used to"?
Memorry support in WASM modules matches the [`WebAssembly.Memory`](/en-US/docs/WebAssembly/JavaScript_interface/Memory) JavaScript API. | ||
Support for the multiMemory feature is listed below. | ||
|
||
{{Compat}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love what you've done with this page!!
@@ -284,45 +284,93 @@ const global = new WebAssembly.Global({ value: "i32", mutable: true }, 0); | |||
|
|||
### WebAssembly Memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to, but unfortunately, I've got limited time right now.
Might have more time in the future.
|
||
While there are many ways to encode a string's length in the string itself (for example, C strings); for simplicity here we just pass both offset and length as parameters: | ||
Note that when you create the memory you need to define both the initial size, and the maximum size to which the memory can grow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't max size optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Fixed.
Thanks for the review @MendyBerger. I've taken on board your feedback and updated what was there and the remaining instructions. All should be good now - though I did omit examples in Can I get a final review/approval/merge on this @MendyBerger @pepelsbey . There is no doubt more that could be done, but this is a significant update, and would be good to get in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work! Thank you :)
Thanks very much for the reviews! |
This builds on #32917 with more general fixes plus documentation for multi-memory WASM.
So far:
memory
and friendsload
store
grow
size
copy
fill
Associated example here: mdn/webassembly-examples#35
Related docs work tracked in #32777