WebKit Bugzilla
Attachment 349026 Details for
Bug 189353
: [WebAssembly] Optimize JS to Wasm call by removing Vector allocation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189353-20180907001800.patch (text/plain), 2.54 KB, created by
Yusuke Suzuki
on 2018-09-06 08:18:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-09-06 08:18:01 PDT
Size:
2.54 KB
patch
obsolete
>Subversion Revision: 235736 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 164950e090b54f7769c6b47352761032f026dcc9..1a0dfd4bbc5b42119a0f5bff5ace0d2f487f47ec 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-06 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ [WebAssembly] Optimize JS to Wasm call by removing Vector allocation >+ https://bugs.webkit.org/show_bug.cgi?id=189353 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ JS to Wasm call always allocates Vector for the arguments. This is really costly if the wasm function is small. >+ This patch adds an initial size parameter to the Vector to avoid allocations for small sized arguments. >+ >+ * runtime/ArgList.h: >+ * wasm/js/WebAssemblyFunction.cpp: >+ (JSC::callWebAssemblyFunction): >+ > 2018-09-05 Mark Lam <mark.lam@apple.com> > > JSPropertyNameEnumerator::visitChildren() needs to visit its m_cachedStructureID. >diff --git a/Source/JavaScriptCore/runtime/ArgList.h b/Source/JavaScriptCore/runtime/ArgList.h >index ff4daa6d9418a43e938681723f3980513d3981ac..1ec31a4118842aed6c26af37c93d98219ccb5cdd 100644 >--- a/Source/JavaScriptCore/runtime/ArgList.h >+++ b/Source/JavaScriptCore/runtime/ArgList.h >@@ -34,12 +34,11 @@ class MarkedArgumentBuffer : public RecordOverflow { > friend class VM; > friend class ArgList; > >-private: >+public: > using Base = RecordOverflow; > static const size_t inlineCapacity = 8; > typedef HashSet<MarkedArgumentBuffer*> ListSet; > >-public: > // Constructor for a read-write list, to which you may append values. > // FIXME: Remove all clients of this API, then remove this API. > MarkedArgumentBuffer() >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >index 7b9f590916daac8e4dc18588344029c11ef8721e..02b4c24c42bccf12f823ab079753b05e5a3aa54a 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >@@ -83,7 +83,7 @@ static EncodedJSValue JSC_HOST_CALL callWebAssemblyFunction(ExecState* exec) > if (Options::useTracePoints()) > traceScope.emplace(WebAssemblyExecuteStart, WebAssemblyExecuteEnd); > >- Vector<JSValue> boxedArgs; >+ Vector<JSValue, MarkedArgumentBuffer::inlineCapacity> boxedArgs; > JSWebAssemblyInstance* instance = wasmFunction->instance(); > Wasm::Instance* wasmInstance = &instance->instance(); > // When we don't use fast TLS to store the context, the JS
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mark.lam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189353
: 349026