Title: [236905] trunk/Source
Revision
236905
Author
[email protected]
Date
2018-10-07 09:14:50 -0700 (Sun, 07 Oct 2018)

Log Message

Name Heap threads
https://bugs.webkit.org/show_bug.cgi?id=190337

Reviewed by Mark Lam.

Source/_javascript_Core:

Name heap threads as "Heap Helper Thread". In Linux, we name it "HeapHelper" since
Linux does not accept the name longer than 15. We do not want to use the short name
for non-Linux environment. And we want to have clear name in Linux: truncated name
is not good. So, having the two names is the only way.

* heap/HeapHelperPool.cpp:
(JSC::heapHelperPool):

Source/WTF:

Add a functionality naming threads of ParallelHelperPool.

* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (236904 => 236905)


--- trunk/Source/_javascript_Core/ChangeLog	2018-10-07 09:32:52 UTC (rev 236904)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-10-07 16:14:50 UTC (rev 236905)
@@ -1,5 +1,20 @@
 2018-10-07  Yusuke Suzuki  <[email protected]>
 
+        Name Heap threads
+        https://bugs.webkit.org/show_bug.cgi?id=190337
+
+        Reviewed by Mark Lam.
+
+        Name heap threads as "Heap Helper Thread". In Linux, we name it "HeapHelper" since
+        Linux does not accept the name longer than 15. We do not want to use the short name
+        for non-Linux environment. And we want to have clear name in Linux: truncated name
+        is not good. So, having the two names is the only way.
+
+        * heap/HeapHelperPool.cpp:
+        (JSC::heapHelperPool):
+
+2018-10-07  Yusuke Suzuki  <[email protected]>
+
         [JSC] Avoid creating ProgramExecutable in checkSyntax
         https://bugs.webkit.org/show_bug.cgi?id=190332
 

Modified: trunk/Source/_javascript_Core/heap/HeapHelperPool.cpp (236904 => 236905)


--- trunk/Source/_javascript_Core/heap/HeapHelperPool.cpp	2018-10-07 09:32:52 UTC (rev 236904)
+++ trunk/Source/_javascript_Core/heap/HeapHelperPool.cpp	2018-10-07 16:14:50 UTC (rev 236905)
@@ -38,7 +38,12 @@
     std::call_once(
         initializeHelperPoolOnceFlag,
         [] {
-            helperPool = new ParallelHelperPool();
+#if OS(LINUX)
+            const char* threadName = "HeapHelper";
+#else
+            const char* threadName = "Heap Helper Thread";
+#endif
+            helperPool = new ParallelHelperPool(threadName);
             helperPool->ensureThreads(Options::numberOfGCMarkers() - 1);
         });
     return *helperPool;

Modified: trunk/Source/WTF/ChangeLog (236904 => 236905)


--- trunk/Source/WTF/ChangeLog	2018-10-07 09:32:52 UTC (rev 236904)
+++ trunk/Source/WTF/ChangeLog	2018-10-07 16:14:50 UTC (rev 236905)
@@ -1,3 +1,16 @@
+2018-10-07  Yusuke Suzuki  <[email protected]>
+
+        Name Heap threads
+        https://bugs.webkit.org/show_bug.cgi?id=190337
+
+        Reviewed by Mark Lam.
+
+        Add a functionality naming threads of ParallelHelperPool.
+
+        * wtf/ParallelHelperPool.cpp:
+        (WTF::ParallelHelperPool::ParallelHelperPool):
+        * wtf/ParallelHelperPool.h:
+
 2018-10-06  Mark Lam  <[email protected]>
 
         Adding some temporary asserts to debug a mysterious ASAN bot crash.

Modified: trunk/Source/WTF/wtf/ParallelHelperPool.cpp (236904 => 236905)


--- trunk/Source/WTF/wtf/ParallelHelperPool.cpp	2018-10-07 09:32:52 UTC (rev 236904)
+++ trunk/Source/WTF/wtf/ParallelHelperPool.cpp	2018-10-07 16:14:50 UTC (rev 236905)
@@ -123,9 +123,10 @@
     }
 }
 
-ParallelHelperPool::ParallelHelperPool()
+ParallelHelperPool::ParallelHelperPool(CString&& threadName)
     : m_lock(Box<Lock>::create())
     , m_workAvailableCondition(AutomaticThreadCondition::create())
+    , m_threadName(WTFMove(threadName))
 {
 }
 
@@ -176,6 +177,11 @@
     {
     }
     
+    const char* name() const override
+    {
+        return m_pool.m_threadName.data();
+    }
+
 protected:
     PollResult poll(const AbstractLocker& locker) override
     {

Modified: trunk/Source/WTF/wtf/ParallelHelperPool.h (236904 => 236905)


--- trunk/Source/WTF/wtf/ParallelHelperPool.h	2018-10-07 09:32:52 UTC (rev 236904)
+++ trunk/Source/WTF/wtf/ParallelHelperPool.h	2018-10-07 16:14:50 UTC (rev 236905)
@@ -35,6 +35,7 @@
 #include <wtf/Threading.h>
 #include <wtf/Vector.h>
 #include <wtf/WeakRandom.h>
+#include <wtf/text/CString.h>
 
 namespace WTF {
 
@@ -179,7 +180,7 @@
 
 class ParallelHelperPool : public ThreadSafeRefCounted<ParallelHelperPool> {
 public:
-    WTF_EXPORT_PRIVATE ParallelHelperPool();
+    WTF_EXPORT_PRIVATE ParallelHelperPool(CString&& threadName);
     WTF_EXPORT_PRIVATE ~ParallelHelperPool();
 
     WTF_EXPORT_PRIVATE void ensureThreads(unsigned numThreads);
@@ -207,6 +208,7 @@
     
     Vector<ParallelHelperClient*> m_clients;
     Vector<RefPtr<AutomaticThread>> m_threads;
+    CString m_threadName;
     unsigned m_numThreads { 0 }; // This can be larger than m_threads.size() because we start threads only once there is work.
     bool m_isDying { false };
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to