WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-101277-20121106124421.patch (text/plain), 5.65 KB, created by
Elliott Sprehn
on 2012-11-06 12:46:09 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Elliott Sprehn
Created:
2012-11-06 12:46:09 PST
Size:
5.65 KB
patch
obsolete
>Subversion Revision: 133510 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f64a140d890a41798b6de696f9cb130c5312fad4..659fe765fd3031e092b217fe47721e25946336b1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,36 @@ >+2012-11-06 Elliott Sprehn <esprehn@chromium.org> >+ >+ Remove branch from inside RenderObject::view now that renderer() is more expensive >+ https://bugs.webkit.org/show_bug.cgi?id=101277 >+ >+ Reviewed by Eric Seidel. >+ >+ It was observed in Bug 100057 that calling renderer() repeatedly now that it has a branch >+ can be a performance regression. Now that we no longer keep a separate pointer for rare data >+ in Document, we can use that space for a pointer to the RenderView making RenderObject::view() >+ faster and removing the branch. >+ >+ This is a 1% improvement on Parser/html5-full-render.html >+ >+ This also cleans up the code because it turns out we don't need to have RenderObject::view() in >+ RenderView.h because we can just call Document::renderView() and not do toRenderView. This makes >+ it easier to find this method as it exists in the right header file now. >+ >+ No new tests, this is just a refactor. >+ >+ * WebCore.exp.in: Remove export of Document::renderView since it's inline now. >+ * dom/Document.cpp: >+ (WebCore::Document::Document): >+ (WebCore::Document::setRenderer): >+ (WebCore): >+ * dom/Document.h: >+ (WebCore::Document::renderView): >+ (Document): >+ * rendering/RenderObject.h: >+ (WebCore::RenderObject::view): >+ * rendering/RenderView.h: >+ (WebCore): >+ > 2012-11-05 Genevieve Mak <gmak@rim.com> > > [BLACKBERRY] Update touch code to reflect touch refactor >diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in >index f6d186d4e065f0311899fd763bcd0537fe444faf..a48aec3ec0fcf193dc8ae49465bf96fa19f764aa 100644 >--- a/Source/WebCore/WebCore.exp.in >+++ b/Source/WebCore/WebCore.exp.in >@@ -1447,7 +1447,6 @@ __ZNK7WebCore7IntRect10intersectsERKS0_ > __ZNK7WebCore7IntRect8containsERKS0_ > __ZNK7WebCore7IntRectcv6CGRectEv > __ZNK7WebCore7RunLoop9TimerBase8isActiveEv >-__ZNK7WebCore8Document10renderViewEv > __ZNK7WebCore8Document11completeURLERKN3WTF6StringE > __ZNK7WebCore8Document13axObjectCacheEv > __ZNK7WebCore8Document13nodesFromRectEiijjjjbb >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 638859401e0e03cd0dfc32ec442df3e724127b49..0d6affb5382df2b158e62e7ab0039bf5166cb8a3 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -478,6 +478,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) > , m_isViewSource(false) > , m_sawElementsInKnownNamespaces(false) > , m_isSrcdocDocument(false) >+ , m_renderView(0) > , m_eventQueue(DocumentEventQueue::create(this)) > , m_weakReference(DocumentWeakReference::create(this)) > , m_idAttributeName(idAttr) >@@ -2049,6 +2050,12 @@ void Document::clearStyleResolver() > m_styleResolver.clear(); > } > >+void Document::setRenderer(RenderObject* renderer) >+{ >+ m_renderView = toRenderView(renderer); >+ Node::setRenderer(renderer); >+} >+ > void Document::attach() > { > ASSERT(!attached()); >@@ -2193,11 +2200,6 @@ void Document::resumeActiveDOMObjects() > #endif > } > >-RenderView* Document::renderView() const >-{ >- return toRenderView(renderer()); >-} >- > void Document::clearAXObjectCache() > { > // clear cache in top document >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index aa5d3d841b223856324e2e8ae544e720227b7179..4aa47b4000058d0c39c0da3efac59d90c1daab3b 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -556,7 +556,8 @@ public: > > RenderArena* renderArena() { return m_renderArena.get(); } > >- RenderView* renderView() const; >+ RenderView* renderView() const { return m_renderView; } >+ void setRenderer(RenderObject*); > > void clearAXObjectCache(); > AXObjectCache* axObjectCache() const; >@@ -1425,6 +1426,7 @@ private: > bool m_sawElementsInKnownNamespaces; > bool m_isSrcdocDocument; > >+ RenderView* m_renderView; > RefPtr<DocumentEventQueue> m_eventQueue; > > RefPtr<DocumentWeakReference> m_weakReference; >diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h >index 8a5781966ae0c90c79b7b4bf43419f7cb56c1883..67a4d37964544c355dc773aadb0fd7d2ad231662 100644 >--- a/Source/WebCore/rendering/RenderObject.h >+++ b/Source/WebCore/rendering/RenderObject.h >@@ -615,8 +615,7 @@ public: > > virtual void updateDragState(bool dragOn); > >- // Inlined into RenderView.h for performance and to avoid a cyclic dependency. >- RenderView* view() const; >+ RenderView* view() const { return document()->renderView(); }; > > // Returns true if this renderer is rooted, and optionally returns the hosting view (the root of the hierarchy). > bool isRooted(RenderView** = 0) const; >diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h >index 084d7d5a7cf88dfece7325a6a115e20ffe2c8004..fe28e5551cd5ef6557cbe1acc86e4073b7286652 100644 >--- a/Source/WebCore/rendering/RenderView.h >+++ b/Source/WebCore/rendering/RenderView.h >@@ -352,12 +352,6 @@ inline const RenderView* toRenderView(const RenderObject* object) > // This will catch anyone doing an unnecessary cast. > void toRenderView(const RenderView*); > >- >-ALWAYS_INLINE RenderView* RenderObject::view() const >-{ >- return toRenderView(document()->renderer()); >-} >- > // Stack-based class to assist with LayoutState push/pop > class LayoutStateMaintainer { > WTF_MAKE_NONCOPYABLE(LayoutStateMaintainer);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 101277
:
172438
| 172632