Diff
Modified: trunk/Source/_javascript_Core/API/JSValue.mm (230302 => 230303)
--- trunk/Source/_javascript_Core/API/JSValue.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/API/JSValue.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1115,7 +1115,7 @@
static StructTagHandler* handerForStructTag(const char* encodedType)
{
- static StaticLock handerForStructTagLock;
+ static Lock handerForStructTagLock;
LockHolder lockHolder(&handerForStructTagLock);
static StructHandlers* structHandlers = createStructHandlerMap();
Modified: trunk/Source/_javascript_Core/API/JSVirtualMachine.mm (230302 => 230303)
--- trunk/Source/_javascript_Core/API/JSVirtualMachine.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachine.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -42,7 +42,7 @@
static NSMapTable *globalWrapperCache = 0;
-static StaticLock wrapperCacheMutex;
+static Lock wrapperCacheMutex;
static void initWrapperCache()
{
@@ -68,13 +68,13 @@
+ (void)addWrapper:(JSVirtualMachine *)wrapper forJSContextGroupRef:(JSContextGroupRef)group
{
- std::lock_guard<StaticLock> lock(wrapperCacheMutex);
+ std::lock_guard<Lock> lock(wrapperCacheMutex);
NSMapInsert(wrapperCache(), group, wrapper);
}
+ (JSVirtualMachine *)wrapperForJSContextGroupRef:(JSContextGroupRef)group
{
- std::lock_guard<StaticLock> lock(wrapperCacheMutex);
+ std::lock_guard<Lock> lock(wrapperCacheMutex);
return static_cast<JSVirtualMachine *>(NSMapGet(wrapperCache(), group));
}
Modified: trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/API/glib/JSCVirtualMachine.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -47,7 +47,7 @@
WEBKIT_DEFINE_TYPE(JSCVirtualMachine, jsc_virtual_machine, G_TYPE_OBJECT)
-static StaticLock wrapperCacheMutex;
+static Lock wrapperCacheMutex;
static HashMap<JSContextGroupRef, JSCVirtualMachine*>& wrapperMap()
{
@@ -57,7 +57,7 @@
static void addWrapper(JSContextGroupRef group, JSCVirtualMachine* vm)
{
- std::lock_guard<StaticLock> lock(wrapperCacheMutex);
+ std::lock_guard<Lock> lock(wrapperCacheMutex);
ASSERT(!wrapperMap().contains(group));
wrapperMap().set(group, vm);
}
@@ -64,7 +64,7 @@
static void removeWrapper(JSContextGroupRef group)
{
- std::lock_guard<StaticLock> lock(wrapperCacheMutex);
+ std::lock_guard<Lock> lock(wrapperCacheMutex);
ASSERT(wrapperMap().contains(group));
wrapperMap().remove(group);
}
Modified: trunk/Source/_javascript_Core/ChangeLog (230302 => 230303)
--- trunk/Source/_javascript_Core/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,44 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ * API/JSValue.mm:
+ (handerForStructTag):
+ * API/JSVirtualMachine.mm:
+ (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
+ (+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
+ * API/glib/JSCVirtualMachine.cpp:
+ (addWrapper):
+ (removeWrapper):
+ * assembler/testmasm.cpp:
+ * b3/air/testair.cpp:
+ * b3/testb3.cpp:
+ * bytecode/SuperSampler.cpp:
+ * dfg/DFGCommon.cpp:
+ * dfg/DFGCommonData.cpp:
+ * dynbench.cpp:
+ * heap/MachineStackMarker.cpp:
+ (JSC::MachineThreads::tryCopyOtherThreadStacks):
+ * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
+ (Inspector::RemoteTargetHandleRunSourceGlobal):
+ (Inspector::RemoteTargetQueueTaskOnGlobalQueue):
+ * interpreter/CLoopStack.cpp:
+ * parser/SourceProvider.cpp:
+ * profiler/ProfilerDatabase.cpp:
+ * profiler/ProfilerUID.cpp:
+ (JSC::Profiler::UID::create):
+ * runtime/IntlObject.cpp:
+ (JSC::numberingSystemsForLocale):
+ * runtime/JSLock.cpp:
+ * runtime/JSLock.h:
+ * runtime/SamplingProfiler.cpp:
+ (JSC::SamplingProfiler::registerForReportAtExit):
+ * runtime/VM.cpp:
+ * wasm/WasmFaultSignalHandler.cpp:
+
2018-04-04 Mark Lam <[email protected]>
Add pointer profiling support to the DFG and supporting files.
Modified: trunk/Source/_javascript_Core/assembler/testmasm.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/assembler/testmasm.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/assembler/testmasm.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -80,7 +80,7 @@
using CPUState = Probe::CPUState;
#endif
-StaticLock crashLock;
+Lock crashLock;
typedef WTF::Function<void(CCallHelpers&)> Generator;
Modified: trunk/Source/_javascript_Core/b3/air/testair.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/b3/air/testair.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/b3/air/testair.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -71,7 +71,7 @@
namespace {
-StaticLock crashLock;
+Lock crashLock;
// Nothing fancy for now; we just use the existing WTF assertion machinery.
#define CHECK(x) do { \
@@ -123,7 +123,7 @@
template<typename T>
void loadConstantImpl(BasicBlock* block, T value, B3::Air::Opcode move, Tmp tmp, Tmp scratch)
{
- static StaticLock lock;
+ static Lock lock;
static StdMap<T, T*>* map; // I'm not messing with HashMap's problems with integers.
LockHolder locker(lock);
Modified: trunk/Source/_javascript_Core/b3/testb3.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/b3/testb3.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/b3/testb3.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -97,7 +97,7 @@
return shouldDumpIR(B3Mode);
}
-StaticLock crashLock;
+Lock crashLock;
// Nothing fancy for now; we just use the existing WTF assertion machinery.
#define CHECK(x) do { \
Modified: trunk/Source/_javascript_Core/bytecode/SuperSampler.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/bytecode/SuperSampler.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/bytecode/SuperSampler.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -36,7 +36,7 @@
volatile uint32_t g_superSamplerCount;
-static StaticLock lock;
+static Lock lock;
static double in;
static double out;
Modified: trunk/Source/_javascript_Core/dfg/DFGCommon.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/dfg/DFGCommon.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/dfg/DFGCommon.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -34,7 +34,7 @@
namespace JSC { namespace DFG {
-static StaticLock crashLock;
+static Lock crashLock;
void startCrashing()
{
Modified: trunk/Source/_javascript_Core/dfg/DFGCommonData.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/dfg/DFGCommonData.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/dfg/DFGCommonData.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -90,7 +90,7 @@
catchEntrypoints.shrinkToFit();
}
-static StaticLock pcCodeBlockMapLock;
+static Lock pcCodeBlockMapLock;
inline HashMap<void*, CodeBlock*>& pcCodeBlockMap(AbstractLocker&)
{
static NeverDestroyed<HashMap<void*, CodeBlock*>> pcCodeBlockMap;
Modified: trunk/Source/_javascript_Core/dynbench.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/dynbench.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/dynbench.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -39,7 +39,7 @@
namespace {
-StaticLock crashLock;
+Lock crashLock;
const char* nameFilter;
unsigned requestedIterationCount;
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -139,8 +139,8 @@
{
// Prevent two VMs from suspending each other's threads at the same time,
// which can cause deadlock: <rdar://problem/20300842>.
- static StaticLock mutex;
- std::lock_guard<StaticLock> lock(mutex);
+ static Lock mutex;
+ std::lock_guard<Lock> lock(mutex);
*size = 0;
Modified: trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm (230302 => 230303)
--- trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -41,7 +41,7 @@
namespace Inspector {
-static StaticLock rwiQueueMutex;
+static Lock rwiQueueMutex;
static CFRunLoopSourceRef rwiRunLoopSource;
static RemoteTargetQueue* rwiQueue;
@@ -53,7 +53,7 @@
RemoteTargetQueue queueCopy;
{
- std::lock_guard<StaticLock> lock(rwiQueueMutex);
+ std::lock_guard<Lock> lock(rwiQueueMutex);
queueCopy = *rwiQueue;
rwiQueue->clear();
}
@@ -68,7 +68,7 @@
ASSERT(rwiQueue);
{
- std::lock_guard<StaticLock> lock(rwiQueueMutex);
+ std::lock_guard<Lock> lock(rwiQueueMutex);
rwiQueue->append(task);
}
Modified: trunk/Source/_javascript_Core/interpreter/CLoopStack.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/interpreter/CLoopStack.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/interpreter/CLoopStack.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -48,7 +48,7 @@
return size;
}
-static StaticLock stackStatisticsMutex;
+static Lock stackStatisticsMutex;
CLoopStack::CLoopStack(VM& vm)
: m_vm(vm)
Modified: trunk/Source/_javascript_Core/parser/SourceProvider.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/parser/SourceProvider.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -45,7 +45,7 @@
{
}
-static StaticLock providerIdLock;
+static Lock providerIdLock;
void SourceProvider::getID()
{
Modified: trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/profiler/ProfilerDatabase.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -37,7 +37,7 @@
static std::atomic<int> databaseCounter;
-static StaticLock registrationLock;
+static Lock registrationLock;
static std::atomic<int> didRegisterAtExit;
static Database* firstDatabase;
Modified: trunk/Source/_javascript_Core/profiler/ProfilerUID.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/profiler/ProfilerUID.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/profiler/ProfilerUID.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -33,7 +33,7 @@
UID UID::create()
{
- static StaticLock lock;
+ static Lock lock;
static uint64_t counter;
LockHolder locker(lock);
Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -853,8 +853,8 @@
Vector<String>& availableNumberingSystems = cachedNumberingSystems.get();
if (UNLIKELY(availableNumberingSystems.isEmpty())) {
- static StaticLock cachedNumberingSystemsMutex;
- std::lock_guard<StaticLock> lock(cachedNumberingSystemsMutex);
+ static Lock cachedNumberingSystemsMutex;
+ std::lock_guard<Lock> lock(cachedNumberingSystemsMutex);
if (availableNumberingSystems.isEmpty()) {
UErrorCode status = U_ZERO_ERROR;
UEnumeration* numberingSystemNames = unumsys_openAvailableNames(&status);
Modified: trunk/Source/_javascript_Core/runtime/JSLock.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/runtime/JSLock.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/runtime/JSLock.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -36,7 +36,7 @@
namespace JSC {
-StaticLock GlobalJSLock::s_sharedInstanceMutex;
+Lock GlobalJSLock::s_sharedInstanceMutex;
GlobalJSLock::GlobalJSLock()
{
Modified: trunk/Source/_javascript_Core/runtime/JSLock.h (230302 => 230303)
--- trunk/Source/_javascript_Core/runtime/JSLock.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/runtime/JSLock.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -60,7 +60,7 @@
JS_EXPORT_PRIVATE GlobalJSLock();
JS_EXPORT_PRIVATE ~GlobalJSLock();
private:
- static StaticLock s_sharedInstanceMutex;
+ static Lock s_sharedInstanceMutex;
};
class JSLockHolder {
Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -909,7 +909,7 @@
void SamplingProfiler::registerForReportAtExit()
{
- static StaticLock registrationLock;
+ static Lock registrationLock;
static HashSet<RefPtr<SamplingProfiler>>* profilesToReport;
LockHolder holder(registrationLock);
Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/runtime/VM.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -463,7 +463,7 @@
VMInspector::instance().add(this);
}
-static StaticReadWriteLock s_destructionLock;
+static ReadWriteLock s_destructionLock;
void waitForVMDestruction()
{
Modified: trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp (230302 => 230303)
--- trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -47,7 +47,7 @@
}
}
-static StaticLock codeLocationsLock;
+static Lock codeLocationsLock;
static LazyNeverDestroyed<HashSet<std::tuple<void*, void*>>> codeLocations; // (start, end)
#if ENABLE(WEBASSEMBLY_FAST_MEMORY)
Modified: trunk/Source/WTF/ChangeLog (230302 => 230303)
--- trunk/Source/WTF/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,56 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works
+ in either static storage and dynamic storage. Remove StaticLock and
+ always use Lock.
+
+ We also remove StaticWordLock and StaticReadWriteLock. And we add
+ WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>.
+
+ * wtf/HashTable.cpp:
+ (WTF::HashTableStats::recordCollisionAtCount):
+ (WTF::HashTableStats::dumpStats):
+ * wtf/Language.cpp:
+ (WTF::userPreferredLanguages):
+ * wtf/Lock.h:
+ * wtf/MainThread.cpp:
+ (WTF::dispatchFunctionsFromMainThread):
+ (WTF::callOnMainThread):
+ * wtf/ParkingLot.cpp:
+ * wtf/ReadWriteLock.h:
+ * wtf/RecursiveLockAdapter.h:
+ * wtf/StackStats.cpp:
+ (WTF::StackStats::CheckPoint::CheckPoint):
+ (WTF::StackStats::CheckPoint::~CheckPoint):
+ (WTF::StackStats::probe):
+ (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
+ (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
+ * wtf/StackStats.h:
+ * wtf/ThreadMessage.cpp:
+ (WTF::sendMessageScoped):
+ * wtf/ThreadingPthreads.cpp:
+ * wtf/ThreadingWin.cpp:
+ * wtf/WordLock.h:
+ * wtf/cf/LanguageCF.cpp:
+ (WTF::languagePreferencesDidChange):
+ (WTF::platformUserPreferredLanguages):
+ * wtf/dtoa.cpp:
+ * wtf/text/AtomicStringImpl.cpp:
+ * wtf/text/StringView.cpp:
+ (WTF::StringView::invalidate):
+ (WTF::StringView::adoptUnderlyingString):
+ (WTF::StringView::setUnderlyingString):
+ * wtf/unicode/icu/CollatorICU.cpp:
+ (WTF::Collator::Collator):
+ (WTF::Collator::~Collator):
+ * wtf/win/LanguageWin.cpp:
+ (WTF::platformLanguage):
+
2018-04-04 Brent Fulgham <[email protected]>
Failures from mach port reference handling should be fatal
Modified: trunk/Source/WTF/wtf/HashTable.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/HashTable.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/HashTable.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -36,11 +36,11 @@
unsigned HashTableStats::collisionGraph[4096];
unsigned HashTableStats::maxCollisions;
-static StaticLock hashTableStatsMutex;
+static Lock hashTableStatsMutex;
void HashTableStats::recordCollisionAtCount(unsigned count)
{
- std::lock_guard<StaticLock> lock(hashTableStatsMutex);
+ std::lock_guard<Lock> lock(hashTableStatsMutex);
if (count > maxCollisions)
maxCollisions = count;
@@ -50,7 +50,7 @@
void HashTableStats::dumpStats()
{
- std::lock_guard<StaticLock> lock(hashTableStatsMutex);
+ std::lock_guard<Lock> lock(hashTableStatsMutex);
dataLogF("\nWTF::HashTable statistics\n\n");
dataLogF("%u accesses\n", numAccesses.load());
Modified: trunk/Source/WTF/wtf/Language.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/Language.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/Language.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -37,7 +37,7 @@
namespace WTF {
-static StaticLock userPreferredLanguagesMutex;
+static Lock userPreferredLanguagesMutex;
typedef HashMap<void*, LanguageChangeObserverFunction> ObserverMap;
static ObserverMap& observerMap()
@@ -102,7 +102,7 @@
Vector<String> userPreferredLanguages()
{
{
- std::lock_guard<StaticLock> lock(userPreferredLanguagesMutex);
+ std::lock_guard<Lock> lock(userPreferredLanguagesMutex);
Vector<String>& override = preferredLanguagesOverride();
if (!override.isEmpty())
return isolatedCopy(override);
Modified: trunk/Source/WTF/wtf/Lock.h (230302 => 230303)
--- trunk/Source/WTF/wtf/Lock.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/Lock.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -132,7 +132,6 @@
Atomic<uint8_t> m_byte { 0 };
};
-using StaticLock = Lock;
using LockHolder = Locker<Lock>;
} // namespace WTF
@@ -139,7 +138,6 @@
using WTF::Lock;
using WTF::LockHolder;
-using WTF::StaticLock;
#endif // WTF_Lock_h
Modified: trunk/Source/WTF/wtf/MainThread.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/MainThread.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/MainThread.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -46,7 +46,7 @@
static Thread* mainThread { nullptr };
#endif
-static StaticLock mainThreadFunctionQueueMutex;
+static Lock mainThreadFunctionQueueMutex;
static Deque<Function<void ()>>& functionQueue()
{
@@ -119,7 +119,7 @@
while (true) {
{
- std::lock_guard<StaticLock> lock(mainThreadFunctionQueueMutex);
+ std::lock_guard<Lock> lock(mainThreadFunctionQueueMutex);
if (!functionQueue().size())
break;
@@ -149,7 +149,7 @@
bool needToSchedule = false;
{
- std::lock_guard<StaticLock> lock(mainThreadFunctionQueueMutex);
+ std::lock_guard<Lock> lock(mainThreadFunctionQueueMutex);
needToSchedule = functionQueue().size() == 0;
functionQueue().append(WTFMove(function));
}
Modified: trunk/Source/WTF/wtf/ParkingLot.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/ParkingLot.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/ParkingLot.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -205,7 +205,7 @@
// We track all allocated hashtables so that hashtable resizing doesn't anger leak detectors.
Vector<Hashtable*>* hashtables;
-StaticWordLock hashtablesLock;
+WordLock hashtablesLock;
struct Hashtable {
unsigned size;
Modified: trunk/Source/WTF/wtf/ReadWriteLock.h (230302 => 230303)
--- trunk/Source/WTF/wtf/ReadWriteLock.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/ReadWriteLock.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -85,10 +85,6 @@
inline ReadWriteLock::ReadLock& ReadWriteLock::read() { return *static_cast<ReadLock*>(this); }
inline ReadWriteLock::WriteLock& ReadWriteLock::write() { return *static_cast<WriteLock*>(this); }
-using StaticReadWriteLock = ReadWriteLock;
-
} // namespace WTF
using WTF::ReadWriteLock;
-using WTF::StaticReadWriteLock;
-
Modified: trunk/Source/WTF/wtf/RecursiveLockAdapter.h (230302 => 230303)
--- trunk/Source/WTF/wtf/RecursiveLockAdapter.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/RecursiveLockAdapter.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -25,6 +25,7 @@
#pragma once
+#include <wtf/Lock.h>
#include <wtf/Threading.h>
namespace WTF {
@@ -86,6 +87,8 @@
LockType m_lock;
};
+using RecursiveLock = RecursiveLockAdapter<Lock>;
+
} // namespace WTF
-
+using WTF::RecursiveLock;
Modified: trunk/Source/WTF/wtf/StackStats.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/StackStats.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/StackStats.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -41,7 +41,7 @@
namespace WTF {
// CheckPoint management:
-StaticLock StackStats::s_sharedMutex;
+Lock StackStats::s_sharedMutex;
StackStats::CheckPoint* StackStats::s_topCheckPoint = 0;
StackStats::LayoutCheckPoint* StackStats::s_firstLayoutCheckPoint = 0;
StackStats::LayoutCheckPoint* StackStats::s_topLayoutCheckPoint = 0;
@@ -68,7 +68,7 @@
StackStats::CheckPoint::CheckPoint()
{
- std::lock_guard<StaticLock> lock(StackStats::s_sharedMutex);
+ std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -126,7 +126,7 @@
StackStats::CheckPoint::~CheckPoint()
{
- std::lock_guard<StaticLock> lock(StackStats::s_sharedMutex);
+ std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
@@ -157,7 +157,7 @@
void StackStats::probe()
{
- std::lock_guard<StaticLock> lock(StackStats::s_sharedMutex);
+ std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -218,7 +218,7 @@
// probe first, we can avoid re-entering the lock.
StackStats::probe();
- std::lock_guard<StaticLock> lock(StackStats::s_sharedMutex);
+ std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
@@ -287,7 +287,7 @@
StackStats::LayoutCheckPoint::~LayoutCheckPoint()
{
- std::lock_guard<StaticLock> lock(StackStats::s_sharedMutex);
+ std::lock_guard<Lock> lock(StackStats::s_sharedMutex);
// Pop to the previous layout checkpoint:
StackStats::s_topLayoutCheckPoint = m_prev;
Modified: trunk/Source/WTF/wtf/StackStats.h (230302 => 230303)
--- trunk/Source/WTF/wtf/StackStats.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/StackStats.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -120,7 +120,7 @@
private:
// CheckPoint management:
- static StaticLock s_sharedMutex;
+ static Lock s_sharedMutex;
static CheckPoint* s_topCheckPoint;
static LayoutCheckPoint* s_firstLayoutCheckPoint;
static LayoutCheckPoint* s_topLayoutCheckPoint;
Modified: trunk/Source/WTF/wtf/ThreadMessage.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/ThreadMessage.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/ThreadMessage.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -33,7 +33,7 @@
MessageStatus sendMessageScoped(Thread& thread, const ThreadMessage& message)
{
- static StaticLock messageLock;
+ static Lock messageLock;
auto lockholder = holdLock(messageLock);
auto result = thread.suspend();
Modified: trunk/Source/WTF/wtf/ThreadingPthreads.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -68,7 +68,7 @@
namespace WTF {
-static StaticLock globalSuspendLock;
+static Lock globalSuspendLock;
Thread::~Thread()
{
Modified: trunk/Source/WTF/wtf/ThreadingWin.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/ThreadingWin.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/ThreadingWin.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -100,7 +100,7 @@
namespace WTF {
-static StaticLock globalSuspendLock;
+static Lock globalSuspendLock;
Thread::~Thread()
{
Modified: trunk/Source/WTF/wtf/WordLock.h (230302 => 230303)
--- trunk/Source/WTF/wtf/WordLock.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/WordLock.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -101,7 +101,6 @@
Atomic<uintptr_t> m_word { 0 };
};
-using StaticWordLock = WordLock;
using WordLockHolder = Locker<WordLock>;
} // namespace WTF
@@ -108,7 +107,6 @@
using WTF::WordLock;
using WTF::WordLockHolder;
-using WTF::StaticWordLock;
#endif // WTF_WordLock_h
Modified: trunk/Source/WTF/wtf/cf/LanguageCF.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/cf/LanguageCF.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/cf/LanguageCF.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -38,7 +38,7 @@
namespace WTF {
-static StaticLock preferredLanguagesMutex;
+static Lock preferredLanguagesMutex;
static Vector<String>& preferredLanguages()
{
@@ -76,7 +76,7 @@
static void languagePreferencesDidChange(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef)
{
{
- std::lock_guard<StaticLock> lock(preferredLanguagesMutex);
+ std::lock_guard<Lock> lock(preferredLanguagesMutex);
preferredLanguages().clear();
}
@@ -93,7 +93,7 @@
});
#endif
- std::lock_guard<StaticLock> lock(preferredLanguagesMutex);
+ std::lock_guard<Lock> lock(preferredLanguagesMutex);
Vector<String>& userPreferredLanguages = preferredLanguages();
if (userPreferredLanguages.isEmpty()) {
Modified: trunk/Source/WTF/wtf/dtoa.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/dtoa.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/dtoa.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -55,7 +55,7 @@
namespace WTF {
-static StaticLock s_dtoaP5Mutex;
+static Lock s_dtoaP5Mutex;
typedef union {
double d;
Modified: trunk/Source/WTF/wtf/text/AtomicStringImpl.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/text/AtomicStringImpl.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/text/AtomicStringImpl.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -47,7 +47,7 @@
class AtomicStringTableLocker : public LockHolder {
WTF_MAKE_NONCOPYABLE(AtomicStringTableLocker);
- static StaticLock s_stringTableLock;
+ static Lock s_stringTableLock;
public:
AtomicStringTableLocker()
: LockHolder(&s_stringTableLock)
@@ -55,7 +55,7 @@
}
};
-StaticLock AtomicStringTableLocker::s_stringTableLock;
+Lock AtomicStringTableLocker::s_stringTableLock;
#else
Modified: trunk/Source/WTF/wtf/text/StringView.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/text/StringView.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/text/StringView.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -215,7 +215,7 @@
{
}
-static StaticLock underlyingStringsMutex;
+static Lock underlyingStringsMutex;
static HashMap<const StringImpl*, StringView::UnderlyingString*>& underlyingStrings()
{
@@ -227,7 +227,7 @@
{
UnderlyingString* underlyingString;
{
- std::lock_guard<StaticLock> lock(underlyingStringsMutex);
+ std::lock_guard<Lock> lock(underlyingStringsMutex);
underlyingString = underlyingStrings().take(&stringToBeDestroyed);
if (!underlyingString)
return;
@@ -244,7 +244,7 @@
void StringView::adoptUnderlyingString(UnderlyingString* underlyingString)
{
if (m_underlyingString) {
- std::lock_guard<StaticLock> lock(underlyingStringsMutex);
+ std::lock_guard<Lock> lock(underlyingStringsMutex);
if (!--m_underlyingString->refCount) {
if (m_underlyingString->isValid) {
underlyingStrings().remove(&m_underlyingString->string);
@@ -261,7 +261,7 @@
if (!string)
underlyingString = nullptr;
else {
- std::lock_guard<StaticLock> lock(underlyingStringsMutex);
+ std::lock_guard<Lock> lock(underlyingStringsMutex);
auto result = underlyingStrings().add(string, nullptr);
if (result.isNewEntry)
result.iterator->value = new UnderlyingString(*string);
Modified: trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/unicode/icu/CollatorICU.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -49,7 +49,7 @@
static char* cachedCollatorLocale;
static bool cachedCollatorShouldSortLowercaseFirst;
-static StaticLock cachedCollatorMutex;
+static Lock cachedCollatorMutex;
#if !(OS(DARWIN) && USE(CF))
@@ -106,7 +106,7 @@
UErrorCode status = U_ZERO_ERROR;
{
- std::lock_guard<StaticLock> lock(cachedCollatorMutex);
+ std::lock_guard<Lock> lock(cachedCollatorMutex);
if (cachedCollator && localesMatch(cachedCollatorLocale, locale) && cachedCollatorShouldSortLowercaseFirst == shouldSortLowercaseFirst) {
m_collator = cachedCollator;
m_locale = cachedCollatorLocale;
@@ -136,7 +136,7 @@
Collator::~Collator()
{
- std::lock_guard<StaticLock> lock(cachedCollatorMutex);
+ std::lock_guard<Lock> lock(cachedCollatorMutex);
if (cachedCollator) {
ucol_close(cachedCollator);
fastFree(cachedCollatorLocale);
Modified: trunk/Source/WTF/wtf/win/LanguageWin.cpp (230302 => 230303)
--- trunk/Source/WTF/wtf/win/LanguageWin.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WTF/wtf/win/LanguageWin.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -34,7 +34,7 @@
namespace WTF {
-static StaticLock platformLanguageMutex;
+static Lock platformLanguageMutex;
static String localeInfo(LCTYPE localeType, const String& fallback)
{
@@ -56,7 +56,7 @@
static String platformLanguage()
{
- std::lock_guard<StaticLock> lock(platformLanguageMutex);
+ std::lock_guard<Lock> lock(platformLanguageMutex);
static String computedDefaultLanguage;
if (!computedDefaultLanguage.isEmpty())
Modified: trunk/Source/WebCore/ChangeLog (230302 => 230303)
--- trunk/Source/WebCore/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,56 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ No behavior change.
+
+ * Modules/webdatabase/Database.cpp:
+ (WebCore::Database::Database):
+ (WebCore::Database::performOpenAndVerify):
+ (WebCore::Database::closeDatabase):
+ (WebCore::Database::getCachedVersion const):
+ (WebCore::Database::setCachedVersion):
+ * Modules/webdatabase/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::openDatabaseMutex):
+ * Modules/webdatabase/DatabaseTracker.h:
+ * Modules/websockets/WebSocket.cpp:
+ (WebCore::WebSocket::allActiveWebSocketsMutex):
+ * Modules/websockets/WebSocket.h:
+ * bridge/objc/WebScriptObject.mm:
+ * crypto/CryptoAlgorithmRegistry.cpp:
+ (WebCore::CryptoAlgorithmRegistry::identifier):
+ (WebCore::CryptoAlgorithmRegistry::name):
+ (WebCore::CryptoAlgorithmRegistry::create):
+ (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
+ * dom/Node.cpp:
+ * platform/URL.cpp:
+ * platform/graphics/FontCache.cpp:
+ * platform/graphics/MediaPlayer.cpp:
+ * platform/ios/QuickLook.mm:
+ * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
+ * platform/ios/wak/WebCoreThread.mm:
+ * platform/ios/wak/WebCoreThreadRun.cpp:
+ * platform/network/cf/LoaderRunLoopCF.cpp:
+ (WebCore::loaderRunLoop):
+ * platform/network/curl/CurlContext.cpp:
+ (WebCore::CurlShareHandle::mutexFor):
+ * platform/network/curl/CurlContext.h:
+ * platform/sql/SQLiteDatabaseTracker.cpp:
+ (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
+ (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
+ * platform/text/TextEncodingRegistry.cpp:
+ (WebCore::buildBaseTextCodecMaps):
+ (WebCore::newTextCodec):
+ (WebCore::atomicCanonicalTextEncodingName):
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThread::workerThreadCount):
+ (WebCore::WorkerThread::WorkerThread):
+ (WebCore::WorkerThread::~WorkerThread):
+ (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
+
2018-04-04 Youenn Fablet <[email protected]>
WebRTC data channel only applications require capture permissions for direct connections
Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (230302 => 230303)
--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -155,7 +155,7 @@
}
// FIXME: move all guid-related functions to a DatabaseVersionTracker class.
-static StaticLock guidMutex;
+static Lock guidMutex;
static HashMap<DatabaseGUID, String>& guidToVersionMap()
{
@@ -204,7 +204,7 @@
, m_databaseAuthorizer(DatabaseAuthorizer::create(unqualifiedInfoTableName))
{
{
- std::lock_guard<StaticLock> locker(guidMutex);
+ std::lock_guard<Lock> locker(guidMutex);
m_guid = guidForOriginAndName(securityOrigin().securityOrigin()->toString(), name);
guidToDatabaseMap().ensure(m_guid, [] {
@@ -356,7 +356,7 @@
String currentVersion;
{
- std::lock_guard<StaticLock> locker(guidMutex);
+ std::lock_guard<Lock> locker(guidMutex);
auto entry = guidToVersionMap().find(m_guid);
if (entry != guidToVersionMap().end()) {
@@ -445,7 +445,7 @@
DatabaseTracker::singleton().removeOpenDatabase(*this);
{
- std::lock_guard<StaticLock> locker(guidMutex);
+ std::lock_guard<Lock> locker(guidMutex);
auto it = guidToDatabaseMap().find(m_guid);
ASSERT(it != guidToDatabaseMap().end());
@@ -503,7 +503,7 @@
String Database::getCachedVersion() const
{
- std::lock_guard<StaticLock> locker(guidMutex);
+ std::lock_guard<Lock> locker(guidMutex);
return guidToVersionMap().get(m_guid).isolatedCopy();
}
@@ -510,7 +510,7 @@
void Database::setCachedVersion(const String& actualVersion)
{
- std::lock_guard<StaticLock> locker(guidMutex);
+ std::lock_guard<Lock> locker(guidMutex);
updateGUIDVersionMap(m_guid, actualVersion);
}
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (230302 => 230303)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1275,8 +1275,8 @@
return SQLiteFileSystem::deleteDatabaseFile(path);
}
-static StaticLock openDatabaseLock;
-StaticLock& DatabaseTracker::openDatabaseMutex()
+static Lock openDatabaseLock;
+Lock& DatabaseTracker::openDatabaseMutex()
{
return openDatabaseLock;
}
@@ -1300,7 +1300,7 @@
m_client = client;
}
-static StaticLock notificationLock;
+static Lock notificationLock;
using NotificationQueue = Vector<std::pair<SecurityOriginData, String>>;
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h (230302 => 230303)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -101,7 +101,7 @@
// MobileSafari will grab this mutex on the main thread before dispatching the task to
// clean up zero byte database files. Any operations to open new database will have to
// wait for that task to finish by waiting on this mutex.
- static StaticLock& openDatabaseMutex();
+ static Lock& openDatabaseMutex();
WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskWillBeScheduled();
WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskDidFinish();
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (230302 => 230303)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -185,9 +185,9 @@
return activeWebSockets;
}
-StaticLock& WebSocket::allActiveWebSocketsMutex()
+Lock& WebSocket::allActiveWebSocketsMutex()
{
- static StaticLock mutex;
+ static Lock mutex;
return mutex;
}
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.h (230302 => 230303)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -60,7 +60,7 @@
virtual ~WebSocket();
static HashSet<WebSocket*>& allActiveWebSockets(const LockHolder&);
- static StaticLock& allActiveWebSocketsMutex();
+ static Lock& allActiveWebSocketsMutex();
enum State {
CONNECTING = 0,
Modified: trunk/Source/WebCore/bridge/objc/WebScriptObject.mm (230302 => 230303)
--- trunk/Source/WebCore/bridge/objc/WebScriptObject.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/bridge/objc/WebScriptObject.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -71,7 +71,7 @@
namespace WebCore {
-static StaticLock spinLock;
+static Lock spinLock;
static CreateWrapperFunction createDOMWrapperFunction;
static DisconnectWindowWrapperFunction disconnectWindowWrapperFunction;
Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp (230302 => 230303)
--- trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -34,7 +34,7 @@
namespace WebCore {
-static StaticLock registryMutex;
+static Lock registryMutex;
CryptoAlgorithmRegistry& CryptoAlgorithmRegistry::singleton()
{
@@ -52,7 +52,7 @@
if (name.isEmpty())
return std::nullopt;
- std::lock_guard<StaticLock> lock(registryMutex);
+ std::lock_guard<Lock> lock(registryMutex);
// FIXME: How is it helpful to call isolatedCopy on the argument to find?
auto identifier = m_identifiers.find(name.isolatedCopy());
@@ -64,7 +64,7 @@
String CryptoAlgorithmRegistry::name(CryptoAlgorithmIdentifier identifier)
{
- std::lock_guard<StaticLock> lock(registryMutex);
+ std::lock_guard<Lock> lock(registryMutex);
auto contructor = m_constructors.find(static_cast<unsigned>(identifier));
if (contructor == m_constructors.end())
@@ -75,7 +75,7 @@
RefPtr<CryptoAlgorithm> CryptoAlgorithmRegistry::create(CryptoAlgorithmIdentifier identifier)
{
- std::lock_guard<StaticLock> lock(registryMutex);
+ std::lock_guard<Lock> lock(registryMutex);
auto contructor = m_constructors.find(static_cast<unsigned>(identifier));
if (contructor == m_constructors.end())
@@ -86,7 +86,7 @@
void CryptoAlgorithmRegistry::registerAlgorithm(const String& name, CryptoAlgorithmIdentifier identifier, CryptoAlgorithmConstructor constructor)
{
- std::lock_guard<StaticLock> lock(registryMutex);
+ std::lock_guard<Lock> lock(registryMutex);
ASSERT(!m_identifiers.contains(name));
ASSERT(!m_constructors.contains(static_cast<unsigned>(identifier)));
Modified: trunk/Source/WebCore/dom/Node.cpp (230302 => 230303)
--- trunk/Source/WebCore/dom/Node.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/dom/Node.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -2154,7 +2154,7 @@
return map;
}
-static StaticLock s_eventTargetDataMapLock;
+static Lock s_eventTargetDataMapLock;
EventTargetData* Node::eventTargetData()
{
Modified: trunk/Source/WebCore/platform/URL.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/URL.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/URL.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -275,7 +275,7 @@
#endif
-static StaticLock defaultPortForProtocolMapForTestingLock;
+static Lock defaultPortForProtocolMapForTestingLock;
using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>;
static DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMapForTesting()
Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/graphics/FontCache.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -53,8 +53,7 @@
#include <wtf/Lock.h>
#include <wtf/RecursiveLockAdapter.h>
-using RecursiveStaticLock = WTF::RecursiveLockAdapter<StaticLock>;
-static RecursiveStaticLock fontLock;
+static RecursiveLock fontLock;
#endif // PLATFORM(IOS)
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -207,7 +207,7 @@
static void addMediaEngine(CreateMediaEnginePlayer&&, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineOriginsInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForOrigins, MediaEngineSupportsKeySystem);
-static StaticLock mediaEngineVectorLock;
+static Lock mediaEngineVectorLock;
static bool& haveMediaEnginesVector()
{
Modified: trunk/Source/WebCore/platform/ios/QuickLook.mm (230302 => 230303)
--- trunk/Source/WebCore/platform/ios/QuickLook.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/ios/QuickLook.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -46,7 +46,7 @@
return set;
}
-static StaticLock qlPreviewConverterDictionaryLock;
+static Lock qlPreviewConverterDictionaryLock;
static NSMutableDictionary *QLPreviewConverterDictionary()
{
Modified: trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm (230302 => 230303)
--- trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -84,7 +84,7 @@
}
-static StaticLock transactionBackgroundTaskIdentifierLock;
+static Lock transactionBackgroundTaskIdentifierLock;
static NSUInteger transactionBackgroundTaskIdentifier;
Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm (230302 => 230303)
--- trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -91,12 +91,10 @@
}
#endif
-using StaticRecursiveLock = WTF::RecursiveLockAdapter<StaticLock>;
+static RecursiveLock webLock;
+static Lock webThreadReleaseLock;
+static RecursiveLock webCoreReleaseLock;
-static StaticRecursiveLock webLock;
-static StaticLock webThreadReleaseLock;
-static StaticRecursiveLock webCoreReleaseLock;
-
static NSAutoreleasePoolMark autoreleasePoolMark;
static CFRunLoopRef webThreadRunLoop;
static NSRunLoop* webThreadNSRunLoop;
@@ -117,7 +115,7 @@
static void MainThreadAdoptAndRelease(id obj);
-static StaticLock delegateLock;
+static Lock delegateLock;
static StaticCondition delegateCondition;
static NSInvocation* delegateInvocation;
static CFRunLoopSourceRef delegateSource = nullptr;
@@ -128,7 +126,7 @@
static CFRunLoopObserverRef mainRunLoopAutoUnlockObserver;
-static StaticLock startupLock;
+static Lock startupLock;
static StaticCondition startupCondition;
static WebThreadContext* webThreadContext;
Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThreadRun.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -111,7 +111,7 @@
typedef WTF::Vector<WebThreadBlock> WebThreadRunQueue;
-static StaticLock runQueueMutex;
+static Lock runQueueMutex;
static CFRunLoopSourceRef runSource;
static WebThreadRunQueue* runQueue;
@@ -124,7 +124,7 @@
WebThreadRunQueue queueCopy;
{
- std::lock_guard<StaticLock> lock(runQueueMutex);
+ std::lock_guard<Lock> lock(runQueueMutex);
queueCopy = *runQueue;
runQueue->clear();
}
@@ -148,7 +148,7 @@
state = new WebThreadBlockState;
{
- std::lock_guard<StaticLock> lock(runQueueMutex);
+ std::lock_guard<Lock> lock(runQueueMutex);
runQueue->append(WebThreadBlock(block, state));
}
Modified: trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -41,7 +41,7 @@
static CFRunLoopRef loaderRunLoopObject = 0;
-static StaticLock loaderRunLoopMutex;
+static Lock loaderRunLoopMutex;
static StaticCondition loaderRunLoopConditionVariable;
static void emptyPerform(void*)
@@ -52,12 +52,12 @@
{
ASSERT(isMainThread());
- std::unique_lock<StaticLock> lock(loaderRunLoopMutex);
+ std::unique_lock<Lock> lock(loaderRunLoopMutex);
if (!loaderRunLoopObject) {
Thread::create("WebCore: CFNetwork Loader", [] {
{
- std::lock_guard<StaticLock> lock(loaderRunLoopMutex);
+ std::lock_guard<Lock> lock(loaderRunLoopMutex);
loaderRunLoopObject = CFRunLoopGetCurrent();
Modified: trunk/Source/WebCore/platform/network/curl/CurlContext.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/network/curl/CurlContext.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/network/curl/CurlContext.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -199,11 +199,11 @@
mutex->unlock();
}
-StaticLock* CurlShareHandle::mutexFor(curl_lock_data data)
+Lock* CurlShareHandle::mutexFor(curl_lock_data data)
{
- static StaticLock cookieMutex;
- static StaticLock dnsMutex;
- static StaticLock shareMutex;
+ static Lock cookieMutex;
+ static Lock dnsMutex;
+ static Lock shareMutex;
switch (data) {
case CURL_LOCK_DATA_COOKIE:
Modified: trunk/Source/WebCore/platform/network/curl/CurlContext.h (230302 => 230303)
--- trunk/Source/WebCore/platform/network/curl/CurlContext.h 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/network/curl/CurlContext.h 2018-04-05 17:22:21 UTC (rev 230303)
@@ -89,7 +89,7 @@
private:
static void lockCallback(CURL*, curl_lock_data, curl_lock_access, void*);
static void unlockCallback(CURL*, curl_lock_data, void*);
- static StaticLock* mutexFor(curl_lock_data);
+ static Lock* mutexFor(curl_lock_data);
CURLSH* m_shareHandle { nullptr };
};
Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -36,7 +36,7 @@
static SQLiteDatabaseTrackerClient* s_staticSQLiteDatabaseTrackerClient = nullptr;
static unsigned s_transactionInProgressCounter = 0;
-static StaticLock transactionInProgressMutex;
+static Lock transactionInProgressMutex;
void setClient(SQLiteDatabaseTrackerClient* client)
{
@@ -50,7 +50,7 @@
if (!s_staticSQLiteDatabaseTrackerClient)
return;
- std::lock_guard<StaticLock> lock(transactionInProgressMutex);
+ std::lock_guard<Lock> lock(transactionInProgressMutex);
s_transactionInProgressCounter++;
if (s_transactionInProgressCounter == 1)
@@ -62,7 +62,7 @@
if (!s_staticSQLiteDatabaseTrackerClient)
return;
- std::lock_guard<StaticLock> lock(transactionInProgressMutex);
+ std::lock_guard<Lock> lock(transactionInProgressMutex);
ASSERT(s_transactionInProgressCounter);
s_transactionInProgressCounter--;
Modified: trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp (230302 => 230303)
--- trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -90,7 +90,7 @@
using TextEncodingNameMap = HashMap<const char*, const char*, TextEncodingNameHash>;
using TextCodecMap = HashMap<const char*, NewTextCodecFunction>;
-static StaticLock encodingRegistryMutex;
+static Lock encodingRegistryMutex;
static TextEncodingNameMap* textEncodingNameMap;
static TextCodecMap* textCodecMap;
@@ -156,7 +156,7 @@
}
}
-static void buildBaseTextCodecMaps(const std::lock_guard<StaticLock>&)
+static void buildBaseTextCodecMaps(const std::lock_guard<Lock>&)
{
ASSERT(!textCodecMap);
ASSERT(!textEncodingNameMap);
@@ -244,7 +244,7 @@
std::unique_ptr<TextCodec> newTextCodec(const TextEncoding& encoding)
{
- std::lock_guard<StaticLock> lock(encodingRegistryMutex);
+ std::lock_guard<Lock> lock(encodingRegistryMutex);
ASSERT(textCodecMap);
auto result = textCodecMap->find(encoding.name());
@@ -257,7 +257,7 @@
if (!name || !name[0])
return nullptr;
- std::lock_guard<StaticLock> lock(encodingRegistryMutex);
+ std::lock_guard<Lock> lock(encodingRegistryMutex);
if (!textEncodingNameMap)
buildBaseTextCodecMaps(lock);
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (230302 => 230303)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -53,7 +53,7 @@
namespace WebCore {
-static StaticLock threadSetMutex;
+static Lock threadSetMutex;
static HashSet<WorkerThread*>& workerThreads()
{
@@ -64,7 +64,7 @@
unsigned WorkerThread::workerThreadCount()
{
- std::lock_guard<StaticLock> lock(threadSetMutex);
+ std::lock_guard<Lock> lock(threadSetMutex);
return workerThreads().size();
}
@@ -119,7 +119,7 @@
UNUSED_PARAM(connectionProxy);
#endif
- std::lock_guard<StaticLock> lock(threadSetMutex);
+ std::lock_guard<Lock> lock(threadSetMutex);
workerThreads().add(this);
}
@@ -126,7 +126,7 @@
WorkerThread::~WorkerThread()
{
- std::lock_guard<StaticLock> lock(threadSetMutex);
+ std::lock_guard<Lock> lock(threadSetMutex);
ASSERT(workerThreads().contains(this));
workerThreads().remove(this);
@@ -315,7 +315,7 @@
void WorkerThread::releaseFastMallocFreeMemoryInAllThreads()
{
- std::lock_guard<StaticLock> lock(threadSetMutex);
+ std::lock_guard<Lock> lock(threadSetMutex);
for (auto* workerThread : workerThreads()) {
workerThread->runLoop().postTask([] (ScriptExecutionContext&) {
Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (230302 => 230303)
--- trunk/Source/WebKitLegacy/ios/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,12 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ * WebCoreSupport/WebFixedPositionContent.mm:
+
2018-03-28 Zalan Bujtas <[email protected]>
Make it possible to override the screen size
Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm (230302 => 230303)
--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -49,7 +49,7 @@
using namespace WebCore;
using namespace std;
-static StaticLock webFixedPositionContentDataLock;
+static Lock webFixedPositionContentDataLock;
struct ViewportConstrainedLayerData {
ViewportConstrainedLayerData()
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (230302 => 230303)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,15 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ * DOM/DOMInternal.mm:
+ (getDOMWrapper):
+ (addDOMWrapper):
+ (removeDOMWrapper):
+
2018-04-04 Brent Fulgham <[email protected]>
Failures from mach port reference handling should be fatal
Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm (230302 => 230303)
--- trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMInternal.mm 2018-04-05 17:22:21 UTC (rev 230303)
@@ -44,7 +44,7 @@
// Wrapping WebCore implementation objects
#ifdef NEEDS_WRAPPER_CACHE_LOCK
-static StaticLock wrapperCacheLock;
+static Lock wrapperCacheLock;
#endif
static HashMap<DOMObjectInternal*, NSObject *>& wrapperCache()
@@ -56,7 +56,7 @@
NSObject* getDOMWrapper(DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<StaticLock> lock(wrapperCacheLock);
+ std::lock_guard<Lock> lock(wrapperCacheLock);
#endif
return wrapperCache().get(impl);
}
@@ -64,7 +64,7 @@
void addDOMWrapper(NSObject* wrapper, DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<StaticLock> lock(wrapperCacheLock);
+ std::lock_guard<Lock> lock(wrapperCacheLock);
#endif
wrapperCache().set(impl, wrapper);
}
@@ -72,7 +72,7 @@
void removeDOMWrapper(DOMObjectInternal* impl)
{
#ifdef NEEDS_WRAPPER_CACHE_LOCK
- std::lock_guard<StaticLock> lock(wrapperCacheLock);
+ std::lock_guard<Lock> lock(wrapperCacheLock);
#endif
wrapperCache().remove(impl);
}
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (230302 => 230303)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,14 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ * WebKitQuartzCoreAdditions/CAView.cpp:
+ (WKQCA::CAView::releaseAllD3DResources):
+ * WebLocalizableStrings.cpp:
+
2018-04-03 Chris Dumez <[email protected]>
Drop MainFrame class
Modified: trunk/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp (230302 => 230303)
--- trunk/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAView.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -68,7 +68,7 @@
CAView* m_view;
};
-static StaticLock globalStateLock;
+static Lock globalStateLock;
static HWND messageWindow;
static const wchar_t messageWindowClassName[] = L"CAViewMessageWindow";
@@ -106,7 +106,7 @@
void CAView::releaseAllD3DResources()
{
- static StaticLock lock;
+ static Lock lock;
if (!lock.tryLock()) {
// Another thread is currently releasing 3D resources.
Modified: trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp (230302 => 230303)
--- trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -45,7 +45,7 @@
typedef HashMap<String, LocalizedString*> LocalizedStringMap;
-static StaticLock mainBundleLocStringsLock;
+static Lock mainBundleLocStringsLock;
static LocalizedStringMap& mainBundleLocStrings()
{
@@ -53,7 +53,7 @@
return map;
}
-static StaticLock frameworkLocStringsLock;
+static Lock frameworkLocStringsLock;
static LocalizedStringMap frameworkLocStrings()
{
Modified: trunk/Tools/ChangeLog (230302 => 230303)
--- trunk/Tools/ChangeLog 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Tools/ChangeLog 2018-04-05 17:22:21 UTC (rev 230303)
@@ -1,3 +1,12 @@
+2018-04-05 Yusuke Suzuki <[email protected]>
+
+ [WTF] Remove StaticLock
+ https://bugs.webkit.org/show_bug.cgi?id=184332
+
+ Reviewed by Mark Lam.
+
+ * DumpRenderTree/_javascript_Threading.cpp:
+
2018-04-05 Zalan Bujtas <[email protected]>
[LayoutReloaded] Find the correct left edge for a line when floating boxes are in parent formatting context.
Modified: trunk/Tools/DumpRenderTree/_javascript_Threading.cpp (230302 => 230303)
--- trunk/Tools/DumpRenderTree/_javascript_Threading.cpp 2018-04-05 17:05:12 UTC (rev 230302)
+++ trunk/Tools/DumpRenderTree/_javascript_Threading.cpp 2018-04-05 17:22:21 UTC (rev 230303)
@@ -45,7 +45,7 @@
static const size_t _javascript_ThreadsCount = 4;
static bool _javascript_ThreadsShouldTerminate;
static JSContextGroupRef _javascript_ThreadsGroup;
-static StaticLock _javascript_ThreadsLock;
+static Lock _javascript_ThreadsLock;
typedef HashSet<RefPtr<Thread>> ThreadSet;
static ThreadSet& _javascript_Threads()