Bug 720759 - Convert js::SameValue, js::StrictlyEqual, js::LooselyEqual, and js::EqualStrings to return a value through a bool*, not a JSBool*, to eliminate a (single!) Windows warning. r=Ms2ger
authorJeff Walden <jwalden@mit.edu>
Tue, 24 Jan 2012 10:29:55 -0800
changeset 86484 6e849614a79fce45958fd7e92d62603b015d7a98
parent 86483 bd75f26eee254c2b9bf1a22e18c304833060a7a0
child 86485 01a5ce645a8b022b64685e0bcc018d1c5ae1b976
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs720759
milestone12.0a1
Bug 720759 - Convert js::SameValue, js::StrictlyEqual, js::LooselyEqual, and js::EqualStrings to return a value through a bool*, not a JSBool*, to eliminate a (single!) Windows warning. r=Ms2ger
js/src/builtin/MapObject.cpp
js/src/jsapi.cpp
js/src/jsarray.cpp
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsobj.cpp
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jsxml.cpp
js/src/methodjit/FastOps.cpp
js/src/methodjit/StubCalls.cpp
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -133,17 +133,17 @@ HashableValue::equals(const HashableValu
     /* Two HashableValues are equal if they have equal bits or they're equal strings. */
     bool b = (value.asRawBits() == other.value.asRawBits()) ||
               (value.isString() &&
                other.value.isString() &&
                EqualStrings(&value.toString()->asLinear(),
                             &other.value.toString()->asLinear()));
 
 #ifdef DEBUG
-    JSBool same;
+    bool same;
     JS_ASSERT(SameValue(NULL, value, other.value, &same));
     JS_ASSERT(same == b);
 #endif
     return b;
 }
 
 
 /*** Map *****************************************************************************************/
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -635,35 +635,47 @@ JS_GetTypeName(JSContext *cx, JSType typ
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
-    return StrictlyEqual(cx, v1, v2, equal);
+    bool eq;
+    if (!StrictlyEqual(cx, v1, v2, &eq))
+        return false;
+    *equal = eq;
+    return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal)
 {
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
-    return LooselyEqual(cx, v1, v2, equal);
+    bool eq;
+    if (!LooselyEqual(cx, v1, v2, &eq))
+        return false;
+    *equal = eq;
+    return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same)
 {
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v1, v2);
-    return SameValue(cx, v1, v2, same);
+    bool s;
+    if (!SameValue(cx, v1, v2, &s))
+        return false;
+    *same = s;
+    return true;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsBuiltinEvalFunction(JSFunction *fun)
 {
     return IsAnyBuiltinEval(fun);
 }
 
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -3127,22 +3127,22 @@ array_indexOfHelper(JSContext *cx, Index
 
     for (;;) {
         Value elt;
         if (!JS_CHECK_OPERATION_LIMIT(cx) ||
             !GetElement(cx, obj, (jsuint)i, &hole, &elt)) {
             return JS_FALSE;
         }
         if (!hole) {
-            JSBool equal;
+            bool equal;
             if (!StrictlyEqual(cx, elt, tosearch, &equal))
-                return JS_FALSE;
+                return false;
             if (equal) {
                 args.rval().setNumber(i);
-                return JS_TRUE;
+                return true;
             }
         }
         if (i == stop)
             goto not_found;
         i += direction;
     }
 
   not_found:
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -830,22 +830,26 @@ js::HasInstance(JSContext *cx, JSObject 
     if (clasp->hasInstance)
         return clasp->hasInstance(cx, obj, v, bp);
     js_ReportValueError(cx, JSMSG_BAD_INSTANCEOF_RHS,
                         JSDVG_SEARCH_STACK, ObjectValue(*obj), NULL);
     return JS_FALSE;
 }
 
 bool
-js::LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, JSBool *result)
+js::LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *result)
 {
 #if JS_HAS_XML_SUPPORT
     if (JS_UNLIKELY(lval.isObject() && lval.toObject().isXML()) ||
                     (rval.isObject() && rval.toObject().isXML())) {
-        return js_TestXMLEquality(cx, lval, rval, result);
+        JSBool res;
+        if (!js_TestXMLEquality(cx, lval, rval, &res))
+            return false;
+        *result = !!res;
+        return true;
     }
 #endif
 
     if (SameType(lval, rval)) {
         if (lval.isString()) {
             JSString *l = lval.toString();
             JSString *r = rval.toString();
             return EqualStrings(cx, l, r, result);
@@ -857,17 +861,21 @@ js::LooselyEqual(JSContext *cx, const Va
             return true;
         }
 
         if (lval.isObject()) {
             JSObject *l = &lval.toObject();
             JSObject *r = &rval.toObject();
 
             if (JSEqualityOp eq = l->getClass()->ext.equality) {
-                return eq(cx, l, &rval, result);
+                JSBool res;
+                if (!eq(cx, l, &rval, &res))
+                    return false;
+                *result = !!res;
+                return true;
             }
 
             *result = l == r;
             return true;
         }
 
         *result = lval.payloadAsRawUint32() == rval.payloadAsRawUint32();
         return true;
@@ -900,17 +908,17 @@ js::LooselyEqual(JSContext *cx, const Va
     double l, r;
     if (!ToNumber(cx, lvalue, &l) || !ToNumber(cx, rvalue, &r))
         return false;
     *result = JSDOUBLE_COMPARE(l, ==, r, false);
     return true;
 }
 
 bool
-js::StrictlyEqual(JSContext *cx, const Value &lref, const Value &rref, JSBool *equal)
+js::StrictlyEqual(JSContext *cx, const Value &lref, const Value &rref, bool *equal)
 {
     Value lval = lref, rval = rref;
     if (SameType(lval, rval)) {
         if (lval.isString())
             return EqualStrings(cx, lval.toString(), rval.toString(), equal);
         if (lval.isDouble()) {
             *equal = JSDOUBLE_COMPARE(lval.toDouble(), ==, rval.toDouble(), JS_FALSE);
             return true;
@@ -952,17 +960,17 @@ IsNegativeZero(const Value &v)
 
 static inline bool
 IsNaN(const Value &v)
 {
     return v.isDouble() && JSDOUBLE_IS_NaN(v.toDouble());
 }
 
 bool
-js::SameValue(JSContext *cx, const Value &v1, const Value &v2, JSBool *same)
+js::SameValue(JSContext *cx, const Value &v1, const Value &v2, bool *same)
 {
     if (IsNegativeZero(v1)) {
         *same = IsNegativeZero(v2);
         return true;
     }
     if (IsNegativeZero(v2)) {
         *same = false;
         return true;
@@ -2259,17 +2267,17 @@ BEGIN_CASE(JSOP_BITAND)
 END_CASE(JSOP_BITAND)
 
 #undef BITWISE_OP
 
 #define EQUALITY_OP(OP)                                                       \
     JS_BEGIN_MACRO                                                            \
         Value rval = regs.sp[-1];                                             \
         Value lval = regs.sp[-2];                                             \
-        JSBool cond;                                                          \
+        bool cond;                                                            \
         if (!LooselyEqual(cx, lval, rval, &cond))                             \
             goto error;                                                       \
         cond = cond OP JS_TRUE;                                               \
         TRY_BRANCH_AFTER_COND(cond, 2);                                       \
         regs.sp--;                                                            \
         regs.sp[-1].setBoolean(cond);                                         \
     JS_END_MACRO
 
@@ -2282,17 +2290,17 @@ BEGIN_CASE(JSOP_NE)
 END_CASE(JSOP_NE)
 
 #undef EQUALITY_OP
 
 #define STRICT_EQUALITY_OP(OP, COND)                                          \
     JS_BEGIN_MACRO                                                            \
         const Value &rref = regs.sp[-1];                                      \
         const Value &lref = regs.sp[-2];                                      \
-        JSBool equal;                                                         \
+        bool equal;                                                           \
         if (!StrictlyEqual(cx, lref, rref, &equal))                           \
             goto error;                                                       \
         COND = equal OP JS_TRUE;                                              \
         regs.sp--;                                                            \
     JS_END_MACRO
 
 BEGIN_CASE(JSOP_STRICTEQ)
 {
--- a/js/src/jsinterp.h
+++ b/js/src/jsinterp.h
@@ -234,24 +234,24 @@ CheckRedeclaration(JSContext *cx, JSObje
 
 inline bool
 CheckRedeclaration(JSContext *cx, JSObject *obj, PropertyName *name, uintN attrs)
 {
     return CheckRedeclaration(cx, obj, ATOM_TO_JSID(name), attrs);
 }
 
 extern bool
-StrictlyEqual(JSContext *cx, const Value &lval, const Value &rval, JSBool *equal);
+StrictlyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *equal);
 
 extern bool
-LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, JSBool *equal);
+LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, bool *equal);
 
 /* === except that NaN is the same as NaN and -0 is not the same as +0. */
 extern bool
-SameValue(JSContext *cx, const Value &v1, const Value &v2, JSBool *same);
+SameValue(JSContext *cx, const Value &v1, const Value &v2, bool *same);
 
 extern JSType
 TypeOfValue(JSContext *cx, const Value &v);
 
 extern JSBool
 HasInstance(JSContext *cx, JSObject *obj, const js::Value *v, JSBool *bp);
 
 extern bool
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -2136,27 +2136,27 @@ DefinePropertyOnObject(JSContext *cx, JS
 
     const Shape *shape = reinterpret_cast<Shape *>(current);
     do {
         if (desc.isAccessorDescriptor()) {
             if (!shape->isAccessorDescriptor())
                 break;
 
             if (desc.hasGet) {
-                JSBool same;
+                bool same;
                 if (!SameValue(cx, desc.getterValue(), shape->getterOrUndefined(), &same))
-                    return JS_FALSE;
+                    return false;
                 if (!same)
                     break;
             }
 
             if (desc.hasSet) {
-                JSBool same;
+                bool same;
                 if (!SameValue(cx, desc.setterValue(), shape->setterOrUndefined(), &same))
-                    return JS_FALSE;
+                    return false;
                 if (!same)
                     break;
             }
         } else {
             /*
              * Determine the current value of the property once, if the current
              * value might actually need to be used or preserved later.  NB: we
              * guard on whether the current property is a data descriptor to
@@ -2185,20 +2185,20 @@ DefinePropertyOnObject(JSContext *cx, JS
                 if (!js_NativeGet(cx, obj, obj2, shape, JSGET_NO_METHOD_BARRIER, &v))
                     return JS_FALSE;
             }
 
             if (desc.isDataDescriptor()) {
                 if (!shape->isDataDescriptor())
                     break;
 
-                JSBool same;
+                bool same;
                 if (desc.hasValue) {
                     if (!SameValue(cx, desc.value, v, &same))
-                        return JS_FALSE;
+                        return false;
                     if (!same) {
                         /*
                          * Insist that a non-configurable js::PropertyOp data
                          * property is frozen at exactly the last-got value.
                          *
                          * Duplicate the first part of the big conjunction that
                          * we tested above, rather than add a local bool flag.
                          * Likewise, don't try to keep shape->writable() in a
@@ -2263,41 +2263,41 @@ DefinePropertyOnObject(JSContext *cx, JS
             return Reject(cx, JSMSG_CANT_REDEFINE_PROP, throwError, id, rval);
     } else if (desc.isDataDescriptor()) {
         /* 8.12.9 step 10. */
         JS_ASSERT(shape->isDataDescriptor());
         if (!shape->configurable() && !shape->writable()) {
             if (desc.hasWritable && desc.writable())
                 return Reject(cx, JSMSG_CANT_REDEFINE_PROP, throwError, id, rval);
             if (desc.hasValue) {
-                JSBool same;
+                bool same;
                 if (!SameValue(cx, desc.value, v, &same))
-                    return JS_FALSE;
+                    return false;
                 if (!same)
                     return Reject(cx, JSMSG_CANT_REDEFINE_PROP, throwError, id, rval);
             }
         }
 
         callDelProperty = !shape->hasDefaultGetter() || !shape->hasDefaultSetter();
     } else {
         /* 8.12.9 step 11. */
         JS_ASSERT(desc.isAccessorDescriptor() && shape->isAccessorDescriptor());
         if (!shape->configurable()) {
             if (desc.hasSet) {
-                JSBool same;
+                bool same;
                 if (!SameValue(cx, desc.setterValue(), shape->setterOrUndefined(), &same))
-                    return JS_FALSE;
+                    return false;
                 if (!same)
                     return Reject(cx, JSMSG_CANT_REDEFINE_PROP, throwError, id, rval);
             }
 
             if (desc.hasGet) {
-                JSBool same;
+                bool same;
                 if (!SameValue(cx, desc.getterValue(), shape->getterOrUndefined(), &same))
-                    return JS_FALSE;
+                    return false;
                 if (!same)
                     return Reject(cx, JSMSG_CANT_REDEFINE_PROP, throwError, id, rval);
             }
         }
     }
 
     /* 8.12.9 step 12. */
     uintN attrs;
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -3373,17 +3373,17 @@ js_ValueToSource(JSContext *cx, const Va
     }
 
     return ToString(cx, rval);
 }
 
 namespace js {
 
 bool
-EqualStrings(JSContext *cx, JSString *str1, JSString *str2, JSBool *result)
+EqualStrings(JSContext *cx, JSString *str1, JSString *str2, bool *result)
 {
     if (str1 == str2) {
         *result = true;
         return true;
     }
 
     size_t length1 = str1->length();
     if (length1 != str2->length()) {
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -181,17 +181,17 @@ js_ValueToSource(JSContext *cx, const js
 
 namespace js {
 
 /*
  * Test if strings are equal. The caller can call the function even if str1
  * or str2 are not GC-allocated things.
  */
 extern bool
-EqualStrings(JSContext *cx, JSString *str1, JSString *str2, JSBool *result);
+EqualStrings(JSContext *cx, JSString *str1, JSString *str2, bool *result);
 
 /* EqualStrings is infallible on linear strings. */
 extern bool
 EqualStrings(JSLinearString *str1, JSLinearString *str2);
 
 /*
  * Return less than, equal to, or greater than zero depending on whether
  * str1 is less than, equal to, or greater than str2.
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -3379,18 +3379,20 @@ retry:
               EqualStrings(qn->getNameURI(), vqn->getNameURI());
     } else {
         *bp = vqn == NULL;
     }
     if (!*bp)
         return JS_TRUE;
 
     if (JSXML_HAS_VALUE(xml)) {
-        if (!EqualStrings(cx, xml->xml_value, vxml->xml_value, bp))
+        bool equal;
+        if (!EqualStrings(cx, xml->xml_value, vxml->xml_value, &equal))
             return JS_FALSE;
+        *bp = equal;
     } else if (xml->xml_kids.length != vxml->xml_kids.length) {
         *bp = JS_FALSE;
     } else {
         {
             JSXMLArrayCursor<JSXML> cursor(&xml->xml_kids);
             JSXMLArrayCursor<JSXML> vcursor(&vxml->xml_kids);
             for (;;) {
                 kid = cursor.getNext();
@@ -3420,18 +3422,20 @@ retry:
                 j = XMLARRAY_FIND_MEMBER(&vxml->xml_attrs, attr, attr_identity);
                 if (j == XML_NOT_FOUND) {
                     *bp = JS_FALSE;
                     break;
                 }
                 vattr = XMLARRAY_MEMBER(&vxml->xml_attrs, j, JSXML);
                 if (!vattr)
                     continue;
-                if (!EqualStrings(cx, attr->xml_value, vattr->xml_value, bp))
+                bool equal;
+                if (!EqualStrings(cx, attr->xml_value, vattr->xml_value, &equal))
                     return JS_FALSE;
+                *bp = equal;
             }
         }
     }
 
     return JS_TRUE;
 }
 
 /* ECMA-357 9.1.1.9 XML [[Equals]] and 9.2.1.9 XMLList [[Equals]]. */
@@ -5270,38 +5274,47 @@ js_TestXMLEquality(JSContext *cx, const 
                  HasSimpleContent(vxml)) ||
                 ((vxml->xml_class == JSXML_CLASS_TEXT ||
                   vxml->xml_class == JSXML_CLASS_ATTRIBUTE) &&
                  HasSimpleContent(xml))) {
                 ok = js_EnterLocalRootScope(cx);
                 if (ok) {
                     ok = (str = ToStringSlow(cx, ObjectValue(*obj))) &&
                          (vstr = ToString(cx, v));
-                    if (ok)
-                        ok = EqualStrings(cx, str, vstr, bp);
+                    if (ok) {
+                        bool equal;
+                        ok = EqualStrings(cx, str, vstr, &equal);
+                        *bp = equal;
+                    }
                     js_LeaveLocalRootScope(cx);
                 }
             } else {
                 ok = XMLEquals(cx, xml, vxml, bp);
             }
         }
     } else {
         ok = js_EnterLocalRootScope(cx);
         if (ok) {
             if (HasSimpleContent(xml)) {
                 ok = (str = ToString(cx, ObjectValue(*obj))) &&
                      (vstr = ToString(cx, v));
-                if (ok)
-                    ok = EqualStrings(cx, str, vstr, bp);
+                if (ok) {
+                    bool equal;
+                    ok = EqualStrings(cx, str, vstr, &equal);
+                    *bp = equal;
+                }
             } else if (JSVAL_IS_STRING(v) || JSVAL_IS_NUMBER(v)) {
                 str = ToString(cx, ObjectValue(*obj));
                 if (!str) {
                     ok = JS_FALSE;
                 } else if (JSVAL_IS_STRING(v)) {
-                    ok = EqualStrings(cx, str, JSVAL_TO_STRING(v), bp);
+                    bool equal;
+                    ok = EqualStrings(cx, str, JSVAL_TO_STRING(v), &equal);
+                    if (ok)
+                        *bp = equal;
                 } else {
                     ok = JS_ValueToNumber(cx, STRING_TO_JSVAL(str), &d);
                     if (ok) {
                         d2 = JSVAL_IS_INT(v) ? JSVAL_TO_INT(v)
                                              : JSVAL_TO_DOUBLE(v);
                         *bp = JSDOUBLE_COMPARE(d, ==, d2, JS_FALSE);
                     }
                 }
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -2295,17 +2295,17 @@ mjit::Compiler::jsop_stricteq(JSOp op)
 
     /*
      * NB: x64 can do full-Value comparisons. This is beneficial
      * to do if the payload/type are not yet in registers.
      */
 
     /* Constant-fold. */
     if (lhs->isConstant() && rhs->isConstant()) {
-        JSBool b;
+        bool b;
         StrictlyEqual(cx, lhs->getValue(), rhs->getValue(), &b);
         frame.popn(2);
         frame.push(BooleanValue((op == JSOP_STRICTEQ) ? b : !b));
         return;
     }
 
     if (frame.haveSameBacking(lhs, rhs)) {
         /* False iff NaN. */
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -563,61 +563,64 @@ stubs::ValueToBoolean(VMFrame &f)
 
 void JS_FASTCALL
 stubs::Not(VMFrame &f)
 {
     JSBool b = !js_ValueToBoolean(f.regs.sp[-1]);
     f.regs.sp[-1].setBoolean(b);
 }
 
-template <JSBool EQ, bool IFNAN>
+template <bool EQ, bool IFNAN>
 static inline bool
 StubEqualityOp(VMFrame &f)
 {
     JSContext *cx = f.cx;
     FrameRegs &regs = f.regs;
 
     Value rval = regs.sp[-1];
     Value lval = regs.sp[-2];
 
-    JSBool cond;
+    bool cond;
 
     /* The string==string case is easily the hottest;  try it first. */
     if (lval.isString() && rval.isString()) {
         JSString *l = lval.toString();
         JSString *r = rval.toString();
-        JSBool equal;
+        bool equal;
         if (!EqualStrings(cx, l, r, &equal))
             return false;
         cond = equal == EQ;
     } else
 #if JS_HAS_XML_SUPPORT
     if ((lval.isObject() && lval.toObject().isXML()) ||
-        (rval.isObject() && rval.toObject().isXML())) {
-        if (!js_TestXMLEquality(cx, lval, rval, &cond))
+        (rval.isObject() && rval.toObject().isXML()))
+    {
+        JSBool equal;
+        if (!js_TestXMLEquality(cx, lval, rval, &equal))
             return false;
-        cond = cond == EQ;
+        cond = !!equal == EQ;
     } else
 #endif
 
     if (SameType(lval, rval)) {
         JS_ASSERT(!lval.isString());    /* this case is handled above */
         if (lval.isDouble()) {
             double l = lval.toDouble();
             double r = rval.toDouble();
             if (EQ)
                 cond = JSDOUBLE_COMPARE(l, ==, r, IFNAN);
             else
                 cond = JSDOUBLE_COMPARE(l, !=, r, IFNAN);
         } else if (lval.isObject()) {
             JSObject *l = &lval.toObject(), *r = &rval.toObject();
             if (JSEqualityOp eq = l->getClass()->ext.equality) {
-                if (!eq(cx, l, &rval, &cond))
+                JSBool equal;
+                if (!eq(cx, l, &rval, &equal))
                     return false;
-                cond = cond == EQ;
+                cond = !!equal == EQ;
             } else {
                 cond = (l == r) == EQ;
             }
         } else if (lval.isNullOrUndefined()) {
             cond = EQ;
         } else {
             cond = (lval.payloadAsRawUint32() == rval.payloadAsRawUint32()) == EQ;
         }
@@ -634,17 +637,17 @@ StubEqualityOp(VMFrame &f)
 
             /*
              * The string==string case is repeated because ToPrimitive can
              * convert lval/rval to strings.
              */
             if (lval.isString() && rval.isString()) {
                 JSString *l = lval.toString();
                 JSString *r = rval.toString();
-                JSBool equal;
+                bool equal;
                 if (!EqualStrings(cx, l, r, &equal))
                     return false;
                 cond = equal == EQ;
             } else {
                 double l, r;
                 if (!ToNumber(cx, lval, &l) || !ToNumber(cx, rval, &r))
                     return false;
 
@@ -658,25 +661,25 @@ StubEqualityOp(VMFrame &f)
 
     regs.sp[-2].setBoolean(cond);
     return true;
 }
 
 JSBool JS_FASTCALL
 stubs::Equal(VMFrame &f)
 {
-    if (!StubEqualityOp<JS_TRUE, false>(f))
+    if (!StubEqualityOp<true, false>(f))
         THROWV(JS_FALSE);
     return f.regs.sp[-2].toBoolean();
 }
 
 JSBool JS_FASTCALL
 stubs::NotEqual(VMFrame &f)
 {
-    if (!StubEqualityOp<JS_FALSE, true>(f))
+    if (!StubEqualityOp<false, true>(f))
         THROWV(JS_FALSE);
     return f.regs.sp[-2].toBoolean();
 }
 
 void JS_FASTCALL
 stubs::Add(VMFrame &f)
 {
     JSContext *cx = f.cx;
@@ -1314,29 +1317,29 @@ stubs::TypeOf(VMFrame &f)
     return f.cx->runtime->atomState.typeAtoms[type];
 }
 
 void JS_FASTCALL
 stubs::StrictEq(VMFrame &f)
 {
     const Value &rhs = f.regs.sp[-1];
     const Value &lhs = f.regs.sp[-2];
-    JSBool equal;
+    bool equal;
     if (!StrictlyEqual(f.cx, lhs, rhs, &equal))
         THROW();
     f.regs.sp--;
     f.regs.sp[-1].setBoolean(equal == JS_TRUE);
 }
 
 void JS_FASTCALL
 stubs::StrictNe(VMFrame &f)
 {
     const Value &rhs = f.regs.sp[-1];
     const Value &lhs = f.regs.sp[-2];
-    JSBool equal;
+    bool equal;
     if (!StrictlyEqual(f.cx, lhs, rhs, &equal))
         THROW();
     f.regs.sp--;
     f.regs.sp[-1].setBoolean(equal != JS_TRUE);
 }
 
 void JS_FASTCALL
 stubs::Throw(VMFrame &f)