CSSValuePool: Make numeric value caches fixed-size arrays.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 21:01:56 +0000 (21:01 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 21:01:56 +0000 (21:01 +0000)
commit8a2fc482f5cf4e2573ec5c7e67d173a1615ade4d
treeaaf9eee9ff1f3e77f5891f197ee2750fe90c95d9
parent64f4945dadbe91c5004b95665a69d4f315898360
CSSValuePool: Make numeric value caches fixed-size arrays.
<http://webkit.org/b/84268>

Reviewed by Antti Koivisto.

Change the numeric CSSPrimitiveValue caches in CSSValuePool from HashMaps to
fixed-size arrays of RefPtr<CSSPrimitiveValue>s.

This is more space efficient and doesn't incur the cost of a hash lookup every
time a numeric CSSPrimitiveValue is needed. We retain the limit of caching
only values between 0-255 for now.

* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createValue):
* css/CSSValuePool.h:
(CSSValuePool):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSValuePool.cpp
Source/WebCore/css/CSSValuePool.h