Ignore:
Timestamp:
Apr 23, 2017, 2:12:44 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Use DoublyLinkedList for MachineThread
https://bugs.webkit.org/show_bug.cgi?id=171171

Reviewed by Mark Lam.

MachineThread can use WTF::DoublyLinkedList to simplify
its implementation. We should not use Vector<> etc. since
we do not want to call allocations during suspending and
resuming threads.

  • heap/MachineStackMarker.cpp:

(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::removeThreadIfFound):
(JSC::MachineThreads::MachineThread::MachineThread):
(JSC::MachineThreads::tryCopyOtherThreadStacks):

  • heap/MachineStackMarker.h:

(JSC::MachineThreads::threadsListHead):

  • runtime/SamplingProfiler.cpp:

(JSC::FrameWalker::isValidFramePointer):

  • runtime/VMTraps.cpp:

(JSC::findActiveVMAndStackBounds):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r215265 r215671  
    168168    {
    169169        uint8_t* fpCast = bitwise_cast<uint8_t*>(exec);
    170         for (MachineThreads::MachineThread* thread = m_vm.heap.machineThreads().threadsListHead(m_machineThreadsLocker); thread; thread = thread->next) {
     170        const auto& threadList = m_vm.heap.machineThreads().threadsListHead(m_machineThreadsLocker);
     171        for (MachineThreads::MachineThread* thread = threadList.head(); thread; thread = thread->next()) {
    171172            uint8_t* stackBase = static_cast<uint8_t*>(thread->stackBase());
    172173            uint8_t* stackLimit = static_cast<uint8_t*>(thread->stackEnd());
Note: See TracChangeset for help on using the changeset viewer.