Bug 487546: Fix shell bustage, r=brendan
--- 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)), \