https://bugs.webkit.org/show_bug.cgi?id=187196
Reviewed by Mark Lam.
This puts VM entry and Wasm entry tracePoints behind a runtime
option. This is a ~4x speedup on a soon to be released Wasm
benchmark. tracePoints should basically never run more than 50
times a second. Entering the VM and entering Wasm are user controlled,
and can happen hundreds of thousands of times in a second. Depending
on how the Wasm/JS code is structured, this can be disastrous for
performance.
* runtime/Options.h:
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunctions):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233378
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2018-06-29 Saam Barati <sbarati@apple.com>
+ Don't use tracePoints in JS/Wasm entry
+ https://bugs.webkit.org/show_bug.cgi?id=187196
+
+ Reviewed by Mark Lam.
+
+ This puts VM entry and Wasm entry tracePoints behind a runtime
+ option. This is a ~4x speedup on a soon to be released Wasm
+ benchmark. tracePoints should basically never run more than 50
+ times a second. Entering the VM and entering Wasm are user controlled,
+ and can happen hundreds of thousands of times in a second. Depending
+ on how the Wasm/JS code is structured, this can be disastrous for
+ performance.
+
+ * runtime/Options.h:
+ * runtime/VMEntryScope.cpp:
+ (JSC::VMEntryScope::VMEntryScope):
+ (JSC::VMEntryScope::~VMEntryScope):
+ * wasm/WasmBBQPlan.cpp:
+ (JSC::Wasm::BBQPlan::compileFunctions):
+ * wasm/js/WebAssemblyFunction.cpp:
+ (JSC::callWebAssemblyFunction):
+
+2018-06-29 Saam Barati <sbarati@apple.com>
+
We shouldn't recurse into the parser when gathering metadata about various function offsets
https://bugs.webkit.org/show_bug.cgi?id=184074
<rdar://problem/37165897>
v(bool, useIntlPluralRules, enableIntlPluralRules, Normal, "If true, we will enable Intl.PluralRules.") \
v(bool, useArrayAllocationProfiling, true, Normal, "If true, we will use our normal array allocation profiling. If false, the allocation profile will always claim to be undecided.") \
v(bool, forcePolyProto, false, Normal, "If true, create_this will always create an object with a poly proto structure.") \
- v(bool, forceMiniVMMode, false, Normal, "If true, it will force mini VM mode on.")
+ v(bool, forceMiniVMMode, false, Normal, "If true, it will force mini VM mode on.") \
+ v(bool, useTracePoints, false, Normal, nullptr)
enum OptionEquivalence {
if (SamplingProfiler* samplingProfiler = vm.samplingProfiler())
samplingProfiler->noticeVMEntry();
#endif
- tracePoint(VMEntryScopeStart);
+ if (Options::useTracePoints())
+ tracePoint(VMEntryScopeStart);
}
vm.clearLastException();
if (m_vm.entryScope != this)
return;
- tracePoint(VMEntryScopeEnd);
+ if (Options::useTracePoints())
+ tracePoint(VMEntryScopeEnd);
if (m_vm.watchdog())
m_vm.watchdog()->exitedVM();
if (!hasWork())
return;
- TraceScope traceScope(WebAssemblyCompileStart, WebAssemblyCompileEnd);
+ std::optional<TraceScope> traceScope;
+ if (Options::useTracePoints())
+ traceScope.emplace(WebAssemblyCompileStart, WebAssemblyCompileEnd);
ThreadCountHolder holder(*this);
size_t bytesCompiled = 0;
}
}
- TraceScope traceScope(WebAssemblyExecuteStart, WebAssemblyExecuteEnd);
+ std::optional<TraceScope> traceScope;
+ if (Options::useTracePoints())
+ traceScope.emplace(WebAssemblyExecuteStart, WebAssemblyExecuteEnd);
Vector<JSValue> boxedArgs;
JSWebAssemblyInstance* instance = wasmFunction->instance();