Changeset 181485 in webkit


Ignore:
Timestamp:
Mar 13, 2015 1:04:29 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
<https://webkit.org/b/142674>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

  • API/JSValue.mm:

(handerForStructTag):

  • API/JSWrapperMap.mm:
  • dfg/DFGCommon.cpp:

(JSC::DFG::startCrashing):
(JSC::DFG::isCrashing):

  • Changed to use a StaticSpinLock since that's what this code was trying to do anyway.
  • heap/CopiedBlock.h:

(JSC::CopiedBlock::CopiedBlock):

  • heap/CopiedSpace.cpp:

(JSC::CopiedSpace::CopiedSpace):

  • heap/CopiedSpace.h:
  • heap/GCThreadSharedData.cpp:

(JSC::GCThreadSharedData::GCThreadSharedData):

  • heap/GCThreadSharedData.h:
  • heap/ListableHandler.h:

(JSC::ListableHandler::List::List):

  • parser/SourceProvider.cpp:
  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::addDatabaseToAtExit):
(JSC::Profiler::Database::removeDatabaseFromAtExit):
(JSC::Profiler::Database::removeFirstAtExitDatabase):

Source/WebCore:

No new tests because there is no new functionality. This is a refactoring effort.

  • bindings/objc/WebScriptObject.mm:
  • platform/ios/wak/WAKWindow.mm:

(-[WAKWindow initWithLayer:]):
(-[WAKWindow initWithFrame:]):

Source/WebKit2:

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::EventDispatcher):

  • WebProcess/WebPage/EventDispatcher.h:
  • WebProcess/WebPage/ViewUpdateDispatcher.cpp:

(WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):

  • WebProcess/WebPage/ViewUpdateDispatcher.h:

Source/WTF:

We no longer use TCMalloc in our code, and we now have C++11. This replaces the
TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
wrapper around std::atomic).

Note that there is a StaticSpinLock and a SpinLock:

  1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on static / global std:atomic being automatically initialized to 0 at compile time. Hence, StaticSpinLock should only be used for statics / globals (including static members of classes / structs).
  1. SpinLock is derived from SpinLockBase, and adds a default constructor to initialize its internal atomic value to 0. Because SpinLock has a constructor, it cannot be used for statics / globals. Objects that want to embed a spin lock as an instance field should use SpinLock so that it is initialized properly. std::atomic will not automatically initialize instance fields to 0. Hence, StaticSpinLock will not work correctly as instance fields of a class / struct.
  • WTF.vcxproj/WTF.vcxproj:
  • WTF.vcxproj/WTF.vcxproj.filters:
  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/MetaAllocator.cpp:

(WTF::MetaAllocator::~MetaAllocator):
(WTF::MetaAllocator::MetaAllocator):

  • wtf/MetaAllocator.h:
  • wtf/SpinLock.h: Added.

(WTF::SpinLockBase::lock):
(WTF::SpinLockBase::unlock):
(WTF::SpinLockBase::isLocked):
(WTF::SpinLockBase::slowLock):
(WTF::SpinLock::SpinLock):

  • wtf/TCSpinLock.h: Removed.
  • wtf/text/AtomicString.cpp:
Location:
trunk/Source
Files:
1 added
1 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSValue.mm

    r173141 r181485  
    4242#import <wtf/HashSet.h>
    4343#import <wtf/ObjcRuntimeExtras.h>
     44#import <wtf/SpinLock.h>
    4445#import <wtf/Vector.h>
    45 #import <wtf/TCSpinLock.h>
    4646#import <wtf/text/WTFString.h>
    4747#import <wtf/text/StringHash.h>
     
    11031103static StructTagHandler* handerForStructTag(const char* encodedType)
    11041104{
    1105     static SpinLock handerForStructTagLock = SPINLOCK_INITIALIZER;
     1105    static StaticSpinLock handerForStructTagLock;
    11061106    SpinLockHolder lockHolder(&handerForStructTagLock);
    11071107
  • trunk/Source/JavaScriptCore/API/JSWrapperMap.mm

    r181297 r181485  
    4040#import "WeakGCMapInlines.h"
    4141#import <wtf/HashSet.h>
    42 #import <wtf/TCSpinLock.h>
    4342#import <wtf/Vector.h>
    4443#import <wtf/spi/cocoa/NSMapTableSPI.h>
  • trunk/Source/JavaScriptCore/ChangeLog

    r181482 r181485  
     12015-03-13  Mark Lam  <mark.lam@apple.com>
     2
     3        Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
     4        <https://webkit.org/b/142674>
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * API/JSValue.mm:
     9        (handerForStructTag):
     10        * API/JSWrapperMap.mm:
     11        * dfg/DFGCommon.cpp:
     12        (JSC::DFG::startCrashing):
     13        (JSC::DFG::isCrashing):
     14        - Changed to use a StaticSpinLock since that's what this code was trying to do
     15          anyway.
     16        * heap/CopiedBlock.h:
     17        (JSC::CopiedBlock::CopiedBlock):
     18        * heap/CopiedSpace.cpp:
     19        (JSC::CopiedSpace::CopiedSpace):
     20        * heap/CopiedSpace.h:
     21        * heap/GCThreadSharedData.cpp:
     22        (JSC::GCThreadSharedData::GCThreadSharedData):
     23        * heap/GCThreadSharedData.h:
     24        * heap/ListableHandler.h:
     25        (JSC::ListableHandler::List::List):
     26        * parser/SourceProvider.cpp:
     27        * profiler/ProfilerDatabase.cpp:
     28        (JSC::Profiler::Database::addDatabaseToAtExit):
     29        (JSC::Profiler::Database::removeDatabaseFromAtExit):
     30        (JSC::Profiler::Database::removeFirstAtExitDatabase):
     31
    1322015-03-13  Ryosuke Niwa  <rniwa@webkit.org>
    233
  • trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp

    r181481 r181485  
    3535namespace JSC { namespace DFG {
    3636
    37 static Atomic<unsigned> crashLock;
     37static StaticSpinLock crashLock;
    3838
    3939void startCrashing()
    4040{
    41     while (!crashLock.compare_exchange_weak(0, 1, std::memory_order_acquire))
    42         std::this_thread::yield();
     41    crashLock.lock();
    4342}
    4443
    4544bool isCrashing()
    4645{
    47     return !!crashLock.load(std::memory_order_acquire);
     46    return crashLock.isLocked();
    4847}
    4948
  • trunk/Source/JavaScriptCore/heap/CopiedBlock.h

    r181177 r181485  
    3333#include <wtf/Atomics.h>
    3434#include <wtf/DoublyLinkedList.h>
    35 #include <wtf/TCSpinLock.h>
     35#include <wtf/SpinLock.h>
    3636
    3737namespace JSC {
     
    153153#endif
    154154{
    155     m_workListLock.Init();
    156155    ASSERT(is8ByteAligned(reinterpret_cast<void*>(m_remaining)));
    157156}
  • trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp

    r181177 r181485  
    4040    , m_numberOfLoanedBlocks(0)
    4141{
    42     m_toSpaceLock.Init();
    4342}
    4443
  • trunk/Source/JavaScriptCore/heap/CopiedSpace.h

    r162017 r181485  
    3838#include <wtf/PageAllocationAligned.h>
    3939#include <wtf/PageBlock.h>
     40#include <wtf/SpinLock.h>
    4041#include <wtf/StdLibExtras.h>
    41 #include <wtf/TCSpinLock.h>
    4242#include <wtf/ThreadingPrimitives.h>
    4343
  • trunk/Source/JavaScriptCore/heap/GCThreadSharedData.cpp

    r179348 r181485  
    8282    , m_currentPhase(NoPhase)
    8383{
    84     m_copyLock.Init();
    8584#if ENABLE(PARALLEL_GC)
    8685    // Grab the lock so the new GC threads can be properly initialized before they start running.
  • trunk/Source/JavaScriptCore/heap/GCThreadSharedData.h

    r181215 r181485  
    3434#include <condition_variable>
    3535#include <wtf/HashSet.h>
    36 #include <wtf/TCSpinLock.h>
     36#include <wtf/SpinLock.h>
    3737#include <wtf/Vector.h>
    3838
  • trunk/Source/JavaScriptCore/heap/ListableHandler.h

    r126354 r181485  
    2424#include <wtf/Locker.h>
    2525#include <wtf/Noncopyable.h>
     26#include <wtf/SpinLock.h>
    2627#include <wtf/ThreadingPrimitives.h>
    27 #include <wtf/TCSpinLock.h>
    2828
    2929namespace JSC {
     
    6262            : m_first(0)
    6363        {
    64             m_lock.Init();
    6564        }
    6665       
  • trunk/Source/JavaScriptCore/parser/SourceProvider.cpp

    r163844 r181485  
    2828
    2929#include "JSCInlines.h"
     30#include <wtf/SpinLock.h>
    3031#include <wtf/StdLibExtras.h>
    31 #include <wtf/TCSpinLock.h>
    3232
    3333namespace JSC {
     
    4545}
    4646
    47 static TCMalloc_SpinLock providerIdLock = SPINLOCK_INITIALIZER;
     47static StaticSpinLock providerIdLock;
    4848
    4949void SourceProvider::getID()
  • trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp

    r163844 r181485  
    3636static std::atomic<int> databaseCounter;
    3737
    38 static SpinLock registrationLock = SPINLOCK_INITIALIZER;
     38static StaticSpinLock registrationLock;
    3939static std::atomic<int> didRegisterAtExit;
    4040static Database* firstDatabase;
     
    139139        atexit(atExitCallback);
    140140   
    141     TCMalloc_SpinLockHolder holder(&registrationLock);
     141    SpinLockHolder holder(registrationLock);
    142142    m_nextRegisteredDatabase = firstDatabase;
    143143    firstDatabase = this;
     
    146146void Database::removeDatabaseFromAtExit()
    147147{
    148     TCMalloc_SpinLockHolder holder(&registrationLock);
     148    SpinLockHolder holder(registrationLock);
    149149    for (Database** current = &firstDatabase; *current; current = &(*current)->m_nextRegisteredDatabase) {
    150150        if (*current != this)
     
    164164Database* Database::removeFirstAtExitDatabase()
    165165{
    166     TCMalloc_SpinLockHolder holder(&registrationLock);
     166    SpinLockHolder holder(registrationLock);
    167167    Database* result = firstDatabase;
    168168    if (result) {
  • trunk/Source/WTF/ChangeLog

    r181481 r181485  
     12015-03-13  Mark Lam  <mark.lam@apple.com>
     2
     3        Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
     4        <https://webkit.org/b/142674>
     5
     6        Reviewed by Filip Pizlo.
     7
     8        We no longer use TCMalloc in our code, and we now have C++11.  This replaces the
     9        TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
     10        wrapper around std::atomic).
     11
     12        Note that there is a StaticSpinLock and a SpinLock:
     13
     14        1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on
     15           static / global std:atomic being automatically initialized to 0 at compile time.
     16           Hence, StaticSpinLock should only be used for statics / globals (including
     17           static members of classes / structs).
     18
     19        2. SpinLock is derived from SpinLockBase, and adds a default constructor to
     20           initialize its internal atomic value to 0.  Because SpinLock has a constructor,
     21           it cannot be used for statics / globals.  Objects that want to embed a spin
     22           lock as an instance field should use SpinLock so that it is initialized properly.
     23           std::atomic will not automatically initialize instance fields to 0.  Hence,
     24           StaticSpinLock will not work correctly as instance fields of a class / struct.
     25
     26        * WTF.vcxproj/WTF.vcxproj:
     27        * WTF.vcxproj/WTF.vcxproj.filters:
     28        * WTF.xcodeproj/project.pbxproj:
     29        * wtf/CMakeLists.txt:
     30        * wtf/MetaAllocator.cpp:
     31        (WTF::MetaAllocator::~MetaAllocator):
     32        (WTF::MetaAllocator::MetaAllocator):
     33        * wtf/MetaAllocator.h:
     34        * wtf/SpinLock.h: Added.
     35        (WTF::SpinLockBase::lock):
     36        (WTF::SpinLockBase::unlock):
     37        (WTF::SpinLockBase::isLocked):
     38        (WTF::SpinLockBase::slowLock):
     39        (WTF::SpinLock::SpinLock):
     40        * wtf/TCSpinLock.h: Removed.
     41        * wtf/text/AtomicString.cpp:
     42
    1432015-03-13  Mark Lam  <mark.lam@apple.com>
    244
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj

    r181220 r181485  
    272272    <ClInclude Include="..\wtf\SinglyLinkedList.h" />
    273273    <ClInclude Include="..\wtf\SixCharacterHash.h" />
     274    <ClInclude Include="..\wtf\SpinLock.h" />
    274275    <ClInclude Include="..\wtf\StackBounds.h" />
    275276    <ClInclude Include="..\wtf\StaticConstructors.h" />
     
    279280    <ClInclude Include="..\wtf\StringHasher.h" />
    280281    <ClInclude Include="..\wtf\StringPrintStream.h" />
    281     <ClInclude Include="..\wtf\TCSpinLock.h" />
    282282    <ClInclude Include="..\wtf\TemporaryChange.h" />
    283283    <ClInclude Include="..\wtf\text\ASCIIFastPath.h" />
  • trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters

    r181220 r181485  
    613613      <Filter>wtf</Filter>
    614614    </ClInclude>
     615    <ClInclude Include="..\wtf\SpinLock.h">
     616      <Filter>wtf</Filter>
     617    </ClInclude>
    615618    <ClInclude Include="..\wtf\StackBounds.h">
    616619      <Filter>wtf</Filter>
     
    632635    </ClInclude>
    633636    <ClInclude Include="..\wtf\StringPrintStream.h">
    634       <Filter>wtf</Filter>
    635     </ClInclude>
    636     <ClInclude Include="..\wtf\TCSpinLock.h">
    637637      <Filter>wtf</Filter>
    638638    </ClInclude>
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r180968 r181485  
    222222                A8A4742C151A825B004123FF /* StringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47313151A825B004123FF /* StringExtras.h */; };
    223223                A8A4742D151A825B004123FF /* StringHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47314151A825B004123FF /* StringHasher.h */; };
    224                 A8A47430151A825B004123FF /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47317151A825B004123FF /* TCSpinLock.h */; };
    225224                A8A47433151A825B004123FF /* TemporaryChange.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731A151A825B004123FF /* TemporaryChange.h */; };
    226225                A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731C151A825B004123FF /* ASCIIFastPath.h */; };
     
    280279                E4A0AD3D1A96253C00536DF6 /* WorkQueueCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A0AD3C1A96253C00536DF6 /* WorkQueueCocoa.cpp */; };
    281280                EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; };
     281                FE91E8811AB2A0200099895F /* SpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = FE91E8801AB2A0200099895F /* SpinLock.h */; };
    282282                FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; };
    283283                FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; };
     
    514514                A8A47313151A825B004123FF /* StringExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringExtras.h; sourceTree = "<group>"; };
    515515                A8A47314151A825B004123FF /* StringHasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringHasher.h; sourceTree = "<group>"; };
    516                 A8A47317151A825B004123FF /* TCSpinLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCSpinLock.h; sourceTree = "<group>"; };
    517516                A8A4731A151A825B004123FF /* TemporaryChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryChange.h; sourceTree = "<group>"; };
    518517                A8A4731C151A825B004123FF /* ASCIIFastPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCIIFastPath.h; sourceTree = "<group>"; };
     
    572571                E4A0AD3C1A96253C00536DF6 /* WorkQueueCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueueCocoa.cpp; sourceTree = "<group>"; };
    573572                EB95E1EF161A72410089A2F5 /* ByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteOrder.h; sourceTree = "<group>"; };
     573                FE91E8801AB2A0200099895F /* SpinLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpinLock.h; sourceTree = "<group>"; };
    574574                FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; };
    575575                FEDACD3C1630F83F00C69634 /* StackStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackStats.h; sourceTree = "<group>"; };
     
    851851                                A8A4730C151A825B004123FF /* SizeLimits.cpp */,
    852852                                A8A4730D151A825B004123FF /* Spectrum.h */,
     853                                FE91E8801AB2A0200099895F /* SpinLock.h */,
    853854                                A8A4730E151A825B004123FF /* StackBounds.cpp */,
    854855                                A8A4730F151A825B004123FF /* StackBounds.h */,
     
    864865                                0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */,
    865866                                0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */,
    866                                 A8A47317151A825B004123FF /* TCSpinLock.h */,
    867867                                A8A4731A151A825B004123FF /* TemporaryChange.h */,
    868868                                A8A4732F151A825B004123FF /* ThreadFunctionInvocation.h */,
     
    11831183                                A8A4743D151A825B004123FF /* StringBuilder.h in Headers */,
    11841184                                A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */,
     1185                                FE91E8811AB2A0200099895F /* SpinLock.h in Headers */,
    11851186                                A8A4742C151A825B004123FF /* StringExtras.h in Headers */,
    11861187                                A8A4743F151A825B004123FF /* StringHash.h in Headers */,
     
    11921193                                1AFDE6531953B23D00C48FFA /* Optional.h in Headers */,
    11931194                                A8A473B8151A825B004123FF /* strtod.h in Headers */,
    1194                                 A8A47430151A825B004123FF /* TCSpinLock.h in Headers */,
    11951195                                E15556F618A0CC18006F48FB /* CryptographicUtilities.h in Headers */,
    11961196                                83FBA93219DF459700F30ADB /* TypeCasts.h in Headers */,
  • trunk/Source/WTF/wtf/CMakeLists.txt

    r180968 r181485  
    8888    SaturatedArithmetic.h
    8989    SegmentedVector.h
     90    SpinLock.h
    9091    StackBounds.h
    9192    StackStats.h
     
    9697    StringHasher.h
    9798    StringPrintStream.h
    98     TCSpinLock.h
    9999    ThreadIdentifierDataPthreads.h
    100100    ThreadSafeRefCounted.h
  • trunk/Source/WTF/wtf/MetaAllocator.cpp

    r165676 r181485  
    4444        node = next;
    4545    }
    46     m_lock.Finalize();
    4746#ifndef NDEBUG
    4847    ASSERT(!m_mallocBalance);
     
    130129#endif
    131130{
    132     m_lock.Init();
    133    
    134131    for (m_logPageSize = 0; m_logPageSize < 32; ++m_logPageSize) {
    135132        if (static_cast<size_t>(1) << m_logPageSize == m_pageSize)
  • trunk/Source/WTF/wtf/MetaAllocator.h

    r165676 r181485  
    3838#include <wtf/RefCounted.h>
    3939#include <wtf/RefPtr.h>
    40 #include <wtf/TCSpinLock.h>
     40#include <wtf/SpinLock.h>
    4141
    4242namespace WTF {
  • trunk/Source/WTF/wtf/text/AtomicString.cpp

    r177259 r181485  
    3434
    3535#if USE(WEB_THREAD)
    36 #include "TCSpinLock.h"
     36#include "SpinLock.h"
    3737#endif
    3838
     
    4848    WTF_MAKE_NONCOPYABLE(AtomicStringTableLocker);
    4949
    50     static SpinLock s_stringTableLock;
     50    static StaticSpinLock s_stringTableLock;
    5151public:
    5252    AtomicStringTableLocker()
     
    5656};
    5757
    58 SpinLock AtomicStringTableLocker::s_stringTableLock = SPINLOCK_INITIALIZER;
     58StaticSpinLock AtomicStringTableLocker::s_stringTableLock;
    5959
    6060#else
  • trunk/Source/WebCore/ChangeLog

    r181484 r181485  
     12015-03-13  Mark Lam  <mark.lam@apple.com>
     2
     3        Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
     4        <https://webkit.org/b/142674>
     5
     6        Reviewed by Filip Pizlo.
     7
     8        No new tests because there is no new functionality. This is a refactoring effort.
     9
     10        * bindings/objc/WebScriptObject.mm:
     11        * platform/ios/wak/WAKWindow.mm:
     12        (-[WAKWindow initWithLayer:]):
     13        (-[WAKWindow initWithFrame:]):
     14
    1152015-03-13  Doug Russell  <d_russell@apple.com>
    216
  • trunk/Source/WebCore/bindings/objc/WebScriptObject.mm

    r176278 r181485  
    4949#import <runtime/Completion.h>
    5050#import <runtime/Completion.h>
    51 #import <wtf/TCSpinLock.h>
     51#import <wtf/SpinLock.h>
    5252#import <wtf/Threading.h>
    5353#import <wtf/spi/cocoa/NSMapTableSPI.h>
     
    7373
    7474static NSMapTable* JSWrapperCache;
    75 static SpinLock spinLock = SPINLOCK_INITIALIZER;
     75static StaticSpinLock spinLock;
    7676
    7777NSObject* getJSWrapper(JSObject* impl)
  • trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm

    r179886 r181485  
    3737#import "WKViewPrivate.h"
    3838#import <QuartzCore/QuartzCore.h>
    39 #import <wtf/TCSpinLock.h>
     39#import <wtf/SpinLock.h>
    4040
    4141WEBCORE_EXPORT NSString * const WAKWindowScreenScaleDidChangeNotification = @"WAKWindowScreenScaleDidChangeNotification";
     
    7878    _frozenVisibleRect = CGRectNull;
    7979
    80     _exposedScrollViewRectLock = SPINLOCK_INITIALIZER;
    8180    _exposedScrollViewRect = CGRectNull;
    8281
     
    9493    _screenScale = wkGetScreenScaleFactor();
    9594
    96     _exposedScrollViewRectLock = SPINLOCK_INITIALIZER;
    9795    _exposedScrollViewRect = CGRectNull;
    9896
  • trunk/Source/WebKit2/ChangeLog

    r181483 r181485  
     12015-03-13  Mark Lam  <mark.lam@apple.com>
     2
     3        Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
     4        <https://webkit.org/b/142674>
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * WebProcess/WebPage/EventDispatcher.cpp:
     9        (WebKit::EventDispatcher::EventDispatcher):
     10        * WebProcess/WebPage/EventDispatcher.h:
     11        * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
     12        (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
     13        * WebProcess/WebPage/ViewUpdateDispatcher.h:
     14
    1152015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
    216
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp

    r180054 r181485  
    5555    : m_queue(WorkQueue::create("com.apple.WebKit.EventDispatcher", WorkQueue::Type::Serial, WorkQueue::QOS::UserInteractive))
    5656    , m_recentWheelEventDeltaTracker(std::make_unique<WheelEventDeltaTracker>())
    57 #if ENABLE(IOS_TOUCH_EVENTS)
    58     , m_touchEventsLock(SPINLOCK_INITIALIZER)
    59 #endif
    6057{
    6158}
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h

    r180054 r181485  
    3535#include <wtf/Noncopyable.h>
    3636#include <wtf/RefPtr.h>
    37 #include <wtf/TCSpinLock.h>
     37#include <wtf/SpinLock.h>
    3838#include <wtf/ThreadingPrimitives.h>
    3939
  • trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp

    r180054 r181485  
    4343ViewUpdateDispatcher::ViewUpdateDispatcher()
    4444    : m_queue(WorkQueue::create("com.apple.WebKit.ViewUpdateDispatcher"))
    45     , m_dataMutex(SPINLOCK_INITIALIZER)
    4645{
    4746}
  • trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.h

    r180054 r181485  
    3232#include <wtf/HashMap.h>
    3333#include <wtf/Ref.h>
    34 #include <wtf/TCSpinLock.h>
     34#include <wtf/SpinLock.h>
    3535
    3636namespace WebKit {
Note: See TracChangeset for help on using the changeset viewer.