From 4bb8cc2e30240dd477bdb3fa20c16c9208ad7292 Mon Sep 17 00:00:00 2001 From: Kulanthaivel Palanichamy Date: Thu, 6 Sep 2012 17:34:17 -0700 Subject: [WebKit] Make PLD DOM traversal optimization configurable Add board specific configuration to enable/disable PLD DOM traversal optimization Change-Id: I6fccbcff2a51c53ec954af34f0f6d4536f2c4dfb --- Android.mk | 8 ++++++++ Source/WebCore/dom/Document.h | 2 ++ Source/WebCore/dom/Node.h | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/Android.mk b/Android.mk index 59fd131..8faa76b 100644 --- a/Android.mk +++ b/Android.mk @@ -302,6 +302,14 @@ ifeq ($(ENABLE_WEBGL),true) LOCAL_CFLAGS += -DENABLE_WEBGL endif +# PLD based optimizations should be enabled only on Krait platforms +KRAIT_BOARD_PLATFORM_LIST := msm8960 +KRAIT_BOARD_PLATFORM_LIST += msm8974 + +ifeq ($(call is-board-platform-in-list,$(KRAIT_BOARD_PLATFORM_LIST)),true) + LOCAL_CFLAGS += -DENABLE_PLD_DOM_TRAVERSAL +endif + # LOCAL_LDLIBS is used in simulator builds only and simulator builds are only # valid on Linux LOCAL_LDLIBS += -lpthread -ldl diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h index f94ce7a..a51861b 100644 --- a/Source/WebCore/dom/Document.h +++ b/Source/WebCore/dom/Document.h @@ -1434,7 +1434,9 @@ inline Node::Node(Document* document, ConstructionType type) : m_document(document) , m_previous(0) , m_next(0) +#ifdef __ARM_USE_PLD , m_prefetch(0) +#endif , m_renderer(0) , m_nodeFlags(type) , m_previousNode(0) diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h index 886dd88..ad5ee9d 100644 --- a/Source/WebCore/dom/Node.h +++ b/Source/WebCore/dom/Node.h @@ -244,6 +244,7 @@ public: // These low-level calls give the caller responsibility for maintaining the integrity of the tree. void setPreviousSibling(Node* previous) { m_previous = previous; } +#ifdef __ARM_USE_PLD ALWAYS_INLINE void updatePrefetchTarget() { if (m_next) { int skew; @@ -258,6 +259,9 @@ public: } void setPrefetchTarget(Node *prefetch) { m_prefetch = prefetch; } void setNextSibling(Node* next) { m_next = next; updatePrefetchTarget(); } +#else + void setNextSibling(Node* next) { m_next = next; } +#endif void updatePreviousNode() { m_previousNode = traversePreviousNode(); if (m_previousNode) m_previousNode->setNextNode(this); } void updateNextNode() { m_nextNode = traverseNextNode(); if (m_nextNode) m_nextNode->setPreviousNode(this); } void updatePrevNextNodesInSubtree(); @@ -421,10 +425,12 @@ public: Node* traverseNextNodeFastPath() const { prefetchTarget(); return m_nextNode; } ALWAYS_INLINE void prefetchTarget() const { +#ifdef __ARM_USE_PLD if (m_prefetch) { __builtin_prefetch(((char *) m_prefetch)); __builtin_prefetch(((char *) m_prefetch) + 64); } +#endif } Node* lastDescendantNode(bool includeThis = false) const; @@ -736,7 +742,9 @@ private: Document* m_document; Node* m_previous; Node* m_next; +#ifdef __ARM_USE_PLD Node* m_prefetch; +#endif RenderObject* m_renderer; mutable uint32_t m_nodeFlags; Node* m_previousNode; -- cgit v1.1