[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:31:34 PST 2022


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

--- Comment #22 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
>> +    }
> 
> 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.

My idea is that, while accessing bytes in wasm compiler, we should retain/lock the underlying `FragmentedSharedBuffer`. So, even while the main thread replaces CachedScript's data, then still the read bytes are valid.
And after reading it, let's release it. So then, it will be destroyed if it is not retained by the other client.

-- 
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/18691c4d/attachment.htm>


More information about the webkit-unassigned mailing list