<!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>[163804] trunk/Source/JavaScriptCore</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/163804">163804</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2014-02-10 11:39:30 -0800 (Mon, 10 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unnecessary spinLock in JSLock.
&lt;https://webkit.org/b/128450&gt;

Reviewed by Filip Pizlo.

The JSLock's mutex already provides protection for write access to
JSLock's internal state. The only JSLock state that needs to be read
from any thread including threads that don't own the JSLock is
m_ownerThread, which is used in currentThreadIsHoldingLock() to do an
ownership test on the lock.

It is safe for other threads to read from m_ownerThread because they
only need to know whether its value matches their own thread id
(provided by WTF::currentThread()).

Here are the scenarios for how the ownership test can go:

1. The JSLock has just been initialized and is not owned by any thread.

   In this case, m_ownerThread will be 0 and will not match any thread's
   thread id. The checking thread will know that it needs to lock the
   JSLock before using the VM.

2. The JSLock was previously locked, but now is unlocked.

   When we unlock it in JSLock::unlock(), the owner thread clears
   m_ownerThread to 0. Hence, this case is the same as (1) above.

3. The JSLock is locked by Thread A. Thread B is checking ownership.

   In this case, m_ownerThread will contains the Thread A's thread id.
   Thread B will see that the thread id does not match its own and will
   proceed to block on the JSLock's mutex to wait for its turn to use
   the VM.

   With Weak Memory Ordering architectures, Thread A's thread id may
   not get written out to memory before Thread B inspects m_ownerThread.
   However, though Thread B may not see Thread A's thread id in
   m_ownerThread, it will see 0 which is the last value written to it
   before the JSLock mutex was unlocked. The mutex unlock would have
   executed a memory fence which would have flushed the 0 to
   m_ownerThread in memory. Hence, Thread B will know that it does not
   own the lock.

Apart from removing the unneeded spin lock code, I also changed the
JSLock code to use currentThreadIsHoldingLock() and setOwnerThread()
instead of accessing m_ownerThread directly.

* runtime/JSLock.cpp:
(JSC::JSLock::JSLock):

(JSC::JSLock::lock):
- Removed spinLock but left the indentation as is to keep the diff to a
  minimum for better readability. Will unindent in a subsequent patch.

(JSC::JSLock::unlock):
- Before unlocking the mutex, clear m_ownerThread to indicate that the
  lock is no longer owned.

(JSC::JSLock::currentThreadIsHoldingLock):
- Removed the check of m_lockCount for determining ownership. Checking
  m_ownerThread is sufficient.

(JSC::JSLock::dropAllLocks):
(JSC::JSLock::dropAllLocksUnconditionally):
- Renamed local locksToDrop to the better name droppedLockCount.
- Clear m_ownerThread since we're unlocking the JSLock.

(JSC::JSLock::grabAllLocks):
- Removed unneeded lock ownership test for lock re-entry case because
  grabAllLocks() is never used to re-enter a locked JSLock.

(JSC::JSLock::DropAllLocks::DropAllLocks):
(JSC::JSLock::DropAllLocks::~DropAllLocks):

* runtime/JSLock.h:
(JSC::JSLock::setOwnerThread):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (163803 => 163804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-10 19:32:37 UTC (rev 163803)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-10 19:39:30 UTC (rev 163804)
</span><span class="lines">@@ -1,3 +1,83 @@
</span><ins>+2014-02-09  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Remove unnecessary spinLock in JSLock.
+        &lt;https://webkit.org/b/128450&gt;
+
+        Reviewed by Filip Pizlo.
+
+        The JSLock's mutex already provides protection for write access to
+        JSLock's internal state. The only JSLock state that needs to be read
+        from any thread including threads that don't own the JSLock is
+        m_ownerThread, which is used in currentThreadIsHoldingLock() to do an
+        ownership test on the lock.
+
+        It is safe for other threads to read from m_ownerThread because they
+        only need to know whether its value matches their own thread id
+        (provided by WTF::currentThread()).
+
+        Here are the scenarios for how the ownership test can go:
+
+        1. The JSLock has just been initialized and is not owned by any thread.
+
+           In this case, m_ownerThread will be 0 and will not match any thread's
+           thread id. The checking thread will know that it needs to lock the
+           JSLock before using the VM.
+
+        2. The JSLock was previously locked, but now is unlocked.
+
+           When we unlock it in JSLock::unlock(), the owner thread clears
+           m_ownerThread to 0. Hence, this case is the same as (1) above.
+
+        3. The JSLock is locked by Thread A. Thread B is checking ownership.
+
+           In this case, m_ownerThread will contains the Thread A's thread id.
+           Thread B will see that the thread id does not match its own and will
+           proceed to block on the JSLock's mutex to wait for its turn to use
+           the VM.
+
+           With Weak Memory Ordering architectures, Thread A's thread id may
+           not get written out to memory before Thread B inspects m_ownerThread.
+           However, though Thread B may not see Thread A's thread id in
+           m_ownerThread, it will see 0 which is the last value written to it
+           before the JSLock mutex was unlocked. The mutex unlock would have
+           executed a memory fence which would have flushed the 0 to
+           m_ownerThread in memory. Hence, Thread B will know that it does not
+           own the lock.
+
+        Apart from removing the unneeded spin lock code, I also changed the
+        JSLock code to use currentThreadIsHoldingLock() and setOwnerThread()
+        instead of accessing m_ownerThread directly.
+
+        * runtime/JSLock.cpp:
+        (JSC::JSLock::JSLock):
+
+        (JSC::JSLock::lock):
+        - Removed spinLock but left the indentation as is to keep the diff to a
+          minimum for better readability. Will unindent in a subsequent patch.
+
+        (JSC::JSLock::unlock):
+        - Before unlocking the mutex, clear m_ownerThread to indicate that the
+          lock is no longer owned.
+
+        (JSC::JSLock::currentThreadIsHoldingLock):
+        - Removed the check of m_lockCount for determining ownership. Checking
+          m_ownerThread is sufficient.
+
+        (JSC::JSLock::dropAllLocks):
+        (JSC::JSLock::dropAllLocksUnconditionally):
+        - Renamed local locksToDrop to the better name droppedLockCount.
+        - Clear m_ownerThread since we're unlocking the JSLock.
+
+        (JSC::JSLock::grabAllLocks):
+        - Removed unneeded lock ownership test for lock re-entry case because
+          grabAllLocks() is never used to re-enter a locked JSLock.
+
+        (JSC::JSLock::DropAllLocks::DropAllLocks):
+        (JSC::JSLock::DropAllLocks::~DropAllLocks):
+
+        * runtime/JSLock.h:
+        (JSC::JSLock::setOwnerThread):
+
</ins><span class="cx"> 2014-02-10  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, roll out http://trac.webkit.org/changeset/163796
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.cpp (163803 => 163804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.cpp        2014-02-10 19:32:37 UTC (rev 163803)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.cpp        2014-02-10 19:39:30 UTC (rev 163804)
</span><span class="lines">@@ -27,10 +27,6 @@
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;Operations.h&quot;
</span><span class="cx"> 
</span><del>-#if USE(PTHREADS)
-#include &lt;pthread.h&gt;
-#endif
-
</del><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> Mutex* GlobalJSLock::s_sharedInstanceLock = 0;
</span><span class="lines">@@ -90,7 +86,6 @@
</span><span class="cx">     , m_lockDropDepth(0)
</span><span class="cx">     , m_vm(vm)
</span><span class="cx"> {
</span><del>-    m_spinLock.Init();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSLock::~JSLock()
</span><span class="lines">@@ -106,37 +101,31 @@
</span><span class="cx"> void JSLock::lock()
</span><span class="cx"> {
</span><span class="cx">     ThreadIdentifier currentThread = WTF::currentThread();
</span><del>-    {
-        SpinLockHolder holder(&amp;m_spinLock);
-        if (m_ownerThread == currentThread &amp;&amp; m_lockCount) {
-            m_lockCount++;
-            return;
-        }
</del><ins>+    if (currentThreadIsHoldingLock()) {
+        m_lockCount++;
+        return;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_lock.lock();
</span><span class="cx"> 
</span><del>-    {
-        SpinLockHolder holder(&amp;m_spinLock);
-        m_ownerThread = currentThread;
-        ASSERT(!m_lockCount);
-        m_lockCount = 1;
</del><ins>+    setOwnerThread(currentThread);
+    ASSERT(!m_lockCount);
+    m_lockCount = 1;
</ins><span class="cx"> 
</span><del>-        WTFThreadData&amp; threadData = wtfThreadData();
</del><ins>+    WTFThreadData&amp; threadData = wtfThreadData();
</ins><span class="cx"> 
</span><del>-        if (!m_vm-&gt;stackPointerAtVMEntry) {
-            m_vm-&gt;stackPointerAtVMEntry = &amp;holder; // A proxy for the current stack pointer.
-            threadData.setSavedReservedZoneSize(m_vm-&gt;updateStackLimitWithReservedZoneSize(Options::reservedZoneSize()));
-        }
-
-        m_vm-&gt;setLastStackTop(threadData.savedLastStackTop());
</del><ins>+    if (!m_vm-&gt;stackPointerAtVMEntry) {
+        void* p = &amp;p;
+        m_vm-&gt;stackPointerAtVMEntry = p; // A proxy for the current stack pointer.
+        threadData.setSavedReservedZoneSize(m_vm-&gt;updateStackLimitWithReservedZoneSize(Options::reservedZoneSize()));
</ins><span class="cx">     }
</span><ins>+
+    m_vm-&gt;setLastStackTop(threadData.savedLastStackTop());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSLock::unlock()
</span><span class="cx"> {
</span><del>-    SpinLockHolder holder(&amp;m_spinLock);
-    ASSERT(currentThreadIsHoldingLock());
</del><ins>+    RELEASE_ASSERT(currentThreadIsHoldingLock());
</ins><span class="cx"> 
</span><span class="cx">     m_lockCount--;
</span><span class="cx"> 
</span><span class="lines">@@ -145,6 +134,7 @@
</span><span class="cx">             m_vm-&gt;stackPointerAtVMEntry = nullptr;
</span><span class="cx">             m_vm-&gt;updateStackLimitWithReservedZoneSize(wtfThreadData().savedReservedZoneSize());
</span><span class="cx">         }
</span><ins>+        setOwnerThread(0);
</ins><span class="cx">         m_lock.unlock();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -161,7 +151,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSLock::currentThreadIsHoldingLock()
</span><span class="cx"> {
</span><del>-    return m_lockCount &amp;&amp; m_ownerThread == WTF::currentThread();
</del><ins>+    return m_ownerThread == WTF::currentThread();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This is fairly nasty.  We allow multiple threads to run on the same
</span><span class="lines">@@ -206,13 +196,11 @@
</span><span class="cx"> //
</span><span class="cx"> 
</span><span class="cx"> // This function returns the number of locks that were dropped.
</span><del>-unsigned JSLock::dropAllLocks(SpinLock&amp; spinLock)
</del><ins>+unsigned JSLock::dropAllLocks()
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(spinLock, spinLock.IsHeld());
</del><span class="cx">     // Check if this thread is currently holding the lock.
</span><span class="cx">     // FIXME: Maybe we want to require this, guard with an ASSERT?
</span><del>-    unsigned locksToDrop = m_lockCount;
-    if (!locksToDrop || m_ownerThread != WTF::currentThread())
</del><ins>+    if (!currentThreadIsHoldingLock())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     // Don't drop the locks if they've already been dropped once.
</span><span class="lines">@@ -228,22 +216,23 @@
</span><span class="cx"> 
</span><span class="cx">     // m_lockDropDepth is only incremented if any locks were dropped.
</span><span class="cx">     ++m_lockDropDepth;
</span><ins>+
+    unsigned droppedLockCount = m_lockCount;
</ins><span class="cx">     m_lockCount = 0;
</span><span class="cx">     if (m_vm) {
</span><span class="cx">         m_vm-&gt;stackPointerAtVMEntry = nullptr;
</span><span class="cx">         m_vm-&gt;updateStackLimitWithReservedZoneSize(wtfThreadData().savedReservedZoneSize());
</span><span class="cx">     }
</span><ins>+    setOwnerThread(0);
</ins><span class="cx">     m_lock.unlock();
</span><del>-    return locksToDrop;
</del><ins>+    return droppedLockCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned JSLock::dropAllLocksUnconditionally(SpinLock&amp; spinLock)
</del><ins>+unsigned JSLock::dropAllLocksUnconditionally()
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(spinLock, spinLock.IsHeld());
</del><span class="cx">     // Check if this thread is currently holding the lock.
</span><span class="cx">     // FIXME: Maybe we want to require this, guard with an ASSERT?
</span><del>-    unsigned locksToDrop = m_lockCount;
-    if (!locksToDrop || m_ownerThread != WTF::currentThread())
</del><ins>+    if (!currentThreadIsHoldingLock())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     WTFThreadData&amp; threadData = wtfThreadData();
</span><span class="lines">@@ -253,36 +242,29 @@
</span><span class="cx"> 
</span><span class="cx">     // m_lockDropDepth is only incremented if any locks were dropped.
</span><span class="cx">     ++m_lockDropDepth;
</span><ins>+
+    unsigned droppedLockCount = m_lockCount;
</ins><span class="cx">     m_lockCount = 0;
</span><span class="cx">     if (m_vm) {
</span><span class="cx">         m_vm-&gt;stackPointerAtVMEntry = nullptr;
</span><span class="cx">         m_vm-&gt;updateStackLimitWithReservedZoneSize(wtfThreadData().savedReservedZoneSize());
</span><span class="cx">     }
</span><ins>+    setOwnerThread(0);
</ins><span class="cx">     m_lock.unlock();
</span><del>-    return locksToDrop;
</del><ins>+    return droppedLockCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSLock::grabAllLocks(unsigned droppedLockCount, SpinLock&amp; spinLock)
</del><ins>+void JSLock::grabAllLocks(unsigned droppedLockCount)
</ins><span class="cx"> {
</span><del>-    ASSERT(spinLock.IsHeld());
</del><span class="cx">     // If no locks were dropped, nothing to do!
</span><span class="cx">     if (!droppedLockCount)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ThreadIdentifier currentThread = WTF::currentThread();
-    // Check if this thread is currently holding the lock.
-    // FIXME: Maybe we want to prohibit this, guard against with an ASSERT?
-    if (m_ownerThread == currentThread &amp;&amp; m_lockCount) {
-        m_lockCount += droppedLockCount;
-        --m_lockDropDepth;
-        return;
-    }
</del><ins>+    ASSERT(!currentThreadIsHoldingLock());
</ins><span class="cx"> 
</span><del>-    spinLock.Unlock();
</del><span class="cx">     m_lock.lock();
</span><del>-    spinLock.Lock();
</del><span class="cx"> 
</span><del>-    m_ownerThread = currentThread;
</del><ins>+    setOwnerThread(WTF::currentThread());
</ins><span class="cx">     ASSERT(!m_lockCount);
</span><span class="cx">     m_lockCount = droppedLockCount;
</span><span class="cx">     --m_lockDropDepth;
</span><span class="lines">@@ -299,13 +281,11 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_vm)
</span><span class="cx">         return;
</span><del>-    SpinLock&amp; spinLock = m_vm-&gt;apiLock().m_spinLock;
-    SpinLockHolder holder(&amp;spinLock);
</del><span class="cx"> 
</span><span class="cx">     if (alwaysDropLocks)
</span><del>-        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocksUnconditionally(spinLock);
</del><ins>+        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocksUnconditionally();
</ins><span class="cx">     else
</span><del>-        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocks(spinLock);
</del><ins>+        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocks();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSLock::DropAllLocks::DropAllLocks(VM* vm, AlwaysDropLocksTag alwaysDropLocks)
</span><span class="lines">@@ -314,22 +294,18 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_vm)
</span><span class="cx">         return;
</span><del>-    SpinLock&amp; spinLock = m_vm-&gt;apiLock().m_spinLock;
-    SpinLockHolder holder(&amp;spinLock);
</del><span class="cx"> 
</span><span class="cx">     if (alwaysDropLocks)
</span><del>-        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocksUnconditionally(spinLock);
</del><ins>+        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocksUnconditionally();
</ins><span class="cx">     else
</span><del>-        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocks(spinLock);
</del><ins>+        m_droppedLockCount = m_vm-&gt;apiLock().dropAllLocks();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSLock::DropAllLocks::~DropAllLocks()
</span><span class="cx"> {
</span><span class="cx">     if (!m_vm)
</span><span class="cx">         return;
</span><del>-    SpinLock&amp; spinLock = m_vm-&gt;apiLock().m_spinLock;
-    SpinLockHolder holder(&amp;spinLock);
-    m_vm-&gt;apiLock().grabAllLocks(m_droppedLockCount, spinLock);
</del><ins>+    m_vm-&gt;apiLock().grabAllLocks(m_droppedLockCount);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.h (163803 => 163804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.h        2014-02-10 19:32:37 UTC (rev 163803)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.h        2014-02-10 19:39:30 UTC (rev 163804)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><del>-#include &lt;wtf/TCSpinLock.h&gt;
</del><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -113,11 +112,12 @@
</span><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        unsigned dropAllLocks(SpinLock&amp;);
-        unsigned dropAllLocksUnconditionally(SpinLock&amp;);
-        void grabAllLocks(unsigned lockCount, SpinLock&amp;);
</del><ins>+        void setOwnerThread(ThreadIdentifier owner) { m_ownerThread = owner; }
</ins><span class="cx"> 
</span><del>-        SpinLock m_spinLock;
</del><ins>+        unsigned dropAllLocks();
+        unsigned dropAllLocksUnconditionally();
+        void grabAllLocks(unsigned lockCount);
+
</ins><span class="cx">         Mutex m_lock;
</span><span class="cx">         ThreadIdentifier m_ownerThread;
</span><span class="cx">         intptr_t m_lockCount;
</span></span></pre>
</div>
</div>

</body>
</html>