[Webkit-unassigned] [Bug 219192] [WASM-References] Add support for active mods in element section

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 30 07:09:45 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=219192

--- Comment #7 from Keith Miller <keith_miller at apple.com> ---
Comment on attachment 414886
  --> https://bugs.webkit.org/attachment.cgi?id=414886
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=414886&action=review

overall looks good, but I think we should address the Optional vs sentinel value issue.

> Source/JavaScriptCore/ChangeLog:7
> +        Adjust wasm parser to parse new form of element section.

Nit: We usually put a new line here.

> Source/JavaScriptCore/wasm/WasmFormat.h:250
> +    Vector<Optional<uint32_t>> functionIndices;

Since this is long lived, and could be very large (many modules I've seen have 10k+ functions), we should probably use a sentinel value that's not realistic like UINT_MAX. Right now I think this is doubling the memory of this vector.

> Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:611
> +            if (!element.functionIndices[i].hasValue()) {

Nit: I think you can just do `if (!element.functionIndices[I])`

> Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:-624
> -                    ++elementIndex;

lol we have quality code...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201130/41cdf149/attachment.htm>


More information about the webkit-unassigned mailing list