https://bugs.webkit.org/show_bug.cgi?id=189353
Reviewed by Mark Lam.
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235778
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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 Mark Lam.
+
+ 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-08-31 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Clean up StructureStubClearingWatchpoint
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()
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