-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fold WTF-8 policy into instructions #46
Conversation
Instead of having e.g. `string.encode_wtf8` taking a policy immediate, just make a separate instruction for each policy. Fixes #35.
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.
No strong feelings either way on the overall concept.
I do notice that part of the motivation given in #35 is outdated: there's a rather concrete plan to refactor ref.as_data
and friends to take a heap type immediate instead of being a whole family of instructions, which is a change in the opposite direction. That said, the same set of reasonings doesn't necessarily apply to both sets of instructions, and I don't think it's important enough to argue about.
As a minor nit, I think we could keep the encoding space a bit less fragmented: we have existing gaps, e.g. 0x94..0x97 and 0xb4..0xbf, that we could fill up before starting several new blocks (0xc0, 0xd0, 0xe0). Doesn't matter much as we'll clean up instruction encodings before finalizing the proposal anyway, so whatever you find convenient is fine.
Instead of having e.g. `string.new_wtf8` that takes an immediate specifying the particular UTF-8 flavor to parse, make one instruction per flavor. See WebAssembly/stringref#46. Bug: v8:12868 Change-Id: I2e9f2735c557b2352b6e75314037e473710d87a9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3892695 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Andy Wingo <wingo@igalia.com> Cr-Commit-Position: refs/heads/main@{#83170}
And rename StringNewReplaceArray to StringNewLossyUTF8Array. Following changes to the stringref proposals (WebAssembly/stringref#46)
Match the V8 implementation (https://chromium-review.googlesource.com/c/v8/v8/+/3892695). See also WebAssembly/stringref#46.
Match the V8 implementation (https://chromium-review.googlesource.com/c/v8/v8/+/3892695). See also WebAssembly/stringref#46.
And rename StringNewReplaceArray to StringNewLossyUTF8Array. Following changes to the stringref proposals (WebAssembly/stringref#46)
Match the V8 implementation (https://chromium-review.googlesource.com/c/v8/v8/+/3892695). See also WebAssembly/stringref#46.
See WebAssembly/stringref#46. This format is already adopted by V8: https://chromium-review.googlesource.com/c/v8/v8/+/3892695. The text format is left unchanged (see #5607 for a discussion on the subject). I have also added support for string.encode_lossy_utf8 and string.encode_lossy_utf8 array (by allowing the replace policy for Binaryen's string.encode_wtf8 instruction).
See WebAssembly/stringref#46. This format is already adopted by V8: https://chromium-review.googlesource.com/c/v8/v8/+/3892695. The text format is left unchanged (see WebAssembly#5607 for a discussion on the subject). I have also added support for string.encode_lossy_utf8 and string.encode_lossy_utf8 array (by allowing the replace policy for Binaryen's string.encode_wtf8 instruction).
Instead of having e.g.
string.encode_wtf8
taking a policy immediate, just make a separate instruction for each policy. Fixes #35.