⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 102185 in webkit


Ignore:
Timestamp:
Dec 6, 2011, 3:38:37 PM (15 years ago)
Author:
jchaffraix@webkit.org
Message:

Inline RenderObject::view()
https://bugs.webkit.org/show_bug.cgi?id=73733

Reviewed by Darin Adler.

Micro-performance optimization, no change in behavior.

RenderObject::view() is super hot and is taking ~4-5% of the time in some
benchmarks as it is called several hundred thousands times. For some reason,
the compiler did not inline it even though it is very simple in release builds.

  • WebCore.exp.in: Removed RenderObject::view() as it is inlined now.
  • rendering/RenderObject.cpp: Moved the implementation from here ...
  • rendering/RenderView.h:

(WebCore::RenderObject::view): ... to here to avoid a cyclic
dependency between RenderObject and RenderView. Also marked the
function as ALWAYS_INLINE.

  • rendering/RenderObject.h:
  • rendering/svg/RenderSVGResourceContainer.cpp:

Added #include "RenderView.h" as the code checks for view() during repaint.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102183 r102185  
     12011-12-06  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Inline RenderObject::view()
     4        https://bugs.webkit.org/show_bug.cgi?id=73733
     5
     6        Reviewed by Darin Adler.
     7
     8        Micro-performance optimization, no change in behavior.
     9
     10        RenderObject::view() is super hot and is taking ~4-5% of the time in some
     11        benchmarks as it is called several hundred thousands times. For some reason,
     12        the compiler did not inline it even though it is very simple in release builds.
     13
     14        * WebCore.exp.in: Removed RenderObject::view() as it is inlined now.
     15
     16        * rendering/RenderObject.cpp: Moved the implementation from here ...
     17        * rendering/RenderView.h:
     18        (WebCore::RenderObject::view): ... to here to avoid a cyclic
     19        dependency between RenderObject and RenderView. Also marked the
     20        function as ALWAYS_INLINE.
     21
     22        * rendering/RenderObject.h:
     23        * rendering/svg/RenderSVGResourceContainer.cpp:
     24        Added #include "RenderView.h" as the code checks for view() during repaint.
     25
    1262011-12-06  Julien Chaffraix  <jchaffraix@webkit.org>
    227
  • trunk/Source/WebCore/WebCore.exp.in

    r101875 r102185  
    11801180__ZNK7WebCore12RenderObject14enclosingLayerEv
    11811181__ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEbb
    1182 __ZNK7WebCore12RenderObject4viewEv
    11831182__ZNK7WebCore12RenderObject7childAtEj
    11841183__ZNK7WebCore12RenderWidget14windowClipRectEv
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r101753 r102185  
    21232123}
    21242124
    2125 RenderView* RenderObject::view() const
    2126 {
    2127     return toRenderView(document()->renderer());
    2128 }
    2129 
    21302125bool RenderObject::isRooted(RenderView** view)
    21312126{
  • trunk/Source/WebCore/rendering/RenderObject.h

    r101706 r102185  
    517517    virtual void updateDragState(bool dragOn);
    518518
     519    // Inlined into RenderView.h for performance and to avoid a cyclic dependency.
    519520    RenderView* view() const;
    520521
  • trunk/Source/WebCore/rendering/RenderView.h

    r101574 r102185  
    292292
    293293
     294ALWAYS_INLINE RenderView* RenderObject::view() const
     295{
     296    return toRenderView(document()->renderer());
     297}
     298
    294299// Stack-based class to assist with LayoutState push/pop
    295300class LayoutStateMaintainer {
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp

    r101517 r102185  
    2424
    2525#include "RenderSVGShadowTreeRootContainer.h"
     26#include "RenderView.h"
    2627#include "SVGResourcesCache.h"
    2728#include "SVGStyledTransformableElement.h"
Note: See TracChangeset for help on using the changeset viewer.