angler-fishThe Vulnerability History Project

2010-01-28 Nikolas Zimmermann <nzimmermann@rim.com>

      Reviewed by Dirk Schulze.

        Save additional memory in SVG*Element classes, by introducing SVGElementRareData
        https://bugs.webkit.org/show_bug.cgi?id=34268

        Introduce SVGElementRareData, to remove the need to store any members in SVGElement/SVGStyledElement.
        This saves some additional MB for the svg-node-count-vs-scroll.xhtml testcase.

        SVGElementRareData works just like NodeRareData. Unlike ElementRareData, we're not inheriting from
        NodeRareData in SVG, as we don't need all the rare data stored there, unlike Element.

        * GNUmakefile.am: Add SVGElementRareData.h to build.
        * WebCore.gypi: Ditto.
        * WebCore.pro: Ditto.
        * WebCore.vcproj/WebCore.vcproj: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * dom/Node.cpp: Use Nodes bitfield to keep track wheter a SVGElement has a SVGElementRareData object associated.
        (WebCore::Node::Node):
        * dom/Node.h: Add m_hasRareSVGData flag, merged with the existing bitfield, 10 bits remaining now.
        (WebCore::Node::hasRareSVGData):
        * svg/SVGAnimateMotionElement.cpp: SVGElement::instancesForElement() now returns a const-reference to the HashMap instead of copying.
        (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
        * svg/SVGAnimateTransformElement.cpp: Ditto.
        (WebCore::SVGAnimateTransformElement::applyResultsToTarget):
        * svg/SVGAnimationElement.cpp: Ditto.
        (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
        * svg/SVGElement.cpp: Move the element instances HashSet and two cursor-related pointers into SVGElementRareData.
        (WebCore::SVGElement::SVGElement):
        (WebCore::SVGElement::~SVGElement):
        (WebCore::SVGElement::rareSVGData): Modelled just like Node::rareData().
        (WebCore::SVGElement::ensureRareSVGData): Dito.
        (WebCore::SVGElement::accessDocumentSVGExt
    
commit 715ee841ed9e96f12e16433937cae29cd29ad576
-61
-1
-1
-1
-4
-4
-1
+2 -6
+3 -3
+3 -3
+3 -3
+13 -62
+8 -7
+4 -2
-78
+2 -13
+3 -2
+3 -3
expand_less