JSString::tryHashConstLock() fails to get exclusive lock
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2012 00:04:05 +0000 (00:04 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2012 00:04:05 +0000 (00:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90639

Reviewed by Oliver Hunt.

Added check that the string is already locked even before compare and swap.

* heap/MarkStack.cpp:
(JSC::JSString::tryHashConstLock):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121928 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/MarkStack.cpp

index 8373d91..54c4176 100644 (file)
@@ -1,3 +1,15 @@
+2012-07-05  Michael Saboff  <msaboff@apple.com>
+
+        JSString::tryHashConstLock() fails to get exclusive lock
+        https://bugs.webkit.org/show_bug.cgi?id=90639
+
+        Reviewed by Oliver Hunt.
+
+        Added check that the string is already locked even before compare and swap.
+
+        * heap/MarkStack.cpp:
+        (JSC::JSString::tryHashConstLock):
+
 2012-07-04  Filip Pizlo  <fpizlo@apple.com>
 
         Inline property storage should not be wasted when it is exhausted
index f547b31..9d91300 100644 (file)
@@ -546,6 +546,10 @@ ALWAYS_INLINE bool JSString::tryHashConstLock()
 {
 #if ENABLE(PARALLEL_GC)
     unsigned currentFlags = m_flags;
+
+    if (currentFlags & HashConstLock)
+        return false;
+
     unsigned newFlags = currentFlags | HashConstLock;
 
     if (!WTF::weakCompareAndSwap(&m_flags, currentFlags, newFlags))