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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 12 23:44:31 PST 2022


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

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

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

The direction looks good. I think we need to avoid copying data, but if it is done, the patch looks good to me

> Source/WebCore/bindings/js/ScriptController.cpp:247
> +    const bool isWasmModule = jsDynamicCast<WebAssemblyModuleRecord*>(vm, &moduleRecord);

Use `moduleRecord.inherits<WebAssemblyModuleRecord>(vm)`.

> Source/WebCore/bindings/js/WebAssemblyScriptSourceCode.h:49
> +        : m_provider(JSC::WebAssemblySourceProvider::create(cachedScript->resourceBuffer()->copyData(), JSC::SourceOrigin { cachedScript->response().url(), WTFMove(scriptFetcher) }, cachedScript->response().url().string()))

Can we avoid copying data here? We should do similarly to CachedScriptSourceProvider.
Without that, we will use much more memory.

> Source/WebCore/bindings/js/WebAssemblyScriptSourceCode.h:56
> +        : m_provider(JSC::WebAssemblySourceProvider::create(source->copy()->extractData(), JSC::SourceOrigin { url, WTFMove(scriptFetcher) }, url.string()))

Can we avoid extracting data? I think we should do similarly to ScriptBufferSourceProvider.

> Source/WebCore/platform/MIMETypeRegistry.cpp:500
> +bool MIMETypeRegistry::isSupportedWebAssemblyMIMEType(const String& mimeType)
> +{
> +    return equalLettersIgnoringASCIICase(mimeType, "application/wasm");
> +}

This looks good. We should replace FetchResponse::hasWasmMIMEType's implementation with the one using this function.

-- 
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/20220213/20be314c/attachment.htm>


More information about the webkit-unassigned mailing list