[webkit-reviews] review granted: [Bug 219297] [WASM-References] Add table.init : [Attachment 415850] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 10 12:45:03 PST 2020

Yusuke Suzuki <ysuzuki at apple.com> has granted Dmitry <dbezhetskov at igalia.com>'s
request for review:
Bug 219297: [WASM-References] Add table.init

Attachment 415850: Patch


--- Comment #16 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 415850
  --> https://bugs.webkit.org/attachment.cgi?id=415850

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

r=me with one important optimization.

> Source/JavaScriptCore/wasm/WasmInstance.cpp:77
> +    m_passiveElements.resize(m_module->moduleInformation().elementCount());
> +    for (unsigned elementIndex = 0; elementIndex < m_passiveElements.size();
++elementIndex) {
> +	   const auto& element =
> +	   if (element.isPassive())
> +	       m_passiveElements[elementIndex] = element;
> +    }

I think m_passiveElements can be a BitVector, and this is better in terms of
m_module is held by WasmInstance. And we can get corresponding element by
So, only thing we would like to know is that the given passive element is
dropped or not.
Can you change it to save memory? WasmInstance is kept alive so long as wasm
code is running. So saving memory is very important.

> Source/JavaScriptCore/wasm/WasmInstance.h:233
> +    Vector<Optional<Element>> m_passiveElements;

Let's make it BitVector.

More information about the webkit-reviews mailing list