Title: [164677] trunk/Source/WebCore
Revision
164677
Author
[email protected]
Date
2014-02-25 15:17:08 -0800 (Tue, 25 Feb 2014)

Log Message

Remove unused ThreadSpecificInspectorCounters.
<https://webkit.org/b/129337>

We were keeping count of all the JS event listeners in every thread
to support an old Chromium feature that's no longer relevant.

Removing this gets rid of expensive thread-local storage lookups.

Reviewed by Anders Carlsson.

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::JSEventListener):
(WebCore::JSEventListener::~JSEventListener):
* inspector/InspectorCounters.cpp:
* inspector/InspectorCounters.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setDOMCounters):
* inspector/protocol/Timeline.json:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):
* platform/ThreadGlobalData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164676 => 164677)


--- trunk/Source/WebCore/ChangeLog	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/ChangeLog	2014-02-25 23:17:08 UTC (rev 164677)
@@ -1,3 +1,28 @@
+2014-02-25  Andreas Kling  <[email protected]>
+
+        Remove unused ThreadSpecificInspectorCounters.
+        <https://webkit.org/b/129337>
+
+        We were keeping count of all the JS event listeners in every thread
+        to support an old Chromium feature that's no longer relevant.
+
+        Removing this gets rid of expensive thread-local storage lookups.
+
+        Reviewed by Anders Carlsson.
+
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::JSEventListener):
+        (WebCore::JSEventListener::~JSEventListener):
+        * inspector/InspectorCounters.cpp:
+        * inspector/InspectorCounters.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::setDOMCounters):
+        * inspector/protocol/Timeline.json:
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::destroy):
+        * platform/ThreadGlobalData.h:
+
 2014-02-25  Laszlo Vidacs  <[email protected]>
 
         display:table with padding and/or borders in border-box calculates height incorrectly

Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (164676 => 164677)


--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp	2014-02-25 23:17:08 UTC (rev 164677)
@@ -51,16 +51,10 @@
         m_jsFunction = JSC::Weak<JSC::JSObject>(function);
     } else
         ASSERT(!function);
-#if ENABLE(INSPECTOR)
-    ThreadLocalInspectorCounters::current().incrementCounter(ThreadLocalInspectorCounters::JSEventListenerCounter);
-#endif
 }
 
 JSEventListener::~JSEventListener()
 {
-#if ENABLE(INSPECTOR)
-    ThreadLocalInspectorCounters::current().decrementCounter(ThreadLocalInspectorCounters::JSEventListenerCounter);
-#endif
 }
 
 JSObject* JSEventListener::initializeJSFunction(ScriptExecutionContext*) const

Modified: trunk/Source/WebCore/inspector/InspectorCounters.cpp (164676 => 164677)


--- trunk/Source/WebCore/inspector/InspectorCounters.cpp	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorCounters.cpp	2014-02-25 23:17:08 UTC (rev 164677)
@@ -34,8 +34,6 @@
 
 #include "InspectorCounters.h"
 
-#include "ThreadGlobalData.h"
-
 namespace WebCore {
 
 int InspectorCounters::s_counters[CounterTypeLength];
@@ -45,22 +43,6 @@
     return s_counters[type];
 }
 
-ThreadLocalInspectorCounters::ThreadLocalInspectorCounters()
-{
-    for (size_t i = 0; i < CounterTypeLength; i++)
-        m_counters[i] = 0;
-}
-
-int ThreadLocalInspectorCounters::counterValue(CounterType type)
-{
-    return m_counters[type];
-}
-
-ThreadLocalInspectorCounters& ThreadLocalInspectorCounters::current()
-{
-    return threadGlobalData().inspectorCounters();
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorCounters.h (164676 => 164677)


--- trunk/Source/WebCore/inspector/InspectorCounters.h	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorCounters.h	2014-02-25 23:17:08 UTC (rev 164677)
@@ -83,36 +83,6 @@
 #endif
 };
 
-
-#if ENABLE(INSPECTOR)
-class ThreadLocalInspectorCounters {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    enum CounterType {
-        JSEventListenerCounter,
-        CounterTypeLength
-    };
-    ThreadLocalInspectorCounters();
-
-    inline void incrementCounter(CounterType type)
-    {
-        ++m_counters[type];
-    }
-
-    inline void decrementCounter(CounterType type)
-    {
-        --m_counters[type];
-    }
-
-    int counterValue(CounterType);
-
-    static ThreadLocalInspectorCounters& current();
-
-private:
-    int m_counters[CounterTypeLength];
-};
-#endif
-
 } // namespace WebCore
 
 #endif // !defined(InspectorCounters_h)

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (164676 => 164677)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2014-02-25 23:17:08 UTC (rev 164677)
@@ -582,11 +582,9 @@
             documentCount = InspectorCounters::counterValue(InspectorCounters::DocumentCounter);
             nodeCount = InspectorCounters::counterValue(InspectorCounters::NodeCounter);
         }
-        int listenerCount = ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter);
         RefPtr<Inspector::TypeBuilder::Timeline::DOMCounters> counters = Inspector::TypeBuilder::Timeline::DOMCounters::create()
             .setDocuments(documentCount)
-            .setNodes(nodeCount)
-            .setJsEventListeners(listenerCount);
+            .setNodes(nodeCount);
         record->setCounters(counters.release());
     }
 }

Modified: trunk/Source/WebCore/inspector/protocol/Timeline.json (164676 => 164677)


--- trunk/Source/WebCore/inspector/protocol/Timeline.json	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/protocol/Timeline.json	2014-02-25 23:17:08 UTC (rev 164677)
@@ -7,8 +7,7 @@
             "type": "object",
             "properties": [
                 { "name": "documents", "type": "integer" },
-                { "name": "nodes", "type": "integer" },
-                { "name": "jsEventListeners", "type": "integer" }
+                { "name": "nodes", "type": "integer" }
             ],
             "description": "Current values of DOM counters."
         },

Modified: trunk/Source/WebCore/platform/ThreadGlobalData.cpp (164676 => 164677)


--- trunk/Source/WebCore/platform/ThreadGlobalData.cpp	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.cpp	2014-02-25 23:17:08 UTC (rev 164677)
@@ -67,9 +67,6 @@
 #if PLATFORM(MAC)
     , m_cachedConverterTEC(adoptPtr(new TECConverterWrapper))
 #endif
-#if ENABLE(INSPECTOR)
-    , m_inspectorCounters(adoptPtr(new ThreadLocalInspectorCounters()))
-#endif
 {
     // This constructor will have been called on the main thread before being called on
     // any other thread, and is only called once per thread - this makes this a convenient
@@ -91,10 +88,6 @@
 
     m_cachedConverterICU.clear();
 
-#if ENABLE(INSPECTOR)
-    m_inspectorCounters.clear();
-#endif
-
 #if ENABLE(WEB_REPLAY)
     m_inputTypes = nullptr;
 #endif

Modified: trunk/Source/WebCore/platform/ThreadGlobalData.h (164676 => 164677)


--- trunk/Source/WebCore/platform/ThreadGlobalData.h	2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.h	2014-02-25 23:17:08 UTC (rev 164677)
@@ -41,7 +41,6 @@
 
     class EventNames;
     class ReplayInputTypes;
-    class ThreadLocalInspectorCounters;
     class ThreadTimers;
 
     struct CachedResourceRequestInitiators;
@@ -72,10 +71,6 @@
         void setWebCoreThreadData();
 #endif
 
-#if ENABLE(INSPECTOR)
-        ThreadLocalInspectorCounters& inspectorCounters() { return *m_inspectorCounters; }
-#endif
-
     private:
         OwnPtr<CachedResourceRequestInitiators> m_cachedResourceRequestInitiators;
         OwnPtr<EventNames> m_eventNames;
@@ -95,10 +90,6 @@
         OwnPtr<TECConverterWrapper> m_cachedConverterTEC;
 #endif
 
-#if ENABLE(INSPECTOR)
-        OwnPtr<ThreadLocalInspectorCounters> m_inspectorCounters;
-#endif
-
         static ThreadSpecific<ThreadGlobalData>* staticData;
 #if USE(WEB_THREAD)
         static ThreadGlobalData* sharedMainThreadStaticData;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to