Title: [232801] trunk/Source
Revision
232801
Author
keith_mil...@apple.com
Date
2018-06-13 12:07:22 -0700 (Wed, 13 Jun 2018)

Log Message

AutomaticThread should have a way to provide a thread name
https://bugs.webkit.org/show_bug.cgi?id=186604

Reviewed by Filip Pizlo.

Source/_javascript_Core:

Add names for JSC's automatic threads.

* dfg/DFGWorklist.cpp:
* heap/Heap.cpp:
* jit/JITWorklist.cpp:
* runtime/VMTraps.cpp:
* wasm/WasmWorklist.cpp:

Source/WTF:

AutomaticThread now has a virtual method to get a name, which can be
overridden to provide a custom name to the thread.

* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/WorkerPool.cpp:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (232800 => 232801)


--- trunk/Source/_javascript_Core/ChangeLog	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-06-13 19:07:22 UTC (rev 232801)
@@ -1,3 +1,18 @@
+2018-06-13  Keith Miller  <keith_mil...@apple.com>
+
+        AutomaticThread should have a way to provide a thread name
+        https://bugs.webkit.org/show_bug.cgi?id=186604
+
+        Reviewed by Filip Pizlo.
+
+        Add names for JSC's automatic threads.
+
+        * dfg/DFGWorklist.cpp:
+        * heap/Heap.cpp:
+        * jit/JITWorklist.cpp:
+        * runtime/VMTraps.cpp:
+        * wasm/WasmWorklist.cpp:
+
 2018-06-13  Saam Barati  <sbar...@apple.com>
 
         CFGSimplificationPhase should de-dupe jettisonedBlocks

Modified: trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp (232800 => 232801)


--- trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/dfg/DFGWorklist.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -46,7 +46,12 @@
         , m_relativePriority(relativePriority)
     {
     }
-    
+
+    const char* name() const override
+    {
+        return m_worklist.m_threadName.data();
+    }
+
 protected:
     PollResult poll(const AbstractLocker& locker) override
     {
@@ -160,7 +165,7 @@
         m_compilationScope = nullptr;
         m_plan = nullptr;
     }
-    
+
 private:
     Worklist& m_worklist;
     ThreadData& m_data;

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (232800 => 232801)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -238,6 +238,11 @@
         , m_heap(heap)
     {
     }
+
+    const char* name() const override
+    {
+        return "JSC Heap Collector Thread";
+    }
     
 protected:
     PollResult poll(const AbstractLocker& locker) override

Modified: trunk/Source/_javascript_Core/jit/JITWorklist.cpp (232800 => 232801)


--- trunk/Source/_javascript_Core/jit/JITWorklist.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/jit/JITWorklist.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -105,6 +105,11 @@
     {
         m_worklist.m_numAvailableThreads++;
     }
+
+    const char* name() const override
+    {
+        return "JIT Worklist Helper Thread";
+    }
     
 protected:
     PollResult poll(const AbstractLocker&) override

Modified: trunk/Source/_javascript_Core/runtime/VMTraps.cpp (232800 => 232801)


--- trunk/Source/_javascript_Core/runtime/VMTraps.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/runtime/VMTraps.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -220,6 +220,11 @@
         });
     }
 
+    const char* name() const override
+    {
+        return "JSC VMTraps Signal Sender Thread";
+    }
+
     VMTraps& traps() { return m_vm.traps(); }
 
 protected:

Modified: trunk/Source/_javascript_Core/wasm/WasmWorklist.cpp (232800 => 232801)


--- trunk/Source/_javascript_Core/wasm/WasmWorklist.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/_javascript_Core/wasm/WasmWorklist.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -117,6 +117,11 @@
         return complete(holdLock(*worklist.m_lock));
     }
 
+    const char* name() const override
+    {
+        return "Wasm Worklist Helper Thread";
+    }
+
 public:
     Condition synchronize;
     Worklist& worklist;

Modified: trunk/Source/WTF/ChangeLog (232800 => 232801)


--- trunk/Source/WTF/ChangeLog	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/WTF/ChangeLog	2018-06-13 19:07:22 UTC (rev 232801)
@@ -1,3 +1,18 @@
+2018-06-13  Keith Miller  <keith_mil...@apple.com>
+
+        AutomaticThread should have a way to provide a thread name
+        https://bugs.webkit.org/show_bug.cgi?id=186604
+
+        Reviewed by Filip Pizlo.
+
+        AutomaticThread now has a virtual method to get a name, which can be
+        overridden to provide a custom name to the thread.
+
+        * wtf/AutomaticThread.cpp:
+        (WTF::AutomaticThread::start):
+        * wtf/AutomaticThread.h:
+        * wtf/WorkerPool.cpp:
+
 2018-06-11  Saam Barati  <sbar...@apple.com>
 
         The NaturalLoops algorithm only works when the list of blocks in a loop is de-duplicated

Modified: trunk/Source/WTF/wtf/AutomaticThread.cpp (232800 => 232801)


--- trunk/Source/WTF/wtf/AutomaticThread.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/WTF/wtf/AutomaticThread.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -163,7 +163,7 @@
     m_hasUnderlyingThread = true;
     
     Thread::create(
-        "WTF::AutomaticThread",
+        name(),
         [=] () {
             if (verbose)
                 dataLog(RawPointer(this), ": Running automatic thread!\n");

Modified: trunk/Source/WTF/wtf/AutomaticThread.h (232800 => 232801)


--- trunk/Source/WTF/wtf/AutomaticThread.h	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/WTF/wtf/AutomaticThread.h	2018-06-13 19:07:22 UTC (rev 232801)
@@ -125,7 +125,9 @@
     bool notify(const AbstractLocker&);
 
     void join();
-    
+
+    virtual const char* name() const { return "WTF::AutomaticThread"; }
+
 protected:
     // This logically creates the thread, but in reality the thread won't be created until someone
     // calls AutomaticThreadCondition::notifyOne() or notifyAll().

Modified: trunk/Source/WTF/wtf/WorkerPool.cpp (232800 => 232801)


--- trunk/Source/WTF/wtf/WorkerPool.cpp	2018-06-13 19:04:10 UTC (rev 232800)
+++ trunk/Source/WTF/wtf/WorkerPool.cpp	2018-06-13 19:07:22 UTC (rev 232801)
@@ -73,6 +73,11 @@
         return m_pool.shouldSleep(locker);
     }
 
+    const char* name() const override
+    {
+        return "Worker Pool";
+    }
+
 private:
     WorkerPool& m_pool;
     Function<void()> m_task;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to