Bug 487546: Fix shell bustage, r=brendan
authorDavid Mandelin <dmandelin@mozilla.com>
Thu, 16 Apr 2009 17:23:43 -0700
changeset 27478 c7ce33adf7e20a8ea78b29768e5717f2e50c0d32
parent 27477 ba70256c015519778d2365ed37de3cb635b8b2b8
child 27480 4b4afe4b1d9289cb2b9ecb232dbd9c186fd4c773
push id6576
push userrsayre@mozilla.com
push dateSat, 18 Apr 2009 15:37:12 +0000
treeherderautoland@55d20693b9cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrendan
bugs487546
milestone1.9.2a1pre
Bug 487546: Fix shell bustage, r=brendan
js/src/jslock.h
js/src/jsstr.h
--- a/js/src/jslock.h
+++ b/js/src/jslock.h
@@ -301,25 +301,29 @@ extern void js_SetScopeInfo(JSScope *sco
 #define JS_SET_TITLE_INFO(title,f,l)    ((void)0)
 #endif
 
 #ifdef JS_THREADSAFE
 
 extern JSBool
 js_CompareAndSwap(jsword *w, jsword ov, jsword nv);
 
+/* Atomically bitwise-or the mask into the word *w using compare and swap. */
+extern void
+js_AtomicSetMask(jsword *w, jsword mask);
+
+#define JS_ATOMIC_SET_MASK(w, mask) js_AtomicSetMask(w, mask)
+
 #else
 
 static inline JSBool
 js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
 {
     return (*w == ov) ? *w = nv, JS_TRUE : JS_FALSE;
 }
 
-#endif
+#define JS_ATOMIC_SET_MASK(w, mask) *(w) |= mask
 
-/* Atomically bitwise-or the mask into the word *w using compare and swap. */
-extern void
-js_AtomicSetMask(jsword *w, jsword mask);
+#endif /* JS_THREADSAFE */
 
 JS_END_EXTERN_C
 
 #endif /* jslock_h___ */
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -137,18 +137,18 @@ struct JSString {
 #define JSSTRING_LENGTH(str)        (JSSTRING_IS_DEPENDENT(str)               \
                                      ? JSSTRDEP_LENGTH(str)                   \
                                      : JSFLATSTR_LENGTH(str))
 
 JS_STATIC_ASSERT(sizeof(size_t) == sizeof(jsword));
 
 #define JSSTRING_IS_DEFLATED(str)   ((str)->length & JSSTRFLAG_DEFLATED)
 
-#define JSSTRING_SET_DEFLATED(str)  js_AtomicSetMask((jsword*)&(str)->length, \
-                                                     JSSTRFLAG_DEFLATED);
+#define JSSTRING_SET_DEFLATED(str)                                            \
+    JS_ATOMIC_SET_MASK((jsword*)&(str)->length, JSSTRFLAG_DEFLATED)
 
 #define JSSTRING_CHARS_AND_LENGTH(str, chars_, length_)                       \
     ((void)(JSSTRING_IS_DEPENDENT(str)                                        \
             ? ((length_) = JSSTRDEP_LENGTH(str),                              \
                (chars_) = JSSTRDEP_CHARS(str))                                \
             : ((length_) = JSFLATSTR_LENGTH(str),                             \
                (chars_) = JSFLATSTR_CHARS(str))))
 
@@ -192,17 +192,17 @@ JS_STATIC_ASSERT(sizeof(size_t) == sizeo
  * seeing a stale value when another thread has just atomized the string and
  * set the flag. But this can lead only to an extra call to js_AtomizeString.
  * This function would find that the string was already hashed and return it
  * with the atomized bit set.
  */
 #define JSFLATSTR_SET_ATOMIZED(str)                                           \
     JS_BEGIN_MACRO                                                            \
         JS_ASSERT(JSSTRING_IS_FLAT(str) && !JSSTRING_IS_MUTABLE(str));        \
-        js_AtomicSetMask((jsword*) &(str)->length, JSSTRFLAG_ATOMIZED);       \
+        JS_ATOMIC_SET_MASK((jsword*) &(str)->length, JSSTRFLAG_ATOMIZED);     \
     JS_END_MACRO
 
 #define JSFLATSTR_SET_MUTABLE(str)                                            \
     ((void)(JS_ASSERT(JSSTRING_IS_FLAT(str) && !JSSTRING_IS_ATOMIZED(str)),   \
             (str)->length |= JSSTRFLAG_MUTABLE))
 
 #define JSFLATSTR_CLEAR_MUTABLE(str)                                          \
     ((void)(JS_ASSERT(JSSTRING_IS_FLAT(str)),                                 \