Added statistics sampling and reporting for JavaScriptCore's RegisterFile and Executa...
authorslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Sep 2010 00:21:43 +0000 (00:21 +0000)
committerslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Sep 2010 00:21:43 +0000 (00:21 +0000)
commit6f80b4132bc1a9854476225185fc89258e253a47
treee2d3f72b182c08e98eb5381fb59c5c9ae54eab82
parent49a802e4c34a9ceacdc0b9aabdce7c578548c494
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.

* JavaScriptCore.exp:
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@67130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/interpreter/RegisterFile.cpp
JavaScriptCore/interpreter/RegisterFile.h
JavaScriptCore/jit/ExecutableAllocator.h
JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
JavaScriptCore/runtime/InitializeThreading.cpp
WebKit/mac/ChangeLog
WebKit/mac/Misc/WebCoreStatistics.mm