CodeBlock::m_argumentValueProfiles wastes a lot of memory.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 16:50:38 +0000 (16:50 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 16:50:38 +0000 (16:50 +0000)
commite8d3889b51a0d1c89f8925dcd2fb3eaa33d263c7
tree5aa195cd21ace50ad51ec649dc9b39e742130319
parent507cf8f4cebdf76e55affcbb959e70ef8be0da31
CodeBlock::m_argumentValueProfiles wastes a lot of memory.
<http://webkit.org/b/118852>
<rdar://problem/14481659>

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

Use Vector::resizeToFit() for CodeBlock::m_argumentValueProfiles. We don't need any padding
for growth, since we won't be appending to it anyway.

921 KB progression on <http://twitter.com/awesomekling>

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setNumParameters):

Source/WTF:

Add Vector::resizeToFit(size), like resize() but without growth padding.

* wtf/Vector.h:
(WTF::::resizeToFit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Vector.h