Added statistics sampling and reporting for JavaScriptCore's RegisterFile and ExecutableAllocator classes
https://bugs.webkit.org/show_bug.cgi?id=45134
Reviewed by Alexey Proskuryakov.
JavaScriptCore:
Added thread-safe committed byte counting and reporting functionality to RegisterFile and
ExecutableAllocator.
Exported new symbols to allow for WebKit to get statistics from JavaScriptCore classes.
- interpreter/RegisterFile.cpp:
(JSC::registerFileStatisticsMutex):
Added function which returns a static Mutex used for locking during read/write access to
static committed byte count variable.
(JSC::RegisterFile::~RegisterFile):
Added call to addToStatistics since memory is decommitted here.
(JSC::RegisterFile::releaseExcessCapacity):
Added call to addToStatistics since memory is decommitted here.
(JSC::RegisterFile::initializeThreading):
Added function which calls registerFileStatisticsMutex().
(JSC::RegisterFile::committedByteCount):
Added function which returns the current committed byte count for RegisterFile.
(JSC::RegisterFile::addToCommittedByteCount):
Added function which updates committed byte count.
- interpreter/RegisterFile.h:
(JSC::RegisterFile::RegisterFile):
Added call to addToStatistics since memory is committed here.
(JSC::RegisterFile::grow):
Added call to addToStatistics since memory is committed here.
- jit/ExecutableAllocator.h:
Added function prototype for public static function committedByteCount().
- jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::FixedVMPoolAllocator::release):
Added call to addToStatistics since memory is decommitted here.
(JSC::FixedVMPoolAllocator::reuse):
Added call to addToStatistics since memory is committed here.
(JSC::FixedVMPoolAllocator::addToCommittedByteCount):
Added function which updates committed byte count.
(JSC::ExecutableAllocator::committedByteCount):
Added function which returns the current committed byte count for ExecutableAllocator.
- runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
Added call to RegisterFile::initializeThreading.
WebKit/mac:
Added ability to enable new JavaScriptCore statistics sampling and reporting for RegisterFile
and ExecutableAllocator classes. Added reporting of JavaScriptCore's stack committed memory
and JIT code committed memory statistics to WebCoreStatistics memoryStatistics.
- Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics memoryStatistics]):
Added statistics reporting for JSC RegisterFile and ExecutableAllocator.