Add support to collect stats on cumulative LinkBuffer linked sizes based on profiles.
https://bugs.webkit.org/show_bug.cgi?id=225617
Reviewed by Saam Barati.
Source/JavaScriptCore:
There are 2 ways to dump the stats:
- Specify --dumpLinkBufferStats as an argument to the jsc shell.
- Call $vm.dumpLinkBufferStats() from your JS script to get the stats as a string.
e.g.
$vm.print($vm.dumpLinkBufferStats());
Here's an example of what the dump looks like:
Cummulative LinkBuffer profile sizes:
BaselineJIT: 79480320 (75.798340 MB)
DFG: 36108672 (34.435913 MB)
Thunk: 22495360 (21.453247 MB)
InlineCache: 19538521 (18.633386 MB)
FTL: 5186240 (4.945984 MB)
Wasm: 1998272 (1.905701 MB)
YarrJIT: 1331072 (1.269409 MB)
CSSJIT: 0
Uncategorized: 0
The stats are currently grouped into some coarse profiles. If needed, we can
break these down into more fine grain profiles later.
- assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::performFinalization):
(JSC::LinkBuffer::dumpProfileStatistics):
(JSC::LinkBuffer::LinkBuffer):
- bytecode/InlineAccess.cpp:
(JSC::linkCodeInline):
(JSC::InlineAccess::rewireStubAsJump):
- bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
(JSC::FTL::compile):
(JSC::FTL::LazySlowPath::generate):
(JSC::FTL::link):
- ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
- jit/ExecutableAllocator.cpp:
(JSC::jitWriteThunkGenerator):
(JSC::JIT::compileWithoutLinking):
(JSC::JITMathIC::generateOutOfLine):
(JSC::JIT::privateCompileHasIndexedProperty):
(JSC::JIT::privateCompileHasIndexedProperty):
- jit/JITPropertyAccess.cpp:
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutPrivateNameWithCachedId):
(JSC::JIT::privateCompilePutByValWithCachedId):
(JSC::linkPolymorphicCall):
- jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::stringGetByValGenerator):
(JSC::boundFunctionCallGenerator):
(CommandLine::parseArguments):
(jscmain):
(JSC::LLInt::generateThunkWithJumpTo):
(JSC::LLInt::generateThunkWithJumpToPrologue):
(JSC::LLInt::generateThunkWithJumpToLLIntReturnPoint):
(JSC::LLInt::getHostCallReturnValueThunk):
(JSC::LLInt::createJSGateThunk):
(JSC::LLInt::createWasmGateThunk):
(JSC::LLInt::createTailCallGate):
(JSC::LLInt::loopOSREntryGateThunk):
(JSC::LLInt::entryOSREntryGateThunk):
(JSC::LLInt::wasmOSREntryGateThunk):
(JSC::LLInt::exceptionHandlerGateThunk):
(JSC::LLInt::returnFromLLIntGateThunk):
(JSC::LLInt::tagGateThunk):
(JSC::LLInt::untagGateThunk):
(JSC::LLInt::jitCagePtrThunk):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSDollarVM::finishCreation):
(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::didCompleteCompilation):
(JSC::Wasm::wasmToWasm):
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
- wasm/WasmOMGForOSREntryPlan.cpp:
(JSC::Wasm::OMGForOSREntryPlan::work):
(JSC::Wasm::OMGPlan::work):
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGEntryTierUpThunkGenerator):
(JSC::Wasm::wasmToJS):
- wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
Source/WebCore:
- cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):