Changeset 213657 in webkit


Ignore:
Timestamp:
Mar 9, 2017 1:05:41 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

Use const AbstractLocker& (instead of const LockHolder&) in more places.
https://bugs.webkit.org/show_bug.cgi?id=169424

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

  • heap/CodeBlockSet.cpp:

(JSC::CodeBlockSet::promoteYoungCodeBlocks):

  • heap/CodeBlockSet.h:
  • heap/CodeBlockSetInlines.h:

(JSC::CodeBlockSet::mark):

  • heap/ConservativeRoots.cpp:

(JSC::CompositeMarkHook::CompositeMarkHook):

  • heap/MachineStackMarker.cpp:

(JSC::MachineThreads::tryCopyOtherThreadStacks):

  • heap/MachineStackMarker.h:
  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::ensureBytecodesFor):

  • profiler/ProfilerDatabase.h:
  • runtime/SamplingProfiler.cpp:

(JSC::FrameWalker::FrameWalker):
(JSC::CFrameWalker::CFrameWalker):
(JSC::SamplingProfiler::createThreadIfNecessary):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::start):
(JSC::SamplingProfiler::pause):
(JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):
(JSC::SamplingProfiler::clearData):
(JSC::SamplingProfiler::releaseStackTraces):

  • runtime/SamplingProfiler.h:

(JSC::SamplingProfiler::setStopWatch):

  • wasm/WasmMemory.cpp:

(JSC::Wasm::availableFastMemories):
(JSC::Wasm::activeFastMemories):
(JSC::Wasm::viewActiveFastMemories):

  • wasm/WasmMemory.h:

Source/WTF:

  • wtf/RunLoop.h:
  • wtf/generic/RunLoopGeneric.cpp:

(WTF::RunLoop::wakeUp):
(WTF::RunLoop::schedule):

Location:
trunk/Source
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r213653 r213657  
     12017-03-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Use const AbstractLocker& (instead of const LockHolder&) in more places.
     4        https://bugs.webkit.org/show_bug.cgi?id=169424
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * heap/CodeBlockSet.cpp:
     9        (JSC::CodeBlockSet::promoteYoungCodeBlocks):
     10        * heap/CodeBlockSet.h:
     11        * heap/CodeBlockSetInlines.h:
     12        (JSC::CodeBlockSet::mark):
     13        * heap/ConservativeRoots.cpp:
     14        (JSC::CompositeMarkHook::CompositeMarkHook):
     15        * heap/MachineStackMarker.cpp:
     16        (JSC::MachineThreads::tryCopyOtherThreadStacks):
     17        * heap/MachineStackMarker.h:
     18        * profiler/ProfilerDatabase.cpp:
     19        (JSC::Profiler::Database::ensureBytecodesFor):
     20        * profiler/ProfilerDatabase.h:
     21        * runtime/SamplingProfiler.cpp:
     22        (JSC::FrameWalker::FrameWalker):
     23        (JSC::CFrameWalker::CFrameWalker):
     24        (JSC::SamplingProfiler::createThreadIfNecessary):
     25        (JSC::SamplingProfiler::takeSample):
     26        (JSC::SamplingProfiler::start):
     27        (JSC::SamplingProfiler::pause):
     28        (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):
     29        (JSC::SamplingProfiler::clearData):
     30        (JSC::SamplingProfiler::releaseStackTraces):
     31        * runtime/SamplingProfiler.h:
     32        (JSC::SamplingProfiler::setStopWatch):
     33        * wasm/WasmMemory.cpp:
     34        (JSC::Wasm::availableFastMemories):
     35        (JSC::Wasm::activeFastMemories):
     36        (JSC::Wasm::viewActiveFastMemories):
     37        * wasm/WasmMemory.h:
     38
    1392017-03-09  Saam Barati  <sbarati@apple.com>
    240
  • trunk/Source/JavaScriptCore/heap/CodeBlockSet.cpp

    r213652 r213657  
    4848}
    4949
    50 void CodeBlockSet::promoteYoungCodeBlocks(const LockHolder&)
     50void CodeBlockSet::promoteYoungCodeBlocks(const AbstractLocker&)
    5151{
    5252    ASSERT(m_lock.isLocked());
  • trunk/Source/JavaScriptCore/heap/CodeBlockSet.h

    r213652 r213657  
    6363    // blocks. This is defined in CodeBlock.h.
    6464private:
    65     void mark(const LockHolder&, CodeBlock* candidateCodeBlock);
     65    void mark(const AbstractLocker&, CodeBlock* candidateCodeBlock);
    6666public:
    67     void mark(const LockHolder&, void* candidateCodeBlock);
     67    void mark(const AbstractLocker&, void* candidateCodeBlock);
    6868   
    6969    // Delete all code blocks that are only referenced by this set (i.e. owned
     
    8787
    8888private:
    89     void promoteYoungCodeBlocks(const LockHolder&);
     89    void promoteYoungCodeBlocks(const AbstractLocker&);
    9090
    9191    HashSet<CodeBlock*> m_oldCodeBlocks;
  • trunk/Source/JavaScriptCore/heap/CodeBlockSetInlines.h

    r213652 r213657  
    3434namespace JSC {
    3535
    36 inline void CodeBlockSet::mark(const LockHolder& locker, void* candidateCodeBlock)
     36inline void CodeBlockSet::mark(const AbstractLocker& locker, void* candidateCodeBlock)
    3737{
    3838    ASSERT(m_lock.isLocked());
     
    5353}
    5454
    55 inline void CodeBlockSet::mark(const LockHolder&, CodeBlock* codeBlock)
     55inline void CodeBlockSet::mark(const AbstractLocker&, CodeBlock* codeBlock)
    5656{
    5757    if (!codeBlock)
  • trunk/Source/JavaScriptCore/heap/ConservativeRoots.cpp

    r207179 r213657  
    118118class CompositeMarkHook {
    119119public:
    120     CompositeMarkHook(JITStubRoutineSet& stubRoutines, CodeBlockSet& codeBlocks, const LockHolder& locker)
     120    CompositeMarkHook(JITStubRoutineSet& stubRoutines, CodeBlockSet& codeBlocks, const AbstractLocker& locker)
    121121        : m_stubRoutines(stubRoutines)
    122122        , m_codeBlocks(codeBlocks)
     
    134134    JITStubRoutineSet& m_stubRoutines;
    135135    CodeBlockSet& m_codeBlocks;
    136     const LockHolder& m_codeBlocksLocker;
     136    const AbstractLocker& m_codeBlocksLocker;
    137137};
    138138
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp

    r213238 r213657  
    929929}
    930930
    931 bool MachineThreads::tryCopyOtherThreadStacks(LockHolder&, void* buffer, size_t capacity, size_t* size)
     931bool MachineThreads::tryCopyOtherThreadStacks(const AbstractLocker&, void* buffer, size_t capacity, size_t* size)
    932932{
    933933    // Prevent two VMs from suspending each other's threads at the same time,
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.h

    r213652 r213657  
    143143
    144144    void tryCopyOtherThreadStack(Thread*, void*, size_t capacity, size_t*);
    145     bool tryCopyOtherThreadStacks(LockHolder&, void*, size_t capacity, size_t*);
     145    bool tryCopyOtherThreadStacks(const AbstractLocker&, void*, size_t capacity, size_t*);
    146146
    147147    static void THREAD_SPECIFIC_CALL removeThread(void*);
  • trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp

    r212365 r213657  
    6363}
    6464
    65 Bytecodes* Database::ensureBytecodesFor(const LockHolder&, CodeBlock* codeBlock)
     65Bytecodes* Database::ensureBytecodesFor(const AbstractLocker&, CodeBlock* codeBlock)
    6666{
    6767    codeBlock = codeBlock->baselineAlternative();
  • trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h

    r212365 r213657  
    7373   
    7474private:
    75     Bytecodes* ensureBytecodesFor(const LockHolder&, CodeBlock*);
     75    Bytecodes* ensureBytecodesFor(const AbstractLocker&, CodeBlock*);
    7676   
    7777    void addDatabaseToAtExit();
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r211546 r213657  
    8282class FrameWalker {
    8383public:
    84     FrameWalker(VM& vm, ExecState* callFrame, const LockHolder& codeBlockSetLocker, const LockHolder& machineThreadsLocker)
     84    FrameWalker(VM& vm, ExecState* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker)
    8585        : m_vm(vm)
    8686        , m_callFrame(callFrame)
     
    191191    ExecState* m_callFrame;
    192192    VMEntryFrame* m_vmEntryFrame;
    193     const LockHolder& m_codeBlockSetLocker;
    194     const LockHolder& m_machineThreadsLocker;
     193    const AbstractLocker& m_codeBlockSetLocker;
     194    const AbstractLocker& m_machineThreadsLocker;
    195195    bool m_bailingOut { false };
    196196    size_t m_depth { 0 };
     
    201201    typedef FrameWalker Base;
    202202
    203     CFrameWalker(VM& vm, void* machineFrame, ExecState* callFrame, const LockHolder& codeBlockSetLocker, const LockHolder& machineThreadsLocker)
     203    CFrameWalker(VM& vm, void* machineFrame, ExecState* callFrame, const AbstractLocker& codeBlockSetLocker, const AbstractLocker& machineThreadsLocker)
    204204        : Base(vm, callFrame, codeBlockSetLocker, machineThreadsLocker)
    205205        , m_machineFrame(machineFrame)
     
    297297}
    298298
    299 void SamplingProfiler::createThreadIfNecessary(const LockHolder&)
     299void SamplingProfiler::createThreadIfNecessary(const AbstractLocker&)
    300300{
    301301    ASSERT(m_lock.isLocked());
     
    335335}
    336336
    337 void SamplingProfiler::takeSample(const LockHolder&, std::chrono::microseconds& stackTraceProcessingTime)
     337void SamplingProfiler::takeSample(const AbstractLocker&, std::chrono::microseconds& stackTraceProcessingTime)
    338338{
    339339    ASSERT(m_lock.isLocked());
     
    660660}
    661661
    662 void SamplingProfiler::start(const LockHolder& locker)
     662void SamplingProfiler::start(const AbstractLocker& locker)
    663663{
    664664    ASSERT(m_lock.isLocked());
     
    667667}
    668668
    669 void SamplingProfiler::pause(const LockHolder&)
     669void SamplingProfiler::pause(const AbstractLocker&)
    670670{
    671671    ASSERT(m_lock.isLocked());
     
    674674}
    675675
    676 void SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread(const LockHolder&)
     676void SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread(const AbstractLocker&)
    677677{
    678678    ASSERT(m_lock.isLocked());
     
    701701}
    702702
    703 void SamplingProfiler::clearData(const LockHolder&)
     703void SamplingProfiler::clearData(const AbstractLocker&)
    704704{
    705705    ASSERT(m_lock.isLocked());
     
    859859}
    860860
    861 Vector<SamplingProfiler::StackTrace> SamplingProfiler::releaseStackTraces(const LockHolder& locker)
     861Vector<SamplingProfiler::StackTrace> SamplingProfiler::releaseStackTraces(const AbstractLocker& locker)
    862862{
    863863    ASSERT(m_lock.isLocked());
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.h

    r211542 r213657  
    167167    void setTimingInterval(std::chrono::microseconds interval) { m_timingInterval = interval; }
    168168    JS_EXPORT_PRIVATE void start();
    169     void start(const LockHolder&);
    170     Vector<StackTrace> releaseStackTraces(const LockHolder&);
     169    void start(const AbstractLocker&);
     170    Vector<StackTrace> releaseStackTraces(const AbstractLocker&);
    171171    JS_EXPORT_PRIVATE String stackTracesAsJSON();
    172172    JS_EXPORT_PRIVATE void noticeCurrentThreadAsJSCExecutionThread();
    173     void noticeCurrentThreadAsJSCExecutionThread(const LockHolder&);
     173    void noticeCurrentThreadAsJSCExecutionThread(const AbstractLocker&);
    174174    void processUnverifiedStackTraces(); // You should call this only after acquiring the lock.
    175     void setStopWatch(const LockHolder&, Ref<Stopwatch>&& stopwatch) { m_stopwatch = WTFMove(stopwatch); }
    176     void pause(const LockHolder&);
    177     void clearData(const LockHolder&);
     175    void setStopWatch(const AbstractLocker&, Ref<Stopwatch>&& stopwatch) { m_stopwatch = WTFMove(stopwatch); }
     176    void pause(const AbstractLocker&);
     177    void clearData(const AbstractLocker&);
    178178
    179179    // Used for debugging in the JSC shell/DRT.
     
    186186
    187187private:
    188     void createThreadIfNecessary(const LockHolder&);
     188    void createThreadIfNecessary(const AbstractLocker&);
    189189    void timerLoop();
    190     void takeSample(const LockHolder&, std::chrono::microseconds& stackTraceProcessingTime);
     190    void takeSample(const AbstractLocker&, std::chrono::microseconds& stackTraceProcessingTime);
    191191
    192192    VM& m_vm;
  • trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp

    r213599 r213657  
    6969static unsigned allocatedFastMemories { 0 };
    7070StaticLock memoryLock;
    71 inline Deque<void*, maxFastMemories>& availableFastMemories(const LockHolder&)
     71inline Deque<void*, maxFastMemories>& availableFastMemories(const AbstractLocker&)
    7272{
    7373    static NeverDestroyed<Deque<void*, maxFastMemories>> availableFastMemories;
     
    7575}
    7676
    77 inline HashSet<void*>& activeFastMemories(const LockHolder&)
     77inline HashSet<void*>& activeFastMemories(const AbstractLocker&)
    7878{
    7979    static NeverDestroyed<HashSet<void*>> activeFastMemories;
     
    8181}
    8282
    83 const HashSet<void*>& viewActiveFastMemories(const LockHolder& locker)
     83const HashSet<void*>& viewActiveFastMemories(const AbstractLocker& locker)
    8484{
    8585    return activeFastMemories(locker);
  • trunk/Source/JavaScriptCore/wasm/WasmMemory.h

    r213599 r213657  
    9999const size_t fastMemoryMappedBytes = (static_cast<size_t>(std::numeric_limits<uint32_t>::max()) + 1) * 2; // pointer max + offset max. This is all we need since a load straddling readable memory will trap.
    100100extern StaticLock memoryLock;
    101 const HashSet<void*>& viewActiveFastMemories(const LockHolder&);
     101const HashSet<void*>& viewActiveFastMemories(const AbstractLocker&);
    102102
    103103} } // namespace JSC::Wasm
  • trunk/Source/WTF/ChangeLog

    r213652 r213657  
     12017-03-09  Mark Lam  <mark.lam@apple.com>
     2
     3        Use const AbstractLocker& (instead of const LockHolder&) in more places.
     4        https://bugs.webkit.org/show_bug.cgi?id=169424
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * wtf/RunLoop.h:
     9        * wtf/generic/RunLoopGeneric.cpp:
     10        (WTF::RunLoop::wakeUp):
     11        (WTF::RunLoop::schedule):
     12
    1132017-03-09  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/WTF/wtf/RunLoop.h

    r212461 r213657  
    168168#elif USE(GENERIC_EVENT_LOOP)
    169169    void schedule(RefPtr<TimerBase::ScheduledTask>&&);
    170     void schedule(const LockHolder&, RefPtr<TimerBase::ScheduledTask>&&);
    171     void wakeUp(const LockHolder&);
     170    void schedule(const AbstractLocker&, RefPtr<TimerBase::ScheduledTask>&&);
     171    void wakeUp(const AbstractLocker&);
    172172    void scheduleAndWakeUp(RefPtr<TimerBase::ScheduledTask>);
    173173
  • trunk/Source/WTF/wtf/generic/RunLoopGeneric.cpp

    r208417 r213657  
    207207}
    208208
    209 void RunLoop::wakeUp(const LockHolder&)
     209void RunLoop::wakeUp(const AbstractLocker&)
    210210{
    211211    m_pendingTasks = true;
     
    219219}
    220220
    221 void RunLoop::schedule(const LockHolder&, RefPtr<TimerBase::ScheduledTask>&& task)
     221void RunLoop::schedule(const AbstractLocker&, RefPtr<TimerBase::ScheduledTask>&& task)
    222222{
    223223    m_schedules.append(WTFMove(task));
Note: See TracChangeset for help on using the changeset viewer.