<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188475] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188475">188475</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-14 09:53:37 -0700 (Fri, 14 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/188444">r188444</a>.
https://bugs.webkit.org/show_bug.cgi?id=148029

Broke GTK and EFL (see bug #148027) (Requested by philn on
#webkit).

Reverted changeset:

&quot;Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
WTF::ThreadCondition, std::mutex, and std::condition_variable&quot;
https://bugs.webkit.org/show_bug.cgi?id=147999
http://trac.webkit.org/changeset/188444</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSVirtualMachinemm">trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeSamplingToolcpp">trunk/Source/JavaScriptCore/bytecode/SamplingTool.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeSamplingToolh">trunk/Source/JavaScriptCore/bytecode/SamplingTool.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGThreadDatah">trunk/Source/JavaScriptCore/dfg/DFGThreadData.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGWorklistcpp">trunk/Source/JavaScriptCore/dfg/DFGWorklist.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGWorklisth">trunk/Source/JavaScriptCore/dfg/DFGWorklist.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredisassemblerDisassemblercpp">trunk/Source/JavaScriptCore/disassembler/Disassembler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapCopiedSpacecpp">trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapCopiedSpaceh">trunk/Source/JavaScriptCore/heap/CopiedSpace.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapCopiedSpaceInlinesh">trunk/Source/JavaScriptCore/heap/CopiedSpaceInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCThreadcpp">trunk/Source/JavaScriptCore/heap/GCThread.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCThreadSharedDatacpp">trunk/Source/JavaScriptCore/heap/GCThreadSharedData.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCThreadSharedDatah">trunk/Source/JavaScriptCore/heap/GCThreadSharedData.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapTimerh">trunk/Source/JavaScriptCore/heap/HeapTimer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMachineStackMarkercpp">trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMachineStackMarkerh">trunk/Source/JavaScriptCore/heap/MachineStackMarker.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapSlotVisitorcpp">trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapSlotVisitorInlinesh">trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableConnectionh">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableConnectionmm">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterJSStackcpp">trunk/Source/JavaScriptCore/interpreter/JSStack.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterJSStackh">trunk/Source/JavaScriptCore/interpreter/JSStack.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorcpp">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITThunkscpp">trunk/Source/JavaScriptCore/jit/JITThunks.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITThunksh">trunk/Source/JavaScriptCore/jit/JITThunks.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerDatabasecpp">trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerDatabaseh">trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInitializeThreadingcpp">trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSLockcpp">trunk/Source/JavaScriptCore/runtime/JSLock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSLockh">trunk/Source/JavaScriptCore/runtime/JSLock.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfConditionh">trunk/Source/WTF/wtf/Condition.h</a></li>
<li><a href="#trunkSourceWTFwtfLockh">trunk/Source/WTF/wtf/Lock.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSVirtualMachinemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/API/JSVirtualMachine.mm        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,14 +36,18 @@
</span><span class="cx"> #import &quot;JSWrapperMap.h&quot;
</span><span class="cx"> #import &quot;SlotVisitorInlines.h&quot;
</span><span class="cx"> #import &lt;mutex&gt;
</span><del>-#import &lt;wtf/Lock.h&gt;
</del><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #import &lt;wtf/spi/cocoa/NSMapTableSPI.h&gt;
</span><span class="cx"> 
</span><span class="cx"> static NSMapTable *globalWrapperCache = 0;
</span><span class="cx"> 
</span><del>-static StaticLock wrapperCacheMutex;
</del><ins>+static std::mutex&amp; wrapperCacheMutex()
+{
+    static NeverDestroyed&lt;std::mutex&gt; mutex;
</ins><span class="cx"> 
</span><ins>+    return mutex;
+}
+
</ins><span class="cx"> static void initWrapperCache()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!globalWrapperCache);
</span><span class="lines">@@ -68,13 +72,13 @@
</span><span class="cx"> 
</span><span class="cx"> + (void)addWrapper:(JSVirtualMachine *)wrapper forJSContextGroupRef:(JSContextGroupRef)group
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;StaticLock&gt; lock(wrapperCacheMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(wrapperCacheMutex());
</ins><span class="cx">     NSMapInsert(wrapperCache(), group, wrapper);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (JSVirtualMachine *)wrapperForJSContextGroupRef:(JSContextGroupRef)group
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;StaticLock&gt; lock(wrapperCacheMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(wrapperCacheMutex());
</ins><span class="cx">     return static_cast&lt;JSVirtualMachine *&gt;(NSMapGet(wrapperCache(), group));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-08-14  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r188444.
+        https://bugs.webkit.org/show_bug.cgi?id=148029
+
+        Broke GTK and EFL (see bug #148027) (Requested by philn on
+        #webkit).
+
+        Reverted changeset:
+
+        &quot;Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
+        WTF::ThreadCondition, std::mutex, and std::condition_variable&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=147999
+        http://trac.webkit.org/changeset/188444
+
</ins><span class="cx"> 2015-08-13  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeSamplingToolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/SamplingTool.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/SamplingTool.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/bytecode/SamplingTool.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CODEBLOCK_SAMPLING)
</span><span class="cx">     if (CodeBlock* codeBlock = sample.codeBlock()) {
</span><del>-        LockHolder locker(m_scriptSampleMapMutex);
</del><ins>+        MutexLocker locker(m_scriptSampleMapMutex);
</ins><span class="cx">         ScriptSampleRecord* record = m_scopeSampleMap-&gt;get(codeBlock-&gt;ownerExecutable());
</span><span class="cx">         ASSERT(record);
</span><span class="cx">         record-&gt;sample(codeBlock, sample.vPC());
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx"> void SamplingTool::notifyOfScope(VM&amp; vm, ScriptExecutable* script)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CODEBLOCK_SAMPLING)
</span><del>-    LockHolder locker(m_scriptSampleMapMutex);
</del><ins>+    MutexLocker locker(m_scriptSampleMapMutex);
</ins><span class="cx">     m_scopeSampleMap-&gt;set(script, adoptPtr(new ScriptSampleRecord(vm, script)));
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(vm);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeSamplingToolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/SamplingTool.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/SamplingTool.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/bytecode/SamplingTool.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/Atomics.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/Spectrum.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="lines">@@ -339,7 +338,7 @@
</span><span class="cx">         unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
</span><span class="cx">         
</span><span class="cx"> #if ENABLE(CODEBLOCK_SAMPLING)
</span><del>-        Lock m_scriptSampleMapMutex;
</del><ins>+        Mutex m_scriptSampleMapMutex;
</ins><span class="cx">         std::unique_ptr&lt;ScriptSampleRecordMap&gt; m_scopeSampleMap;
</span><span class="cx"> #endif
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGThreadDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGThreadData.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGThreadData.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/dfg/DFGThreadData.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx"> 
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace DFG {
</span><span class="cx"> 
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     
</span><span class="cx">     Worklist* m_worklist;
</span><span class="cx">     ThreadIdentifier m_identifier;
</span><del>-    Lock m_rightToRun;
</del><ins>+    Mutex m_rightToRun;
</ins><span class="cx">     Safepoint* m_safepoint;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGWorklistcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGWorklist.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGWorklist.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/dfg/DFGWorklist.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -46,10 +46,10 @@
</span><span class="cx"> Worklist::~Worklist()
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         for (unsigned i = m_threads.size(); i--;)
</span><span class="cx">             m_queue.append(nullptr); // Use null plan to indicate that we want the thread to terminate.
</span><del>-        m_planEnqueued.notifyAll();
</del><ins>+        m_planEnqueued.broadcast();
</ins><span class="cx">     }
</span><span class="cx">     for (unsigned i = m_threads.size(); i--;)
</span><span class="cx">         waitForThreadCompletion(m_threads[i]-&gt;m_identifier);
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool Worklist::isActiveForVM(VM&amp; vm) const
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     PlanMap::const_iterator end = m_plans.end();
</span><span class="cx">     for (PlanMap::const_iterator iter = m_plans.begin(); iter != end; ++iter) {
</span><span class="cx">         if (&amp;iter-&gt;value-&gt;vm == &amp;vm)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> void Worklist::enqueue(PassRefPtr&lt;Plan&gt; passedPlan)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Plan&gt; plan = passedPlan;
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     if (Options::verboseCompilationQueue()) {
</span><span class="cx">         dump(locker, WTF::dataFile());
</span><span class="cx">         dataLog(&quot;: Enqueueing plan to optimize &quot;, plan-&gt;key(), &quot;\n&quot;);
</span><span class="lines">@@ -97,12 +97,12 @@
</span><span class="cx">     ASSERT(m_plans.find(plan-&gt;key()) == m_plans.end());
</span><span class="cx">     m_plans.add(plan-&gt;key(), plan);
</span><span class="cx">     m_queue.append(plan);
</span><del>-    m_planEnqueued.notifyOne();
</del><ins>+    m_planEnqueued.signal();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Worklist::State Worklist::compilationState(CompilationKey key)
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     PlanMap::iterator iter = m_plans.find(key);
</span><span class="cx">     if (iter == m_plans.end())
</span><span class="cx">         return NotKnown;
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     // After we release this lock, we know that although other VMs may still
</span><span class="cx">     // be adding plans, our VM will not be.
</span><span class="cx">     
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     
</span><span class="cx">     if (Options::verboseCompilationQueue()) {
</span><span class="cx">         dump(locker, WTF::dataFile());
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx"> void Worklist::removeAllReadyPlansForVM(VM&amp; vm, Vector&lt;RefPtr&lt;Plan&gt;, 8&gt;&amp; myReadyPlans)
</span><span class="cx"> {
</span><span class="cx">     DeferGC deferGC(vm.heap);
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     for (size_t i = 0; i &lt; m_readyPlans.size(); ++i) {
</span><span class="cx">         RefPtr&lt;Plan&gt; plan = m_readyPlans[i];
</span><span class="cx">         if (&amp;plan-&gt;vm != &amp;vm)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (!!requestedKey &amp;&amp; resultingState == NotKnown) {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         if (m_plans.contains(requestedKey))
</span><span class="cx">             resultingState = Compiling;
</span><span class="cx">     }
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = visitor.heap()-&gt;vm();
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         for (PlanMap::iterator iter = m_plans.begin(); iter != m_plans.end(); ++iter) {
</span><span class="cx">             Plan* plan = iter-&gt;value.get();
</span><span class="cx">             if (&amp;plan-&gt;vm != vm)
</span><span class="lines">@@ -248,7 +248,7 @@
</span><span class="cx"> void Worklist::removeDeadPlans(VM&amp; vm)
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         HashSet&lt;CompilationKey&gt; deadPlanKeys;
</span><span class="cx">         for (PlanMap::iterator iter = m_plans.begin(); iter != m_plans.end(); ++iter) {
</span><span class="cx">             Plan* plan = iter-&gt;value.get();
</span><span class="lines">@@ -295,17 +295,17 @@
</span><span class="cx"> 
</span><span class="cx"> size_t Worklist::queueLength()
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     return m_queue.size();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Worklist::dump(PrintStream&amp; out) const
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    MutexLocker locker(m_lock);
</ins><span class="cx">     dump(locker, out);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Worklist::dump(const LockHolder&amp;, PrintStream&amp; out) const
</del><ins>+void Worklist::dump(const MutexLocker&amp;, PrintStream&amp; out) const
</ins><span class="cx"> {
</span><span class="cx">     out.print(
</span><span class="cx">         &quot;Worklist(&quot;, RawPointer(this), &quot;)[Queue Length = &quot;, m_queue.size(),
</span><span class="lines">@@ -325,7 +325,7 @@
</span><span class="cx">     for (;;) {
</span><span class="cx">         RefPtr&lt;Plan&gt; plan;
</span><span class="cx">         {
</span><del>-            LockHolder locker(m_lock);
</del><ins>+            MutexLocker locker(m_lock);
</ins><span class="cx">             while (m_queue.isEmpty())
</span><span class="cx">                 m_planEnqueued.wait(m_lock);
</span><span class="cx">             
</span><span class="lines">@@ -341,9 +341,9 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         {
</span><del>-            LockHolder locker(data-&gt;m_rightToRun);
</del><ins>+            MutexLocker locker(data-&gt;m_rightToRun);
</ins><span class="cx">             {
</span><del>-                LockHolder locker(m_lock);
</del><ins>+                MutexLocker locker(m_lock);
</ins><span class="cx">                 if (plan-&gt;stage == Plan::Cancelled) {
</span><span class="cx">                     m_numberOfActiveThreads--;
</span><span class="cx">                     continue;
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx">             RELEASE_ASSERT(!plan-&gt;vm.heap.isCollecting());
</span><span class="cx">             
</span><span class="cx">             {
</span><del>-                LockHolder locker(m_lock);
</del><ins>+                MutexLocker locker(m_lock);
</ins><span class="cx">                 if (plan-&gt;stage == Plan::Cancelled) {
</span><span class="cx">                     m_numberOfActiveThreads--;
</span><span class="cx">                     continue;
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            LockHolder locker(m_lock);
</del><ins>+            MutexLocker locker(m_lock);
</ins><span class="cx">             
</span><span class="cx">             // We could have been cancelled between releasing rightToRun and acquiring m_lock.
</span><span class="cx">             // This would mean that we might be in the middle of GC right now.
</span><span class="lines">@@ -388,7 +388,7 @@
</span><span class="cx">             
</span><span class="cx">             m_readyPlans.append(plan);
</span><span class="cx">             
</span><del>-            m_planCompiled.notifyAll();
</del><ins>+            m_planCompiled.broadcast();
</ins><span class="cx">             m_numberOfActiveThreads--;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGWorklisth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGWorklist.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGWorklist.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/dfg/DFGWorklist.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -30,11 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DFGPlan.h&quot;
</span><span class="cx"> #include &quot;DFGThreadData.h&quot;
</span><del>-#include &lt;wtf/Condition.h&gt;
</del><span class="cx"> #include &lt;wtf/Deque.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +85,7 @@
</span><span class="cx">     
</span><span class="cx">     void removeAllReadyPlansForVM(VM&amp;, Vector&lt;RefPtr&lt;Plan&gt;, 8&gt;&amp;);
</span><span class="cx"> 
</span><del>-    void dump(const LockHolder&amp;, PrintStream&amp;) const;
</del><ins>+    void dump(const MutexLocker&amp;, PrintStream&amp;) const;
</ins><span class="cx">     
</span><span class="cx">     CString m_threadName;
</span><span class="cx">     
</span><span class="lines">@@ -104,11 +103,11 @@
</span><span class="cx">     // be completed.
</span><span class="cx">     Vector&lt;RefPtr&lt;Plan&gt;, 16&gt; m_readyPlans;
</span><span class="cx"> 
</span><del>-    Lock m_suspensionLock;
</del><ins>+    Mutex m_suspensionLock;
</ins><span class="cx">     
</span><del>-    mutable Lock m_lock;
-    Condition m_planEnqueued;
-    Condition m_planCompiled;
</del><ins>+    mutable Mutex m_lock;
+    ThreadCondition m_planEnqueued;
+    ThreadCondition m_planCompiled;
</ins><span class="cx">     
</span><span class="cx">     Vector&lt;std::unique_ptr&lt;ThreadData&gt;&gt; m_threads;
</span><span class="cx">     unsigned m_numberOfActiveThreads;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredisassemblerDisassemblercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/disassembler/Disassembler.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/disassembler/Disassembler.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/disassembler/Disassembler.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -27,13 +27,12 @@
</span><span class="cx"> #include &quot;Disassembler.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MacroAssemblerCodeRef.h&quot;
</span><del>-#include &lt;wtf/Condition.h&gt;
</del><span class="cx"> #include &lt;wtf/DataLog.h&gt;
</span><span class="cx"> #include &lt;wtf/Deque.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -79,14 +78,14 @@
</span><span class="cx">     
</span><span class="cx">     void enqueue(std::unique_ptr&lt;DisassemblyTask&gt; task)
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         m_queue.append(WTF::move(task));
</span><del>-        m_condition.notifyAll();
</del><ins>+        m_condition.broadcast();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     void waitUntilEmpty()
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_lock);
</del><ins>+        MutexLocker locker(m_lock);
</ins><span class="cx">         while (!m_queue.isEmpty() || m_working)
</span><span class="cx">             m_condition.wait(m_lock);
</span><span class="cx">     }
</span><span class="lines">@@ -97,9 +96,9 @@
</span><span class="cx">         for (;;) {
</span><span class="cx">             std::unique_ptr&lt;DisassemblyTask&gt; task;
</span><span class="cx">             {
</span><del>-                LockHolder locker(m_lock);
</del><ins>+                MutexLocker locker(m_lock);
</ins><span class="cx">                 m_working = false;
</span><del>-                m_condition.notifyAll();
</del><ins>+                m_condition.broadcast();
</ins><span class="cx">                 while (m_queue.isEmpty())
</span><span class="cx">                     m_condition.wait(m_lock);
</span><span class="cx">                 task = m_queue.takeFirst();
</span><span class="lines">@@ -113,8 +112,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    Lock m_lock;
-    Condition m_condition;
</del><ins>+    Mutex m_lock;
+    ThreadCondition m_condition;
</ins><span class="cx">     Deque&lt;std::unique_ptr&lt;DisassemblyTask&gt;&gt; m_queue;
</span><span class="cx">     bool m_working { false };
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapCopiedSpacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -198,12 +198,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_loanedBlocksLock);
</del><ins>+        MutexLocker locker(m_loanedBlocksLock);
</ins><span class="cx">         ASSERT(m_numberOfLoanedBlocks &gt; 0);
</span><span class="cx">         ASSERT(m_inCopyingPhase);
</span><span class="cx">         m_numberOfLoanedBlocks--;
</span><span class="cx">         if (!m_numberOfLoanedBlocks)
</span><del>-            m_loanedBlocksCondition.notifyOne();
</del><ins>+            m_loanedBlocksCondition.signal();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -231,7 +231,7 @@
</span><span class="cx"> void CopiedSpace::doneCopying()
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_loanedBlocksLock);
</del><ins>+        MutexLocker locker(m_loanedBlocksLock);
</ins><span class="cx">         while (m_numberOfLoanedBlocks &gt; 0)
</span><span class="cx">             m_loanedBlocksCondition.wait(m_loanedBlocksLock);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapCopiedSpaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/CopiedSpace.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/CopiedSpace.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/CopiedSpace.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -31,13 +31,13 @@
</span><span class="cx"> #include &quot;TinyBloomFilter.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/CheckedBoolean.h&gt;
</span><del>-#include &lt;wtf/Condition.h&gt;
</del><span class="cx"> #include &lt;wtf/DoublyLinkedList.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Lock.h&gt;
</span><span class="cx"> #include &lt;wtf/OSAllocator.h&gt;
</span><span class="cx"> #include &lt;wtf/PageBlock.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -138,8 +138,8 @@
</span><span class="cx">     bool m_inCopyingPhase;
</span><span class="cx">     bool m_shouldDoCopyPhase;
</span><span class="cx"> 
</span><del>-    Lock m_loanedBlocksLock; 
-    Condition m_loanedBlocksCondition;
</del><ins>+    Mutex m_loanedBlocksLock; 
+    ThreadCondition m_loanedBlocksCondition;
</ins><span class="cx">     size_t m_numberOfLoanedBlocks;
</span><span class="cx">     
</span><span class="cx">     size_t m_bytesRemovedFromOldSpaceDueToReallocation;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapCopiedSpaceInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/CopiedSpaceInlines.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/CopiedSpaceInlines.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/CopiedSpaceInlines.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -113,12 +113,12 @@
</span><span class="cx">     CopiedBlock::destroy(block);
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_loanedBlocksLock);
</del><ins>+        MutexLocker locker(m_loanedBlocksLock);
</ins><span class="cx">         ASSERT(m_numberOfLoanedBlocks &gt; 0);
</span><span class="cx">         ASSERT(m_inCopyingPhase);
</span><span class="cx">         m_numberOfLoanedBlocks--;
</span><span class="cx">         if (!m_numberOfLoanedBlocks)
</span><del>-            m_loanedBlocksCondition.notifyOne();
</del><ins>+            m_loanedBlocksCondition.signal();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">     CopiedBlock* block = CopiedBlock::createNoZeroFill();
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        LockHolder locker(m_loanedBlocksLock);
</del><ins>+        MutexLocker locker(m_loanedBlocksLock);
</ins><span class="cx">         m_numberOfLoanedBlocks++;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCThread.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCThread.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/GCThread.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -69,12 +69,12 @@
</span><span class="cx"> 
</span><span class="cx"> GCPhase GCThread::waitForNextPhase()
</span><span class="cx"> {
</span><del>-    std::unique_lock&lt;Lock&gt; lock(m_shared.m_phaseMutex);
</del><ins>+    std::unique_lock&lt;std::mutex&gt; lock(m_shared.m_phaseMutex);
</ins><span class="cx">     m_shared.m_phaseConditionVariable.wait(lock, [this] { return !m_shared.m_gcThreadsShouldWait; });
</span><span class="cx"> 
</span><span class="cx">     m_shared.m_numberOfActiveGCThreads--;
</span><span class="cx">     if (!m_shared.m_numberOfActiveGCThreads)
</span><del>-        m_shared.m_activityConditionVariable.notifyOne();
</del><ins>+        m_shared.m_activityConditionVariable.notify_one();
</ins><span class="cx"> 
</span><span class="cx">     m_shared.m_phaseConditionVariable.wait(lock, [this] { return m_shared.m_currentPhase != NoPhase; });
</span><span class="cx">     m_shared.m_numberOfActiveGCThreads++;
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     // Wait for the main thread to finish creating and initializing us. The main thread grabs this lock before 
</span><span class="cx">     // creating this thread. We aren't guaranteed to have a valid threadID until the main thread releases this lock.
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(m_shared.m_phaseMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(m_shared.m_phaseMutex);
</ins><span class="cx">     }
</span><span class="cx">     {
</span><span class="cx">         ParallelModeEnabler enabler(*m_slotVisitor);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCThreadSharedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCThreadSharedData.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCThreadSharedData.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/GCThreadSharedData.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009, 2011, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2011 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(PARALLEL_GC)
</span><span class="cx">     // Grab the lock so the new GC threads can be properly initialized before they start running.
</span><del>-    std::unique_lock&lt;Lock&gt; lock(m_phaseMutex);
</del><ins>+    std::unique_lock&lt;std::mutex&gt; lock(m_phaseMutex);
</ins><span class="cx">     for (unsigned i = 1; i &lt; Options::numberOfGCMarkers(); ++i) {
</span><span class="cx">         m_numberOfActiveGCThreads++;
</span><span class="cx">         GCThread* newThread = new GCThread(*this, std::make_unique&lt;SlotVisitor&gt;(*this), std::make_unique&lt;CopyVisitor&gt;(*this));
</span><span class="lines">@@ -102,13 +102,13 @@
</span><span class="cx"> #if ENABLE(PARALLEL_GC)    
</span><span class="cx">     // Destroy our marking threads.
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; markingLock(m_markingMutex);
-        std::lock_guard&lt;Lock&gt; phaseLock(m_phaseMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; markingLock(m_markingMutex);
+        std::lock_guard&lt;std::mutex&gt; phaseLock(m_phaseMutex);
</ins><span class="cx">         ASSERT(m_currentPhase == NoPhase);
</span><span class="cx">         m_parallelMarkersShouldExit = true;
</span><span class="cx">         m_gcThreadsShouldWait = false;
</span><span class="cx">         m_currentPhase = Exit;
</span><del>-        m_phaseConditionVariable.notifyAll();
</del><ins>+        m_phaseConditionVariable.notify_all();
</ins><span class="cx">     }
</span><span class="cx">     for (unsigned i = 0; i &lt; m_gcThreads.size(); ++i) {
</span><span class="cx">         waitForThreadCompletion(m_gcThreads[i]-&gt;threadID());
</span><span class="lines">@@ -131,21 +131,21 @@
</span><span class="cx"> 
</span><span class="cx"> void GCThreadSharedData::startNextPhase(GCPhase phase)
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Lock&gt; lock(m_phaseMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(m_phaseMutex);
</ins><span class="cx">     ASSERT(!m_gcThreadsShouldWait);
</span><span class="cx">     ASSERT(m_currentPhase == NoPhase);
</span><span class="cx">     m_gcThreadsShouldWait = true;
</span><span class="cx">     m_currentPhase = phase;
</span><del>-    m_phaseConditionVariable.notifyAll();
</del><ins>+    m_phaseConditionVariable.notify_all();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GCThreadSharedData::endCurrentPhase()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_gcThreadsShouldWait);
</span><del>-    std::unique_lock&lt;Lock&gt; lock(m_phaseMutex);
</del><ins>+    std::unique_lock&lt;std::mutex&gt; lock(m_phaseMutex);
</ins><span class="cx">     m_currentPhase = NoPhase;
</span><span class="cx">     m_gcThreadsShouldWait = false;
</span><del>-    m_phaseConditionVariable.notifyAll();
</del><ins>+    m_phaseConditionVariable.notify_all();
</ins><span class="cx">     m_activityConditionVariable.wait(lock, [this] { return !m_numberOfActiveGCThreads; });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">         ASSERT(m_opaqueRoots.isEmpty());
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><del>-    std::lock_guard&lt;Lock&gt; lock(m_markingMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(m_markingMutex);
</ins><span class="cx">     m_parallelMarkersShouldExit = false;
</span><span class="cx">     startNextPhase(Mark);
</span><span class="cx"> }
</span><span class="lines">@@ -166,9 +166,9 @@
</span><span class="cx"> void GCThreadSharedData::didFinishMarking()
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(m_markingMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(m_markingMutex);
</ins><span class="cx">         m_parallelMarkersShouldExit = true;
</span><del>-        m_markingConditionVariable.notifyAll();
</del><ins>+        m_markingConditionVariable.notify_all();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_currentPhase == Mark);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCThreadSharedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCThreadSharedData.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCThreadSharedData.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/GCThreadSharedData.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009, 2011, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2011 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;UnconditionalFinalizer.h&quot;
</span><span class="cx"> #include &quot;WeakReferenceHarvester.h&quot;
</span><span class="cx"> #include &lt;condition_variable&gt;
</span><del>-#include &lt;wtf/Condition.h&gt;
</del><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Lock.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -89,13 +88,13 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;GCThread*&gt; m_gcThreads;
</span><span class="cx"> 
</span><del>-    Lock m_markingMutex;
-    Condition m_markingConditionVariable;
</del><ins>+    std::mutex m_markingMutex;
+    std::condition_variable m_markingConditionVariable;
</ins><span class="cx">     MarkStackArray m_sharedMarkStack;
</span><span class="cx">     unsigned m_numberOfActiveParallelMarkers;
</span><span class="cx">     bool m_parallelMarkersShouldExit;
</span><span class="cx"> 
</span><del>-    Lock m_opaqueRootsMutex;
</del><ins>+    std::mutex m_opaqueRootsMutex;
</ins><span class="cx">     HashSet&lt;void*&gt; m_opaqueRoots;
</span><span class="cx"> 
</span><span class="cx">     Lock m_copyLock;
</span><span class="lines">@@ -103,9 +102,9 @@
</span><span class="cx">     size_t m_copyIndex;
</span><span class="cx">     static const size_t s_blockFragmentLength = 32;
</span><span class="cx"> 
</span><del>-    Lock m_phaseMutex;
-    Condition m_phaseConditionVariable;
-    Condition m_activityConditionVariable;
</del><ins>+    std::mutex m_phaseMutex;
+    std::condition_variable m_phaseConditionVariable;
+    std::condition_variable m_activityConditionVariable;
</ins><span class="cx">     unsigned m_numberOfActiveGCThreads;
</span><span class="cx">     bool m_gcThreadsShouldWait;
</span><span class="cx">     GCPhase m_currentPhase;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapTimer.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapTimer.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/HeapTimer.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #ifndef HeapTimer_h
</span><span class="cx"> #define HeapTimer_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -60,7 +59,7 @@
</span><span class="cx">     RetainPtr&lt;CFRunLoopRef&gt; m_runLoop;
</span><span class="cx">     CFRunLoopTimerContext m_context;
</span><span class="cx"> 
</span><del>-    Lock m_shutdownMutex;
</del><ins>+    Mutex m_shutdownMutex;
</ins><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx">     static bool timerEvent(void*);
</span><span class="cx">     Ecore_Timer* add(double delay, void* agent);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMachineStackMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -103,18 +103,18 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        LockHolder m_locker;
</del><ins>+        MutexLocker m_locker;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     void add(MachineThreads* machineThreads)
</span><span class="cx">     {
</span><del>-        LockHolder managerLock(m_lock);
</del><ins>+        MutexLocker managerLock(m_lock);
</ins><span class="cx">         m_set.add(machineThreads);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void remove(MachineThreads* machineThreads)
</span><span class="cx">     {
</span><del>-        LockHolder managerLock(m_lock);
</del><ins>+        MutexLocker managerLock(m_lock);
</ins><span class="cx">         auto recordedMachineThreads = m_set.take(machineThreads);
</span><span class="cx">         RELEASE_ASSERT(recordedMachineThreads = machineThreads);
</span><span class="cx">     }
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> 
</span><span class="cx">     ActiveMachineThreadsManager() { }
</span><span class="cx">     
</span><del>-    Lock m_lock;
</del><ins>+    Mutex m_lock;
</ins><span class="cx">     MachineThreadsSet m_set;
</span><span class="cx"> 
</span><span class="cx">     friend ActiveMachineThreadsManager&amp; activeMachineThreadsManager();
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">     activeMachineThreadsManager().remove(this);
</span><span class="cx">     threadSpecificKeyDelete(m_threadSpecific);
</span><span class="cx"> 
</span><del>-    LockHolder registeredThreadsLock(m_registeredThreadsMutex);
</del><ins>+    MutexLocker registeredThreadsLock(m_registeredThreadsMutex);
</ins><span class="cx">     for (Thread* t = m_registeredThreads; t;) {
</span><span class="cx">         Thread* next = t-&gt;next;
</span><span class="cx">         delete t;
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">     threadSpecificSet(m_threadSpecific, this);
</span><span class="cx">     Thread* thread = Thread::createForCurrentThread();
</span><span class="cx"> 
</span><del>-    LockHolder lock(m_registeredThreadsMutex);
</del><ins>+    MutexLocker lock(m_registeredThreadsMutex);
</ins><span class="cx"> 
</span><span class="cx">     thread-&gt;next = m_registeredThreads;
</span><span class="cx">     m_registeredThreads = thread;
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> template&lt;typename PlatformThread&gt;
</span><span class="cx"> void MachineThreads::removeThreadIfFound(PlatformThread platformThread)
</span><span class="cx"> {
</span><del>-    LockHolder lock(m_registeredThreadsMutex);
</del><ins>+    MutexLocker lock(m_registeredThreadsMutex);
</ins><span class="cx">     Thread* t = m_registeredThreads;
</span><span class="cx">     if (*t == platformThread) {
</span><span class="cx">         m_registeredThreads = m_registeredThreads-&gt;next;
</span><span class="lines">@@ -566,7 +566,7 @@
</span><span class="cx">     thread-&gt;freeRegisters(registers);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool MachineThreads::tryCopyOtherThreadStacks(LockHolder&amp;, void* buffer, size_t capacity, size_t* size)
</del><ins>+bool MachineThreads::tryCopyOtherThreadStacks(MutexLocker&amp;, void* buffer, size_t capacity, size_t* size)
</ins><span class="cx"> {
</span><span class="cx">     // Prevent two VMs from suspending each other's threads at the same time,
</span><span class="cx">     // which can cause deadlock: &lt;rdar://problem/20300842&gt;.
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx">     size_t size;
</span><span class="cx">     size_t capacity = 0;
</span><span class="cx">     void* buffer = nullptr;
</span><del>-    LockHolder lock(m_registeredThreadsMutex);
</del><ins>+    MutexLocker lock(m_registeredThreadsMutex);
</ins><span class="cx">     while (!tryCopyOtherThreadStacks(lock, buffer, capacity, &amp;size))
</span><span class="cx">         growBuffer(size, &amp;buffer, &amp;capacity);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMachineStackMarkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MachineStackMarker.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MachineStackMarker.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/MachineStackMarker.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
</span><span class="cx">  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
</span><del>- *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2015 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx"> #define MachineThreads_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;setjmp.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSpecific.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -52,14 +52,14 @@
</span><span class="cx">         void gatherFromCurrentThread(ConservativeRoots&amp;, JITStubRoutineSet&amp;, CodeBlockSet&amp;, void* stackOrigin, void* stackTop, RegisterState&amp; calleeSavedRegisters);
</span><span class="cx"> 
</span><span class="cx">         void tryCopyOtherThreadStack(Thread*, void*, size_t capacity, size_t*);
</span><del>-        bool tryCopyOtherThreadStacks(LockHolder&amp;, void*, size_t capacity, size_t*);
</del><ins>+        bool tryCopyOtherThreadStacks(MutexLocker&amp;, void*, size_t capacity, size_t*);
</ins><span class="cx"> 
</span><span class="cx">         static void removeThread(void*);
</span><span class="cx"> 
</span><span class="cx">         template&lt;typename PlatformThread&gt;
</span><span class="cx">         void removeThreadIfFound(PlatformThread);
</span><span class="cx"> 
</span><del>-        Lock m_registeredThreadsMutex;
</del><ins>+        Mutex m_registeredThreadsMutex;
</ins><span class="cx">         Thread* m_registeredThreads;
</span><span class="cx">         WTF::ThreadSpecificKey m_threadSpecific;
</span><span class="cx"> #if !ASSERT_DISABLED
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapSlotVisitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,28 +1,3 @@
</span><del>-/*
- * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
</del><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SlotVisitor.h&quot;
</span><span class="cx"> #include &quot;SlotVisitorInlines.h&quot;
</span><span class="lines">@@ -37,7 +12,6 @@
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/StackStats.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -147,7 +121,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If we're contending on the lock, be conservative and assume that another
</span><span class="cx">     // thread is already donating.
</span><del>-    std::unique_lock&lt;Lock&gt; lock(m_shared.m_markingMutex, std::try_to_lock);
</del><ins>+    std::unique_lock&lt;std::mutex&gt; lock(m_shared.m_markingMutex, std::try_to_lock);
</ins><span class="cx">     if (!lock.owns_lock())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -155,7 +129,7 @@
</span><span class="cx">     m_stack.donateSomeCellsTo(m_shared.m_sharedMarkStack);
</span><span class="cx"> 
</span><span class="cx">     if (m_shared.m_numberOfActiveParallelMarkers &lt; Options::numberOfGCMarkers())
</span><del>-        m_shared.m_markingConditionVariable.notifyAll();
</del><ins>+        m_shared.m_markingConditionVariable.notify_all();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SlotVisitor::drain()
</span><span class="lines">@@ -210,12 +184,12 @@
</span><span class="cx">     
</span><span class="cx"> #if ENABLE(PARALLEL_GC)
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(m_shared.m_markingMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(m_shared.m_markingMutex);
</ins><span class="cx">         m_shared.m_numberOfActiveParallelMarkers++;
</span><span class="cx">     }
</span><span class="cx">     while (true) {
</span><span class="cx">         {
</span><del>-            std::unique_lock&lt;Lock&gt; lock(m_shared.m_markingMutex);
</del><ins>+            std::unique_lock&lt;std::mutex&gt; lock(m_shared.m_markingMutex);
</ins><span class="cx">             m_shared.m_numberOfActiveParallelMarkers--;
</span><span class="cx"> 
</span><span class="cx">             // How we wait differs depending on drain mode.
</span><span class="lines">@@ -226,7 +200,7 @@
</span><span class="cx">                     // Did we reach termination?
</span><span class="cx">                     if (!m_shared.m_numberOfActiveParallelMarkers &amp;&amp; m_shared.m_sharedMarkStack.isEmpty()) {
</span><span class="cx">                         // Let any sleeping slaves know it's time for them to return;
</span><del>-                        m_shared.m_markingConditionVariable.notifyAll();
</del><ins>+                        m_shared.m_markingConditionVariable.notify_all();
</ins><span class="cx">                         return;
</span><span class="cx">                     }
</span><span class="cx">                     
</span><span class="lines">@@ -242,7 +216,7 @@
</span><span class="cx">                 
</span><span class="cx">                 // Did we detect termination? If so, let the master know.
</span><span class="cx">                 if (!m_shared.m_numberOfActiveParallelMarkers &amp;&amp; m_shared.m_sharedMarkStack.isEmpty())
</span><del>-                    m_shared.m_markingConditionVariable.notifyAll();
</del><ins>+                    m_shared.m_markingConditionVariable.notify_all();
</ins><span class="cx"> 
</span><span class="cx">                 m_shared.m_markingConditionVariable.wait(lock, [this] { return !m_shared.m_sharedMarkStack.isEmpty() || m_shared.m_parallelMarkersShouldExit; });
</span><span class="cx">                 
</span><span class="lines">@@ -266,7 +240,7 @@
</span><span class="cx">     StackStats::probe();
</span><span class="cx">     ASSERT(!m_opaqueRoots.isEmpty()); // Should only be called when opaque roots are non-empty.
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(m_shared.m_opaqueRootsMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(m_shared.m_opaqueRootsMutex);
</ins><span class="cx">         for (auto* root : m_opaqueRoots)
</span><span class="cx">             m_shared.m_opaqueRoots.add(root);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapSlotVisitorInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_opaqueRoots.contains(root))
</span><span class="cx">         return TrueTriState;
</span><del>-    std::lock_guard&lt;Lock&gt; lock(m_shared.m_opaqueRootsMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(m_shared.m_opaqueRootsMutex);
</ins><span class="cx">     if (m_shared.m_opaqueRoots.contains(root))
</span><span class="cx">         return TrueTriState;
</span><span class="cx">     return MixedTriState;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #import &quot;InspectorFrontendChannel.h&quot;
</span><span class="cx"> #import &quot;RemoteInspectorDebuggable.h&quot;
</span><span class="cx"> #import &lt;mutex&gt;
</span><del>-#import &lt;wtf/Lock.h&gt;
</del><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -92,7 +91,7 @@
</span><span class="cx">     void sendMessageToBackend(NSString *);
</span><span class="cx">     virtual bool sendMessageToFrontend(const String&amp;) override;
</span><span class="cx"> 
</span><del>-    Lock&amp; queueMutex() { return m_queueMutex; }
</del><ins>+    std::mutex&amp; queueMutex() { return m_queueMutex; }
</ins><span class="cx">     RemoteInspectorQueue queue() const { return m_queue; }
</span><span class="cx">     void clearQueue() { m_queue.clear(); }
</span><span class="cx"> 
</span><span class="lines">@@ -106,14 +105,14 @@
</span><span class="cx">     // This connection from the RemoteInspector singleton to the Debuggable
</span><span class="cx">     // can be used on multiple threads. So any access to the debuggable
</span><span class="cx">     // itself must take this mutex to ensure m_debuggable is valid.
</span><del>-    Lock m_debuggableMutex;
</del><ins>+    std::mutex m_debuggableMutex;
</ins><span class="cx"> 
</span><span class="cx">     // If a debuggable has a specific run loop it wants to evaluate on
</span><span class="cx">     // we setup our run loop sources on that specific run loop.
</span><span class="cx">     RetainPtr&lt;CFRunLoopRef&gt; m_runLoop;
</span><span class="cx">     RetainPtr&lt;CFRunLoopSourceRef&gt; m_runLoopSource;
</span><span class="cx">     RemoteInspectorQueue m_queue;
</span><del>-    Lock m_queueMutex;
</del><ins>+    std::mutex m_queueMutex;
</ins><span class="cx"> 
</span><span class="cx">     RemoteInspectorDebuggable* m_debuggable;
</span><span class="cx">     RetainPtr&lt;NSString&gt; m_connectionIdentifier;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableConnectionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013, 2015 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2013 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,19 +39,20 @@
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><del>-static StaticLock rwiQueueMutex;
</del><ins>+static std::mutex* rwiQueueMutex;
</ins><span class="cx"> static CFRunLoopSourceRef rwiRunLoopSource;
</span><span class="cx"> static RemoteInspectorQueue* rwiQueue;
</span><span class="cx"> 
</span><span class="cx"> static void RemoteInspectorHandleRunSourceGlobal(void*)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(CFRunLoopGetCurrent() == CFRunLoopGetMain());
</span><ins>+    ASSERT(rwiQueueMutex);
</ins><span class="cx">     ASSERT(rwiRunLoopSource);
</span><span class="cx">     ASSERT(rwiQueue);
</span><span class="cx"> 
</span><span class="cx">     RemoteInspectorQueue queueCopy;
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(rwiQueueMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(*rwiQueueMutex);
</ins><span class="cx">         queueCopy = *rwiQueue;
</span><span class="cx">         rwiQueue-&gt;clear();
</span><span class="cx">     }
</span><span class="lines">@@ -62,11 +63,12 @@
</span><span class="cx"> 
</span><span class="cx"> static void RemoteInspectorQueueTaskOnGlobalQueue(void (^task)())
</span><span class="cx"> {
</span><ins>+    ASSERT(rwiQueueMutex);
</ins><span class="cx">     ASSERT(rwiRunLoopSource);
</span><span class="cx">     ASSERT(rwiQueue);
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(rwiQueueMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(*rwiQueueMutex);
</ins><span class="cx">         rwiQueue-&gt;append(RemoteInspectorBlock(task));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -79,6 +81,7 @@
</span><span class="cx">     static dispatch_once_t pred;
</span><span class="cx">     dispatch_once(&amp;pred, ^{
</span><span class="cx">         rwiQueue = new RemoteInspectorQueue;
</span><ins>+        rwiQueueMutex = std::make_unique&lt;std::mutex&gt;().release();
</ins><span class="cx"> 
</span><span class="cx">         CFRunLoopSourceContext runLoopSourceContext = {0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, RemoteInspectorHandleRunSourceGlobal};
</span><span class="cx">         rwiRunLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 1, &amp;runLoopSourceContext);
</span><span class="lines">@@ -95,7 +98,7 @@
</span><span class="cx"> 
</span><span class="cx">     RemoteInspectorQueue queueCopy;
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(debuggableConnection-&gt;queueMutex());
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(debuggableConnection-&gt;queueMutex());
</ins><span class="cx">         queueCopy = debuggableConnection-&gt;queue();
</span><span class="cx">         debuggableConnection-&gt;clearQueue();
</span><span class="cx">     }
</span><span class="lines">@@ -149,7 +152,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection, bool automaticallyPause)
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Lock&gt; lock(m_debuggableMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(m_debuggableMutex);
</ins><span class="cx"> 
</span><span class="cx">     if (!m_debuggable)
</span><span class="cx">         return false;
</span><span class="lines">@@ -157,7 +160,7 @@
</span><span class="cx">     ref();
</span><span class="cx">     dispatchAsyncOnDebuggable(^{
</span><span class="cx">         {
</span><del>-            std::lock_guard&lt;Lock&gt; lock(m_debuggableMutex);
</del><ins>+            std::lock_guard&lt;std::mutex&gt; lock(m_debuggableMutex);
</ins><span class="cx">             if (!m_debuggable || !m_debuggable-&gt;remoteDebuggingAllowed() || m_debuggable-&gt;hasLocalDebugger()) {
</span><span class="cx">                 RemoteInspector::singleton().setupFailed(identifier());
</span><span class="cx">                 m_debuggable = nullptr;
</span><span class="lines">@@ -177,7 +180,7 @@
</span><span class="cx"> 
</span><span class="cx"> void RemoteInspectorDebuggableConnection::closeFromDebuggable()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Lock&gt; lock(m_debuggableMutex);
</del><ins>+    std::lock_guard&lt;std::mutex&gt; lock(m_debuggableMutex);
</ins><span class="cx"> 
</span><span class="cx">     m_debuggable = nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -187,7 +190,7 @@
</span><span class="cx">     ref();
</span><span class="cx">     dispatchAsyncOnDebuggable(^{
</span><span class="cx">         {
</span><del>-            std::lock_guard&lt;Lock&gt; lock(m_debuggableMutex);
</del><ins>+            std::lock_guard&lt;std::mutex&gt; lock(m_debuggableMutex);
</ins><span class="cx"> 
</span><span class="cx">             if (m_debuggable) {
</span><span class="cx">                 if (m_connected)
</span><span class="lines">@@ -207,7 +210,7 @@
</span><span class="cx">         {
</span><span class="cx">             RemoteInspectorDebuggable* debuggable = nullptr;
</span><span class="cx">             {
</span><del>-                std::lock_guard&lt;Lock&gt; lock(m_debuggableMutex);
</del><ins>+                std::lock_guard&lt;std::mutex&gt; lock(m_debuggableMutex);
</ins><span class="cx">                 if (!m_debuggable)
</span><span class="cx">                     return;
</span><span class="cx">                 debuggable = m_debuggable;
</span><span class="lines">@@ -260,7 +263,7 @@
</span><span class="cx">     ASSERT(m_runLoop);
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;Lock&gt; lock(m_queueMutex);
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(m_queueMutex);
</ins><span class="cx">         m_queue.append(RemoteInspectorBlock(block));
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterJSStackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/JSStack.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/JSStack.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/interpreter/JSStack.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013, 2014, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,14 +33,17 @@
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;Options.h&quot;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> #if !ENABLE(JIT)
</span><span class="cx"> static size_t committedBytesCount = 0;
</span><span class="cx"> 
</span><del>-static StaticLock stackStatisticsMutex;
</del><ins>+static Mutex&amp; stackStatisticsMutex()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(Mutex, staticMutex, ());
+    return staticMutex;
+}    
</ins><span class="cx"> #endif // !ENABLE(JIT)
</span><span class="cx"> 
</span><span class="cx"> JSStack::JSStack(VM&amp; vm)
</span><span class="lines">@@ -136,9 +139,14 @@
</span><span class="cx">     m_commitTop = highAddressWithReservedZone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JSStack::initializeThreading()
+{
+    stackStatisticsMutex();
+}
+
</ins><span class="cx"> void JSStack::addToCommittedByteCount(long byteCount)
</span><span class="cx"> {
</span><del>-    LockHolder locker(stackStatisticsMutex);
</del><ins>+    MutexLocker locker(stackStatisticsMutex());
</ins><span class="cx">     ASSERT(static_cast&lt;long&gt;(committedBytesCount) + byteCount &gt; -1);
</span><span class="cx">     committedBytesCount += byteCount;
</span><span class="cx"> }
</span><span class="lines">@@ -168,7 +176,7 @@
</span><span class="cx"> size_t JSStack::committedByteCount()
</span><span class="cx"> {
</span><span class="cx"> #if !ENABLE(JIT)
</span><del>-    LockHolder locker(stackStatisticsMutex);
</del><ins>+    MutexLocker locker(stackStatisticsMutex());
</ins><span class="cx">     return committedBytesCount;
</span><span class="cx"> #else
</span><span class="cx">     // When using the C stack, we don't know how many stack pages are actually
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterJSStackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/JSStack.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/JSStack.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/interpreter/JSStack.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx">         void gatherConservativeRoots(ConservativeRoots&amp;) { }
</span><span class="cx">         void gatherConservativeRoots(ConservativeRoots&amp;, JITStubRoutineSet&amp;, CodeBlockSet&amp;) { }
</span><span class="cx">         void sanitizeStack() { }
</span><ins>+        static void initializeThreading() { }
</ins><span class="cx"> #else
</span><span class="cx">         ~JSStack();
</span><span class="cx"> 
</span><span class="lines">@@ -96,6 +97,8 @@
</span><span class="cx"> 
</span><span class="cx">         size_t size() const { return highAddress() - lowAddress(); }
</span><span class="cx"> 
</span><ins>+        static void initializeThreading();
+
</ins><span class="cx">         void setReservedZoneSize(size_t);
</span><span class="cx"> 
</span><span class="cx">         inline Register* topOfStack();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> #if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
</span><span class="cx"> #include &quot;CodeProfiling.h&quot;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/MetaAllocator.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/PageReservation.h&gt;
</span><ins>+#include &lt;wtf/ThreadingPrimitives.h&gt;
</ins><span class="cx"> #include &lt;wtf/VMTags.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     DemandExecutableAllocator()
</span><span class="cx">         : MetaAllocator(jitAllocationGranule)
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(allocatorsMutex());
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(allocatorsMutex());
</ins><span class="cx">         allocators().add(this);
</span><span class="cx">         // Don't preallocate any memory here.
</span><span class="cx">     }
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     virtual ~DemandExecutableAllocator()
</span><span class="cx">     {
</span><span class="cx">         {
</span><del>-            std::lock_guard&lt;StaticLock&gt; lock(allocatorsMutex());
</del><ins>+            std::lock_guard&lt;std::mutex&gt; lock(allocatorsMutex());
</ins><span class="cx">             allocators().remove(this);
</span><span class="cx">         }
</span><span class="cx">         for (unsigned i = 0; i &lt; reservations.size(); ++i)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     static size_t bytesAllocatedByAllAllocators()
</span><span class="cx">     {
</span><span class="cx">         size_t total = 0;
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(allocatorsMutex());
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(allocatorsMutex());
</ins><span class="cx">         for (HashSet&lt;DemandExecutableAllocator*&gt;::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
</span><span class="cx">             total += (*allocator)-&gt;bytesAllocated();
</span><span class="cx">         return total;
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     static size_t bytesCommittedByAllocactors()
</span><span class="cx">     {
</span><span class="cx">         size_t total = 0;
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(allocatorsMutex());
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(allocatorsMutex());
</ins><span class="cx">         for (HashSet&lt;DemandExecutableAllocator*&gt;::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
</span><span class="cx">             total += (*allocator)-&gt;bytesCommitted();
</span><span class="cx">         return total;
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> #if ENABLE(META_ALLOCATOR_PROFILE)
</span><span class="cx">     static void dumpProfileFromAllAllocators()
</span><span class="cx">     {
</span><del>-        std::lock_guard&lt;StaticLock&gt; lock(allocatorsMutex());
</del><ins>+        std::lock_guard&lt;std::mutex&gt; lock(allocatorsMutex());
</ins><span class="cx">         for (HashSet&lt;DemandExecutableAllocator*&gt;::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
</span><span class="cx">             (*allocator)-&gt;dumpProfile();
</span><span class="cx">     }
</span><span class="lines">@@ -138,9 +138,9 @@
</span><span class="cx">         return sAllocators;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static StaticLock&amp; allocatorsMutex()
</del><ins>+    static std::mutex&amp; allocatorsMutex()
</ins><span class="cx">     {
</span><del>-        static StaticLock mutex;
</del><ins>+        static NeverDestroyed&lt;std::mutex&gt; mutex;
</ins><span class="cx"> 
</span><span class="cx">         return mutex;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITThunkscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITThunks.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITThunks.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/jit/JITThunks.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> MacroAssemblerCodeRef JITThunks::ctiStub(VM* vm, ThunkGenerator generator)
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    Locker locker(m_lock);
</ins><span class="cx">     CTIStubMap::AddResult entry = m_ctiStubMap.add(generator, MacroAssemblerCodeRef());
</span><span class="cx">     if (entry.isNewEntry) {
</span><span class="cx">         // Compilation thread can only retrieve existing entries.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITThunksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITThunks.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITThunks.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/jit/JITThunks.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -63,6 +63,10 @@
</span><span class="cx">     void clearHostFunctionStubs();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    // Main thread can hold this lock for a while, so use an adaptive mutex.
+    typedef Mutex Lock;
+    typedef MutexLocker Locker;
+
</ins><span class="cx">     void finalize(Handle&lt;Unknown&gt;, void* context) override;
</span><span class="cx">     
</span><span class="cx">     typedef HashMap&lt;ThunkGenerator, MacroAssemblerCodeRef&gt; CTIStubMap;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> Bytecodes* Database::ensureBytecodesFor(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    Locker locker(m_lock);
</ins><span class="cx">     
</span><span class="cx">     codeBlock = codeBlock-&gt;baselineVersion();
</span><span class="cx">     
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Database::notifyDestruction(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    LockHolder locker(m_lock);
</del><ins>+    Locker locker(m_lock);
</ins><span class="cx">     
</span><span class="cx">     m_bytecodesMap.remove(codeBlock);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;ProfilerCompilationKind.h&quot;
</span><span class="cx"> #include &lt;wtf/FastMalloc.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/SegmentedVector.h&gt;
</span><span class="lines">@@ -71,6 +70,21 @@
</span><span class="cx">     void registerToSaveAtExit(const char* filename);
</span><span class="cx">     
</span><span class="cx"> private:
</span><ins>+    // Use a full-blown adaptive mutex because:
+    // - There is only one ProfilerDatabase per VM. The size overhead of the system's
+    //   mutex is negligible if you only have one of them.
+    // - It's locked infrequently - once per bytecode generation, compilation, and
+    //   code block collection - so the fact that the fast path still requires a
+    //   function call is neglible.
+    // - It tends to be held for a while. Currently, we hold it while generating
+    //   Profiler::Bytecodes for a CodeBlock. That's uncommon and shouldn't affect
+    //   performance, but if we did have contention, we would want a sensible,
+    //   power-aware backoff. An adaptive mutex will do this as a matter of course,
+    //   but a spinlock won't.
+    typedef Mutex Lock;
+    typedef MutexLocker Locker;
+    
+
</ins><span class="cx">     void addDatabaseToAtExit();
</span><span class="cx">     void removeDatabaseFromAtExit();
</span><span class="cx">     void performAtExitSave() const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInitializeThreadingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     std::call_once(initializeThreadingOnceFlag, []{
</span><span class="cx">         WTF::double_conversion::initialize();
</span><span class="cx">         WTF::initializeThreading();
</span><ins>+        GlobalJSLock::initialize();
</ins><span class="cx">         Options::initialize();
</span><span class="cx">         if (Options::recordGCPauseTimes())
</span><span class="cx">             HeapStatistics::initialize();
</span><span class="lines">@@ -65,6 +66,7 @@
</span><span class="cx"> #if ENABLE(ASSEMBLER)
</span><span class="cx">         ExecutableAllocator::initializeAllocator();
</span><span class="cx"> #endif
</span><ins>+        JSStack::initializeThreading();
</ins><span class="cx">         LLInt::initialize();
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         DisallowGC::initialize();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.cpp (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.cpp        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.cpp        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -30,18 +30,23 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-StaticLock GlobalJSLock::s_sharedInstanceMutex;
</del><ins>+std::mutex* GlobalJSLock::s_sharedInstanceMutex;
</ins><span class="cx"> 
</span><span class="cx"> GlobalJSLock::GlobalJSLock()
</span><span class="cx"> {
</span><del>-    s_sharedInstanceMutex.lock();
</del><ins>+    s_sharedInstanceMutex-&gt;lock();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GlobalJSLock::~GlobalJSLock()
</span><span class="cx"> {
</span><del>-    s_sharedInstanceMutex.unlock();
</del><ins>+    s_sharedInstanceMutex-&gt;unlock();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void GlobalJSLock::initialize()
+{
+    s_sharedInstanceMutex = new std::mutex();
+}
+
</ins><span class="cx"> JSLockHolder::JSLockHolder(ExecState* exec)
</span><span class="cx">     : m_vm(&amp;exec-&gt;vm())
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &lt;mutex&gt;
</span><span class="cx"> #include &lt;thread&gt;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><del>-#include &lt;wtf/Lock.h&gt;
</del><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="lines">@@ -61,8 +60,10 @@
</span><span class="cx"> public:
</span><span class="cx">     JS_EXPORT_PRIVATE GlobalJSLock();
</span><span class="cx">     JS_EXPORT_PRIVATE ~GlobalJSLock();
</span><ins>+
+    static void initialize();
</ins><span class="cx"> private:
</span><del>-    static StaticLock s_sharedInstanceMutex;
</del><ins>+    static std::mutex* s_sharedInstanceMutex;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class JSLockHolder {
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx">     unsigned dropAllLocks(DropAllLocks*);
</span><span class="cx">     void grabAllLocks(DropAllLocks*, unsigned lockCount);
</span><span class="cx"> 
</span><del>-    Lock m_lock;
</del><ins>+    std::mutex m_lock;
</ins><span class="cx">     std::thread::id m_ownerThreadID;
</span><span class="cx">     intptr_t m_lockCount;
</span><span class="cx">     unsigned m_lockDropDepth;
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/WTF/ChangeLog        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-08-14  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r188444.
+        https://bugs.webkit.org/show_bug.cgi?id=148029
+
+        Broke GTK and EFL (see bug #148027) (Requested by philn on
+        #webkit).
+
+        Reverted changeset:
+
+        &quot;Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
+        WTF::ThreadCondition, std::mutex, and std::condition_variable&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=147999
+        http://trac.webkit.org/changeset/188444
+
</ins><span class="cx"> 2015-08-13  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
</span></span></pre></div>
<a id="trunkSourceWTFwtfConditionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Condition.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Condition.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/WTF/wtf/Condition.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -109,7 +109,5 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><del>-using WTF::Condition;
-
</del><span class="cx"> #endif // WTF_Condition_h
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWTFwtfLockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Lock.h (188474 => 188475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Lock.h        2015-08-14 16:49:54 UTC (rev 188474)
+++ trunk/Source/WTF/wtf/Lock.h        2015-08-14 16:53:37 UTC (rev 188475)
</span><span class="lines">@@ -56,23 +56,6 @@
</span><span class="cx">         lockSlow();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool tryLock()
-    {
-        for (;;) {
-            uint8_t currentByteValue = m_byte.load();
-            if (currentByteValue &amp; isHeldBit)
-                return false;
-            if (m_byte.compareExchangeWeak(currentByteValue, currentByteValue | isHeldBit))
-                return true;
-        }
-    }
-
-    // Need this version for std::unique_lock.
-    bool try_lock()
-    {
-        return tryLock();
-    }
-
</del><span class="cx">     void unlock()
</span><span class="cx">     {
</span><span class="cx">         if (LIKELY(m_byte.compareExchangeWeak(isHeldBit, 0, std::memory_order_release))) {
</span></span></pre>
</div>
</div>

</body>
</html>