Changeset 232801 in webkit


Ignore:
Timestamp:
Jun 13, 2018 12:07:22 PM (6 years ago)
Author:
keith_miller@apple.com
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/JavaScriptCore:

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:
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r232800 r232801  
     12018-06-13  Keith Miller  <keith_miller@apple.com>
     2
     3        AutomaticThread should have a way to provide a thread name
     4        https://bugs.webkit.org/show_bug.cgi?id=186604
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Add names for JSC's automatic threads.
     9
     10        * dfg/DFGWorklist.cpp:
     11        * heap/Heap.cpp:
     12        * jit/JITWorklist.cpp:
     13        * runtime/VMTraps.cpp:
     14        * wasm/WasmWorklist.cpp:
     15
    1162018-06-13  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/JavaScriptCore/dfg/DFGWorklist.cpp

    r225524 r232801  
    4747    {
    4848    }
    49    
     49
     50    const char* name() const override
     51    {
     52        return m_worklist.m_threadName.data();
     53    }
     54
    5055protected:
    5156    PollResult poll(const AbstractLocker& locker) override
     
    161166        m_plan = nullptr;
    162167    }
    163    
     168
    164169private:
    165170    Worklist& m_worklist;
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r232660 r232801  
    239239    {
    240240    }
     241
     242    const char* name() const override
     243    {
     244        return "JSC Heap Collector Thread";
     245    }
    241246   
    242247protected:
  • trunk/Source/JavaScriptCore/jit/JITWorklist.cpp

    r221822 r232801  
    105105    {
    106106        m_worklist.m_numAvailableThreads++;
     107    }
     108
     109    const char* name() const override
     110    {
     111        return "JIT Worklist Helper Thread";
    107112    }
    108113   
  • trunk/Source/JavaScriptCore/runtime/VMTraps.cpp

    r231027 r232801  
    221221    }
    222222
     223    const char* name() const override
     224    {
     225        return "JSC VMTraps Signal Sender Thread";
     226    }
     227
    223228    VMTraps& traps() { return m_vm.traps(); }
    224229
  • trunk/Source/JavaScriptCore/wasm/WasmWorklist.cpp

    r223738 r232801  
    118118    }
    119119
     120    const char* name() const override
     121    {
     122        return "Wasm Worklist Helper Thread";
     123    }
     124
    120125public:
    121126    Condition synchronize;
  • trunk/Source/WTF/ChangeLog

    r232741 r232801  
     12018-06-13  Keith Miller  <keith_miller@apple.com>
     2
     3        AutomaticThread should have a way to provide a thread name
     4        https://bugs.webkit.org/show_bug.cgi?id=186604
     5
     6        Reviewed by Filip Pizlo.
     7
     8        AutomaticThread now has a virtual method to get a name, which can be
     9        overridden to provide a custom name to the thread.
     10
     11        * wtf/AutomaticThread.cpp:
     12        (WTF::AutomaticThread::start):
     13        * wtf/AutomaticThread.h:
     14        * wtf/WorkerPool.cpp:
     15
    1162018-06-11  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/WTF/wtf/AutomaticThread.cpp

    r232619 r232801  
    164164   
    165165    Thread::create(
    166         "WTF::AutomaticThread",
     166        name(),
    167167        [=] () {
    168168            if (verbose)
  • trunk/Source/WTF/wtf/AutomaticThread.h

    r232619 r232801  
    126126
    127127    void join();
    128    
     128
     129    virtual const char* name() const { return "WTF::AutomaticThread"; }
     130
    129131protected:
    130132    // This logically creates the thread, but in reality the thread won't be created until someone
  • trunk/Source/WTF/wtf/WorkerPool.cpp

    r232619 r232801  
    7474    }
    7575
     76    const char* name() const override
     77    {
     78        return "Worker Pool";
     79    }
     80
    7681private:
    7782    WorkerPool& m_pool;
Note: See TracChangeset for help on using the changeset viewer.