JSC: SourceProviderCache is memory hungry.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jan 2013 06:34:03 +0000 (06:34 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jan 2013 06:34:03 +0000 (06:34 +0000)
commit55b71a2485bcbebae20f221a51f477e500f05f82
treedd78d869657009b352b611f2130b1459e6ce933d
parent25d871008f6f4be97ef861b5cf8424744ce5615e
JSC: SourceProviderCache is memory hungry.
<http://webkit.org/b/108029>
<rdar://problem/13094806>

Reviewed by Sam Weinig.

Use fixed-size arrays for SourceProviderCacheItem's lists of captured variables.
Since the lists never change after the object is created, there's no need to keep them in Vectors
and we can instead create the whole cache item in a single allocation.

13.37 MB progression on Membuster3.

* parser/Parser.cpp:
(JSC::::parseFunctionInfo):
* parser/Parser.h:
(JSC::Scope::copyCapturedVariablesToVector):
(JSC::Scope::fillParametersForSourceProviderCache):
(JSC::Scope::restoreFromSourceProviderCache):
* parser/SourceProviderCacheItem.h:
(SourceProviderCacheItemCreationParameters):
(SourceProviderCacheItem):
(JSC::SourceProviderCacheItem::approximateByteSize):
(JSC::SourceProviderCacheItem::usedVariables):
(JSC::SourceProviderCacheItem::writtenVariables):
(JSC::SourceProviderCacheItem::~SourceProviderCacheItem):
(JSC::SourceProviderCacheItem::create):
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/SourceProviderCacheItem.h