[Webkit-unassigned] [Bug 236268] [WebAssembly][Modules] Support Wasm module loading in WebCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 17 23:23:34 PST 2022


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

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

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

> Source/WebCore/bindings/js/WebAssemblyCachedScriptSourceProvider.h:66
> +    const uint8_t* data() override
> +    {
> +        if (!m_buffer)
> +            return nullptr;
> +
> +        if (!m_buffer->isContiguous())
> +            m_buffer = m_buffer->makeContiguous();
> +
> +        return downcast<SharedBuffer>(*m_buffer).data();
> +    }

I have a question. We will load a value from non main thread (see EntryPlan::parseAndValidateModule.). So then, it can happen.

1. We are loading bytes from non main thread via EntryPlan::parseAndValidateModule
2. The main thread will replace underlying data with file-backed resource.

So,

1. How is it protected? Is it OK because m_buffer is keeping the original data alive while parsing?
2. If it is true, when will we release m_buffer's data? Otherwise, we will keep two copy of data.

-- 
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/20220218/8fa296e8/attachment-0001.htm>


More information about the webkit-unassigned mailing list