Map RootInlineBox to containing region via bit+hashmap.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jan 2014 22:33:08 +0000 (22:33 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jan 2014 22:33:08 +0000 (22:33 +0000)
commit9c263cb147c7c5f05e87853ed26f7fb15381808c
tree8520f98d73fe28148e5f5cca47ada1f3eb4b25f6
parent3074e885ba15cd19415313e399885677c21e2954
Map RootInlineBox to containing region via bit+hashmap.
<https://webkit.org/b/126917>

The vas majority of RootInlineBox objects don't have a containing
RenderRegion, so let's store that in a bit+hashmap configuration
instead of having a dedicated pointer member for it.

148 kB progression on Membuster3.

Reviewed by Antti Koivisto.

* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):

    Added m_hasContainingRegion bit.

(WebCore::containingRegionMap):

    Global map between RootInlineBox and RenderRegion.

(WebCore::RootInlineBox::~RootInlineBox):

    Remove self from aforementioned global map if needed.

(WebCore::RootInlineBox::paint):

    Tweak a condition to avoid double hash lookup.

* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::containingRegion):
(WebCore::RootInlineBox::clearContainingRegion):
(WebCore::RootInlineBox::setContainingRegion):

    Store the containing region in a bit+hashmap.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h