Bug 732306: Remove typedef jsint, r=luke
authorDavid Mandelin <dmandelin@mozilla.com>
Thu, 01 Mar 2012 18:54:01 -0800
changeset 91059 e365b768a32ebdaa67a4264602d269ed8cbdd571
parent 91058 5d9e5dd1709e675a177efe7100931220a31472ca
child 91060 b0b135e60d351fbbda6987dff6a410771068b855
push idunknown
push userunknown
push dateunknown
reviewersluke
bugs732306
milestone13.0a1
Bug 732306: Remove typedef jsint, r=luke
dom/base/nsDOMClassInfo.cpp
dom/plugins/base/nsJSNPRuntime.cpp
dom/plugins/base/nsNPAPIPlugin.h
js/src/ctypes/CTypes.cpp
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/jsanalyze.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jscntxtinlines.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdate.cpp
js/src/jsinterp.cpp
js/src/jsinterpinlines.h
js/src/jsiter.cpp
js/src/jsmath.cpp
js/src/jsnum.cpp
js/src/jsnum.h
js/src/jsobj.cpp
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jspubtd.h
js/src/jsstr.cpp
js/src/jsstrinlines.h
js/src/jstypedarray.cpp
js/src/jstypedarray.h
js/src/jsxml.cpp
js/src/methodjit/Compiler.cpp
js/src/methodjit/StubCalls.cpp
js/src/shell/js.cpp
js/src/vm/Debugger.cpp
js/src/vm/String-inl.h
js/src/vm/String.cpp
js/src/vm/String.h
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -4446,17 +4446,17 @@ nsDOMClassInfo::Init()
 // static
 PRInt32
 nsDOMClassInfo::GetArrayIndexFromId(JSContext *cx, jsid id, bool *aIsNumber)
 {
   if (aIsNumber) {
     *aIsNumber = false;
   }
 
-  jsint i;
+  int i;
   if (JSID_IS_INT(id)) {
       i = JSID_TO_INT(id);
   } else {
       JSAutoRequest ar(cx);
 
       jsval idval;
       double array_index;
       if (!::JS_IdToValue(cx, id, &idval) ||
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -452,17 +452,17 @@ JSValToNPVariant(NPP npp, JSContext *cx,
     } else if (JSVAL_IS_NULL(val)) {
       NULL_TO_NPVARIANT(*variant);
     } else if (JSVAL_IS_BOOLEAN(val)) {
       BOOLEAN_TO_NPVARIANT(JSVAL_TO_BOOLEAN(val), *variant);
     } else if (JSVAL_IS_INT(val)) {
       INT32_TO_NPVARIANT(JSVAL_TO_INT(val), *variant);
     } else if (JSVAL_IS_DOUBLE(val)) {
       double d = JSVAL_TO_DOUBLE(val);
-      jsint i;
+      int i;
       if (JS_DoubleIsInt32(d, &i)) {
         INT32_TO_NPVARIANT(i, *variant);
       } else {
         DOUBLE_TO_NPVARIANT(d, *variant);
       }
     } else if (JSVAL_IS_STRING(val)) {
       JSString *jsstr = JSVAL_TO_STRING(val);
       size_t length;
--- a/dom/plugins/base/nsNPAPIPlugin.h
+++ b/dom/plugins/base/nsNPAPIPlugin.h
@@ -152,24 +152,24 @@ StringToNPIdentifier(JSContext *cx, JSSt
 }
 
 inline bool
 NPIdentifierIsInt(NPIdentifier id)
 {
     return JSID_IS_INT(NPIdentifierToJSId(id));
 }
 
-inline jsint
+inline int
 NPIdentifierToInt(NPIdentifier id)
 {
     return JSID_TO_INT(NPIdentifierToJSId(id));
 }
 
 inline NPIdentifier
-IntToNPIdentifier(jsint i)
+IntToNPIdentifier(int i)
 {
     return JSIdToNPIdentifier(INT_TO_JSID(i));
 }
 
 JSContext* GetJSContext(NPP npp);
 
 inline bool
 NPStringIdentifierIsPermanent(NPP npp, NPIdentifier id)
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1136,53 +1136,53 @@ struct IsNegativeImpl<Type, true> {
 
 // Determine whether Type 'i' is negative.
 template<class Type>
 static JS_ALWAYS_INLINE bool IsNegative(Type i)
 {
   return IsNegativeImpl<Type, numeric_limits<Type>::is_signed>::Test(i);
 }
 
-// Implicitly convert val to bool, allowing JSBool, jsint, and double
+// Implicitly convert val to bool, allowing JSBool, int, and double
 // arguments numerically equal to 0 or 1.
 static bool
 jsvalToBool(JSContext* cx, jsval val, bool* result)
 {
   if (JSVAL_IS_BOOLEAN(val)) {
     *result = JSVAL_TO_BOOLEAN(val) != JS_FALSE;
     return true;
   }
   if (JSVAL_IS_INT(val)) {
-    jsint i = JSVAL_TO_INT(val);
+    int32_t i = JSVAL_TO_INT(val);
     *result = i != 0;
     return i == 0 || i == 1;
   }
   if (JSVAL_IS_DOUBLE(val)) {
     double d = JSVAL_TO_DOUBLE(val);
     *result = d != 0;
     // Allow -0.
     return d == 1 || d == 0;
   }
   // Don't silently convert null to bool. It's probably a mistake.
   return false;
 }
 
-// Implicitly convert val to IntegerType, allowing JSBool, jsint, double,
+// Implicitly convert val to IntegerType, allowing JSBool, int, double,
 // Int64, UInt64, and CData integer types 't' where all values of 't' are
 // representable by IntegerType.
 template<class IntegerType>
 static bool
 jsvalToInteger(JSContext* cx, jsval val, IntegerType* result)
 {
   JS_STATIC_ASSERT(numeric_limits<IntegerType>::is_exact);
 
   if (JSVAL_IS_INT(val)) {
     // Make sure the integer fits in the alotted precision, and has the right
     // sign.
-    jsint i = JSVAL_TO_INT(val);
+    int32_t i = JSVAL_TO_INT(val);
     return ConvertExact(i, result);
   }
   if (JSVAL_IS_DOUBLE(val)) {
     // Don't silently lose bits here -- check that val really is an
     // integer value, and has the right sign.
     double d = JSVAL_TO_DOUBLE(val);
     return ConvertExact(d, result);
   }
@@ -1241,17 +1241,17 @@ jsvalToInteger(JSContext* cx, jsval val,
     *result = JSVAL_TO_BOOLEAN(val);
     JS_ASSERT(*result == 0 || *result == 1);
     return true;
   }
   // Don't silently convert null to an integer. It's probably a mistake.
   return false;
 }
 
-// Implicitly convert val to FloatType, allowing jsint, double,
+// Implicitly convert val to FloatType, allowing int, double,
 // Int64, UInt64, and CData numeric types 't' where all values of 't' are
 // representable by FloatType.
 template<class FloatType>
 static bool
 jsvalToFloat(JSContext *cx, jsval val, FloatType* result)
 {
   JS_STATIC_ASSERT(!numeric_limits<FloatType>::is_exact);
 
@@ -1354,32 +1354,32 @@ StringToInteger(JSContext* cx, JSString*
     if (i / base != ii) // overflow
       return false;
   }
 
   *result = i;
   return true;
 }
 
-// Implicitly convert val to IntegerType, allowing jsint, double,
+// Implicitly convert val to IntegerType, allowing int, double,
 // Int64, UInt64, and optionally a decimal or hexadecimal string argument.
 // (This is common code shared by jsvalToSize and the Int64/UInt64 constructors.)
 template<class IntegerType>
 static bool
 jsvalToBigInteger(JSContext* cx,
                   jsval val,
                   bool allowString,
                   IntegerType* result)
 {
   JS_STATIC_ASSERT(numeric_limits<IntegerType>::is_exact);
 
   if (JSVAL_IS_INT(val)) {
     // Make sure the integer fits in the alotted precision, and has the right
     // sign.
-    jsint i = JSVAL_TO_INT(val);
+    int32_t i = JSVAL_TO_INT(val);
     return ConvertExact(i, result);
   }
   if (JSVAL_IS_DOUBLE(val)) {
     // Don't silently lose bits here -- check that val really is an
     // integer value, and has the right sign.
     double d = JSVAL_TO_DOUBLE(val);
     return ConvertExact(d, result);
   }
@@ -1416,32 +1416,32 @@ jsvalToSize(JSContext* cx, jsval val, bo
 {
   if (!jsvalToBigInteger(cx, val, allowString, result))
     return false;
 
   // Also check that the result fits in a double.
   return Convert<size_t>(double(*result)) == *result;
 }
 
-// Implicitly convert val to IntegerType, allowing jsint, double,
+// Implicitly convert val to IntegerType, allowing int, double,
 // Int64, UInt64, and optionally a decimal or hexadecimal string argument.
 // (This is common code shared by jsvalToSize and the Int64/UInt64 constructors.)
 template<class IntegerType>
 static bool
 jsidToBigInteger(JSContext* cx,
                   jsid val,
                   bool allowString,
                   IntegerType* result)
 {
   JS_STATIC_ASSERT(numeric_limits<IntegerType>::is_exact);
 
   if (JSID_IS_INT(val)) {
     // Make sure the integer fits in the alotted precision, and has the right
     // sign.
-    jsint i = JSID_TO_INT(val);
+    int32_t i = JSID_TO_INT(val);
     return ConvertExact(i, result);
   }
   if (allowString && JSID_IS_STRING(val)) {
     // Allow conversion from base-10 or base-16 strings, provided the result
     // fits in IntegerType. (This allows an Int64 or UInt64 object to be passed
     // to the JS array element operator, which will automatically call
     // toString() on the object for us.)
     return StringToInteger(cx, JSID_TO_STRING(val), result);
@@ -1520,19 +1520,19 @@ jsvalToIntegerExplicit(jsval val, Intege
   return false;
 }
 
 // Forcefully convert val to a pointer value when explicitly requested.
 static bool
 jsvalToPtrExplicit(JSContext* cx, jsval val, uintptr_t* result)
 {
   if (JSVAL_IS_INT(val)) {
-    // jsint always fits in intptr_t. If the integer is negative, cast through
+    // int32_t always fits in intptr_t. If the integer is negative, cast through
     // an intptr_t intermediate to sign-extend.
-    jsint i = JSVAL_TO_INT(val);
+    int32_t i = JSVAL_TO_INT(val);
     *result = i < 0 ? uintptr_t(intptr_t(i)) : uintptr_t(i);
     return true;
   }
   if (JSVAL_IS_DOUBLE(val)) {
     double d = JSVAL_TO_DOUBLE(val);
     if (d < 0) {
       // Cast through an intptr_t intermediate to sign-extend.
       intptr_t i = Convert<intptr_t>(d);
@@ -1645,17 +1645,17 @@ ConvertToJS(JSContext* cx,
     break;
   case TYPE_bool:
     *result = *static_cast<bool*>(data) ? JSVAL_TRUE : JSVAL_FALSE;
     break;
 #define DEFINE_INT_TYPE(name, type, ffiType)                                   \
   case TYPE_##name: {                                                          \
     type value = *static_cast<type*>(data);                                    \
     if (sizeof(type) < 4)                                                      \
-      *result = INT_TO_JSVAL(jsint(value));                                    \
+      *result = INT_TO_JSVAL(int32_t(value));                                    \
     else if (!JS_NewNumberValue(cx, double(value), result))                    \
       return false;                                                            \
     break;                                                                     \
   }
 #define DEFINE_WRAPPED_INT_TYPE(name, type, ffiType)                           \
   case TYPE_##name: {                                                          \
     /* Return an Int64 or UInt64 object - do not convert to a JS number. */    \
     uint64_t value;                                                            \
@@ -2924,17 +2924,17 @@ CType::TypesEqual(JSObject* t1, JSObject
 
 bool
 CType::GetSafeSize(JSObject* obj, size_t* result)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
-  // The "size" property can be a jsint, a double, or JSVAL_VOID
+  // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   if (JSVAL_IS_INT(size)) {
     *result = JSVAL_TO_INT(size);
     return true;
   }
   if (JSVAL_IS_DOUBLE(size)) {
     *result = Convert<size_t>(JSVAL_TO_DOUBLE(size));
     return true;
@@ -2948,32 +2948,32 @@ size_t
 CType::GetSize(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
   JS_ASSERT(!JSVAL_IS_VOID(size));
 
-  // The "size" property can be a jsint, a double, or JSVAL_VOID
+  // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   // For callers who know it can never be JSVAL_VOID, return a size_t directly.
   if (JSVAL_IS_INT(size))
     return JSVAL_TO_INT(size);
   return Convert<size_t>(JSVAL_TO_DOUBLE(size));
 }
 
 bool
 CType::IsSizeDefined(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
 
   jsval size = JS_GetReservedSlot(obj, SLOT_SIZE);
 
-  // The "size" property can be a jsint, a double, or JSVAL_VOID
+  // The "size" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   JS_ASSERT(JSVAL_IS_INT(size) || JSVAL_IS_DOUBLE(size) || JSVAL_IS_VOID(size));
   return !JSVAL_IS_VOID(size);
 }
 
 size_t
 CType::GetAlignment(JSObject* obj)
 {
@@ -3594,17 +3594,17 @@ ArrayType::CreateInternal(JSContext* cx,
   if (!CType::GetSafeSize(baseType, &baseSize)) {
     JS_ReportError(cx, "base size must be defined");
     return NULL;
   }
 
   jsval sizeVal = JSVAL_VOID;
   jsval lengthVal = JSVAL_VOID;
   if (lengthDefined) {
-    // Check for overflow, and convert to a jsint or double as required.
+    // Check for overflow, and convert to an int or double as required.
     size_t size = length * baseSize;
     if (length > 0 && size / length != baseSize) {
       JS_ReportError(cx, "size overflow");
       return NULL;
     }
     if (!SizeTojsval(cx, size, &sizeVal) ||
         !SizeTojsval(cx, length, &lengthVal))
       return NULL;
@@ -3745,17 +3745,17 @@ ArrayType::GetBaseType(JSObject* obj)
 bool
 ArrayType::GetSafeLength(JSObject* obj, size_t* result)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
 
   jsval length = JS_GetReservedSlot(obj, SLOT_LENGTH);
 
-  // The "length" property can be a jsint, a double, or JSVAL_VOID
+  // The "length" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   if (JSVAL_IS_INT(length)) {
     *result = JSVAL_TO_INT(length);
     return true;
   }
   if (JSVAL_IS_DOUBLE(length)) {
     *result = Convert<size_t>(JSVAL_TO_DOUBLE(length));
     return true;
@@ -3770,17 +3770,17 @@ ArrayType::GetLength(JSObject* obj)
 {
   JS_ASSERT(CType::IsCType(obj));
   JS_ASSERT(CType::GetTypeCode(obj) == TYPE_array);
 
   jsval length = JS_GetReservedSlot(obj, SLOT_LENGTH);
 
   JS_ASSERT(!JSVAL_IS_VOID(length));
 
-  // The "length" property can be a jsint, a double, or JSVAL_VOID
+  // The "length" property can be an int, a double, or JSVAL_VOID
   // (for arrays of undefined length), and must always fit in a size_t.
   // For callers who know it can never be JSVAL_VOID, return a size_t directly.
   if (JSVAL_IS_INT(length))
     return JSVAL_TO_INT(length);
   return Convert<size_t>(JSVAL_TO_DOUBLE(length));
 }
 
 ffi_type*
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -770,17 +770,17 @@ frontend::DefineCompileTimeConstant(JSCo
     if (pn->isKind(PNK_NUMBER)) {
         if (!bce->constMap.put(atom, NumberValue(pn->pn_dval)))
             return JS_FALSE;
     }
     return JS_TRUE;
 }
 
 StmtInfo *
-frontend::LexicalLookup(TreeContext *tc, JSAtom *atom, jsint *slotp, StmtInfo *stmt)
+frontend::LexicalLookup(TreeContext *tc, JSAtom *atom, int *slotp, StmtInfo *stmt)
 {
     if (!stmt)
         stmt = tc->topScopeStmt;
     for (; stmt; stmt = stmt->downScope) {
         if (stmt->type == STMT_WITH)
             break;
 
         /* Skip "maybe scope" statements that don't contain let bindings. */
@@ -1002,18 +1002,18 @@ BytecodeEmitter::shouldNoteClosedName(Pa
 /*
  * Adjust the slot for a block local to account for the number of variables
  * that share the same index space with locals. Due to the incremental code
  * generation for top-level script, we do the adjustment via code patching in
  * js::frontend::CompileScript; see comments there.
  *
  * The function returns -1 on failures.
  */
-static jsint
-AdjustBlockSlot(JSContext *cx, BytecodeEmitter *bce, jsint slot)
+static int
+AdjustBlockSlot(JSContext *cx, BytecodeEmitter *bce, int slot)
 {
     JS_ASSERT((jsuint) slot < bce->maxStackDepth);
     if (bce->inFunction()) {
         slot += bce->bindings.countVars();
         if ((unsigned) slot >= SLOTNO_LIMIT) {
             ReportCompileErrorNumber(cx, bce->tokenStream(), NULL, JSREPORT_ERROR,
                                      JSMSG_TOO_MANY_LOCALS);
             slot = -1;
@@ -2256,17 +2256,17 @@ EmitNumberOp(JSContext *cx, double dval,
     ptrdiff_t off;
     jsbytecode *pc;
 
     if (JSDOUBLE_IS_INT32(dval, &ival)) {
         if (ival == 0)
             return Emit1(cx, bce, JSOP_ZERO) >= 0;
         if (ival == 1)
             return Emit1(cx, bce, JSOP_ONE) >= 0;
-        if ((jsint)(int8_t)ival == ival)
+        if ((int)(int8_t)ival == ival)
             return Emit2(cx, bce, JSOP_INT8, (jsbytecode)(int8_t)ival) >= 0;
 
         u = (uint32_t)ival;
         if (u < JS_BIT(16)) {
             EMIT_UINT16_IMM_OP(JSOP_UINT16, u);
         } else if (u < JS_BIT(24)) {
             off = EmitN(cx, bce, JSOP_UINT24, 3);
             if (off < 0)
@@ -2469,17 +2469,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
 
             if (switchOp != JSOP_TABLESWITCH)
                 continue;
             if (!pn3->pn_pval->isInt32()) {
                 switchOp = JSOP_LOOKUPSWITCH;
                 continue;
             }
             i = pn3->pn_pval->toInt32();
-            if ((jsuint)(i + (jsint)JS_BIT(15)) >= (jsuint)JS_BIT(16)) {
+            if ((jsuint)(i + (int)JS_BIT(15)) >= (jsuint)JS_BIT(16)) {
                 switchOp = JSOP_LOOKUPSWITCH;
                 continue;
             }
             if (i < low)
                 low = i;
             if (high < i)
                 high = i;
 
@@ -2679,17 +2679,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
             /*
              * Skip switchOp, as we are not setting jump offsets in the two
              * for loops below.  We'll restore bce->next() from savepc after,
              * unless there was an error.
              */
             savepc = bce->next();
             bce->current->next = pc + 1;
             if (switchOp == JSOP_TABLESWITCH) {
-                for (i = 0; i < (jsint)tableLength; i++) {
+                for (i = 0; i < (int)tableLength; i++) {
                     pn3 = table[i];
                     if (pn3 &&
                         (pn4 = pn3->pn_left) != NULL &&
                         pn4->isKind(PNK_NAME))
                     {
                         /* Note a propagated constant with the const's name. */
                         JS_ASSERT(!pn4->maybeExpr());
                         jsatomid index;
@@ -2759,17 +2759,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
     if (!ok)
         goto out;
 
     if (switchOp == JSOP_TABLESWITCH) {
         /* Skip over the already-initialized switch bounds. */
         pc += 2 * JUMP_OFFSET_LEN;
 
         /* Fill in the jump table, if there is one. */
-        for (i = 0; i < (jsint)tableLength; i++) {
+        for (i = 0; i < (int)tableLength; i++) {
             pn3 = table[i];
             off = pn3 ? pn3->pn_offset - top : 0;
             SET_JUMP_OFFSET(pc, off);
             pc += JUMP_OFFSET_LEN;
         }
     } else if (switchOp == JSOP_LOOKUPSWITCH) {
         /* Skip over the already-initialized number of cases. */
         pc += UINT16_LEN;
@@ -3329,17 +3329,17 @@ EmitGroupAssignment(JSContext *cx, Bytec
 
     if (NewSrcNote2(cx, bce, SRC_GROUPASSIGN, OpToDeclType(prologOp)) < 0)
         return JS_FALSE;
 
     i = depth;
     for (pn = lhs->pn_head; pn; pn = pn->pn_next, ++i) {
         /* MaybeEmitGroupAssignment requires lhs->pn_count <= rhs->pn_count. */
         JS_ASSERT(i < limit);
-        jsint slot = AdjustBlockSlot(cx, bce, i);
+        int slot = AdjustBlockSlot(cx, bce, i);
         if (slot < 0)
             return JS_FALSE;
         EMIT_UINT16_IMM_OP(JSOP_GETLOCAL, slot);
 
         if (pn->isKind(PNK_COMMA) && pn->isArity(PN_NULLARY)) {
             if (Emit1(cx, bce, JSOP_POP) < 0)
                 return JS_FALSE;
         } else {
@@ -6502,17 +6502,17 @@ frontend::EmitTree(JSContext *cx, Byteco
       case PNK_LET:
         ok = pn->isArity(PN_BINARY)
              ? EmitLet(cx, bce, pn)
              : EmitVariables(cx, bce, pn, InitializeVars);
         break;
 #endif /* JS_HAS_BLOCK_SCOPE */
 #if JS_HAS_GENERATORS
       case PNK_ARRAYPUSH: {
-        jsint slot;
+        int slot;
 
         /*
          * The array object's stack index is in bce->arrayCompDepth. See below
          * under the array initialiser code generator for array comprehension
          * special casing.
          */
         if (!EmitTree(cx, bce, pn->pn_kid))
             return JS_FALSE;
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -784,17 +784,17 @@ DefineCompileTimeConstant(JSContext *cx,
  * This means that if slotp is not null, all the block objects on the lexical
  * scope chain must have had their depth slots computed by the code generator,
  * so the caller must be under EmitTree.
  *
  * In any event, directly return the statement info record in which atom was
  * found. Otherwise return null.
  */
 StmtInfo *
-LexicalLookup(TreeContext *tc, JSAtom *atom, jsint *slotp, StmtInfo *stmt = NULL);
+LexicalLookup(TreeContext *tc, JSAtom *atom, int *slotp, StmtInfo *stmt = NULL);
 
 /*
  * Emit code into bce for the tree rooted at pn.
  */
 JSBool
 EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn);
 
 /*
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -381,27 +381,27 @@ ScriptAnalysis::analyzeBytecode(JSContex
             /* Only consider potentially inlineable calls here. */
             hasFunctionCalls_ = true;
             break;
 
           case JSOP_TABLESWITCH: {
             isInlineable = false;
             unsigned defaultOffset = offset + GET_JUMP_OFFSET(pc);
             jsbytecode *pc2 = pc + JUMP_OFFSET_LEN;
-            jsint low = GET_JUMP_OFFSET(pc2);
+            int32_t low = GET_JUMP_OFFSET(pc2);
             pc2 += JUMP_OFFSET_LEN;
-            jsint high = GET_JUMP_OFFSET(pc2);
+            int32_t high = GET_JUMP_OFFSET(pc2);
             pc2 += JUMP_OFFSET_LEN;
 
             if (!addJump(cx, defaultOffset, &nextOffset, &forwardJump, stackDepth))
                 return;
             getCode(defaultOffset).switchTarget = true;
             getCode(defaultOffset).safePoint = true;
 
-            for (jsint i = low; i <= high; i++) {
+            for (int32_t i = low; i <= high; i++) {
                 unsigned targetOffset = offset + GET_JUMP_OFFSET(pc2);
                 if (targetOffset != offset) {
                     if (!addJump(cx, targetOffset, &nextOffset, &forwardJump, stackDepth))
                         return;
                 }
                 getCode(targetOffset).switchTarget = true;
                 getCode(targetOffset).safePoint = true;
                 pc2 += JUMP_OFFSET_LEN;
@@ -1515,22 +1515,22 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
           /*
            * Switch and try blocks preserve the stack between the original op
            * and all case statements or exception/finally handlers.
            */
 
           case JSOP_TABLESWITCH: {
             unsigned defaultOffset = offset + GET_JUMP_OFFSET(pc);
             jsbytecode *pc2 = pc + JUMP_OFFSET_LEN;
-            jsint low = GET_JUMP_OFFSET(pc2);
+            int32_t low = GET_JUMP_OFFSET(pc2);
             pc2 += JUMP_OFFSET_LEN;
-            jsint high = GET_JUMP_OFFSET(pc2);
+            int32_t high = GET_JUMP_OFFSET(pc2);
             pc2 += JUMP_OFFSET_LEN;
 
-            for (jsint i = low; i <= high; i++) {
+            for (int32_t i = low; i <= high; i++) {
                 unsigned targetOffset = offset + GET_JUMP_OFFSET(pc2);
                 if (targetOffset != offset)
                     checkBranchTarget(cx, targetOffset, branchTargets, values, stackDepth);
                 pc2 += JUMP_OFFSET_LEN;
             }
 
             checkBranchTarget(cx, defaultOffset, branchTargets, values, stackDepth);
             break;
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -542,19 +542,19 @@ JS_ValueToNumber(JSContext *cx, jsval v,
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
     AutoValueRooter tvr(cx, v);
     return ToNumber(cx, tvr.value(), dp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_DoubleIsInt32(double d, jsint *ip)
-{
-    return JSDOUBLE_IS_INT32(d, (int32_t *)ip);
+JS_DoubleIsInt32(double d, int32_t *ip)
+{
+    return JSDOUBLE_IS_INT32(d, ip);
 }
 
 JS_PUBLIC_API(int32_t)
 JS_DoubleToInt32(double d)
 {
     return js_DoubleToECMAInt32(d);
 }
 
@@ -2020,79 +2020,77 @@ JS_EnumerateStandardClasses(JSContext *c
                 return JS_FALSE;
         }
     }
 
     return JS_TRUE;
 }
 
 static JSIdArray *
-NewIdArray(JSContext *cx, jsint length)
+NewIdArray(JSContext *cx, int length)
 {
     JSIdArray *ida;
 
     ida = (JSIdArray *)
         cx->calloc_(offsetof(JSIdArray, vector) + length * sizeof(jsval));
     if (ida)
         ida->length = length;
     return ida;
 }
 
 /*
  * Unlike realloc(3), this function frees ida on failure.
  */
 static JSIdArray *
-SetIdArrayLength(JSContext *cx, JSIdArray *ida, jsint length)
+SetIdArrayLength(JSContext *cx, JSIdArray *ida, int length)
 {
     JSIdArray *rida;
 
     rida = (JSIdArray *)
            JS_realloc(cx, ida,
                       offsetof(JSIdArray, vector) + length * sizeof(jsval));
     if (!rida) {
         JS_DestroyIdArray(cx, ida);
     } else {
         rida->length = length;
     }
     return rida;
 }
 
 static JSIdArray *
-AddAtomToArray(JSContext *cx, JSAtom *atom, JSIdArray *ida, jsint *ip)
-{
-    jsint i, length;
-
-    i = *ip;
-    length = ida->length;
+AddAtomToArray(JSContext *cx, JSAtom *atom, JSIdArray *ida, int *ip)
+{
+    int i = *ip;
+    int length = ida->length;
     if (i >= length) {
         ida = SetIdArrayLength(cx, ida, JS_MAX(length * 2, 8));
         if (!ida)
             return NULL;
         JS_ASSERT(i < ida->length);
     }
     ida->vector[i].init(ATOM_TO_JSID(atom));
     *ip = i + 1;
     return ida;
 }
 
 static JSIdArray *
 EnumerateIfResolved(JSContext *cx, JSObject *obj, JSAtom *atom, JSIdArray *ida,
-                    jsint *ip, JSBool *foundp)
+                    int *ip, JSBool *foundp)
 {
     *foundp = obj->nativeContains(cx, ATOM_TO_JSID(atom));
     if (*foundp)
         ida = AddAtomToArray(cx, atom, ida, ip);
     return ida;
 }
 
 JS_PUBLIC_API(JSIdArray *)
 JS_EnumerateResolvedStandardClasses(JSContext *cx, JSObject *obj, JSIdArray *ida)
 {
     JSRuntime *rt;
-    jsint i, j, k;
+    int i, j, k;
     JSAtom *atom;
     JSBool found;
     JSObjectOp init;
 
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, ida);
     rt = cx->runtime;
@@ -2996,24 +2994,24 @@ JS_SetNativeStackQuota(JSRuntime *rt, si
         JS_ASSERT(rt->nativeStackBase >= stackSize);
         rt->nativeStackLimit = rt->nativeStackBase - (stackSize - 1);
     }
 #endif
 }
 
 /************************************************************************/
 
-JS_PUBLIC_API(jsint)
+JS_PUBLIC_API(int)
 JS_IdArrayLength(JSContext *cx, JSIdArray *ida)
 {
     return ida->length;
 }
 
 JS_PUBLIC_API(jsid)
-JS_IdArrayGet(JSContext *cx, JSIdArray *ida, jsint index)
+JS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index)
 {
     JS_ASSERT(index >= 0 && index < ida->length);
     return ida->vector[index];
 }
 
 JS_PUBLIC_API(void)
 JS_DestroyIdArray(JSContext *cx, JSIdArray *ida)
 {
@@ -4292,17 +4290,17 @@ static Class prop_iter_class = {
     prop_iter_trace
 };
 
 JS_PUBLIC_API(JSObject *)
 JS_NewPropertyIterator(JSContext *cx, JSObject *obj)
 {
     JSObject *iterobj;
     void *pdata;
-    jsint index;
+    int index;
     JSIdArray *ida;
 
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     iterobj = NewObjectWithClassProto(cx, &prop_iter_class, NULL, obj);
     if (!iterobj)
         return NULL;
@@ -4329,17 +4327,17 @@ JS_NewPropertyIterator(JSContext *cx, JS
     iterobj->setPrivate(pdata);
     iterobj->setSlot(JSSLOT_ITER_INDEX, Int32Value(index));
     return iterobj;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp)
 {
-    jsint i;
+    int32_t i;
     const Shape *shape;
     JSIdArray *ida;
 
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, iterobj);
     i = iterobj->getSlot(JSSLOT_ITER_INDEX).toInt32();
     if (i < 0) {
@@ -4396,17 +4394,17 @@ JS_GetReservedSlot(JSObject *obj, uint32
 
 JS_PUBLIC_API(void)
 JS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v)
 {
     obj->setReservedSlot(index, v);
 }
 
 JS_PUBLIC_API(JSObject *)
-JS_NewArrayObject(JSContext *cx, jsint length, jsval *vector)
+JS_NewArrayObject(JSContext *cx, int length, jsval *vector)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     AssertNoGC(cx);
     CHECK_REQUEST(cx);
     /* NB: jsuint cast does ToUint32. */
     assertSameCompartment(cx, JSValueArray(vector, vector ? (jsuint)length : 0));
     return NewDenseCopiedArray(cx, (jsuint)length, vector);
 }
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -60,18 +60,18 @@
 #include "js/Vector.h"
 #include "mozilla/Attributes.h"
 #endif
 
 /************************************************************************/
 
 /* JS::Value can store a full int32_t. */
 #define JSVAL_INT_BITS          32
-#define JSVAL_INT_MIN           ((jsint)0x80000000)
-#define JSVAL_INT_MAX           ((jsint)0x7fffffff)
+#define JSVAL_INT_MIN           ((int32_t)0x80000000)
+#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)
 
 /************************************************************************/
 
 #define JS_Assert MOZ_Assert
 
 #ifdef __cplusplus
 namespace JS {
 
@@ -1646,17 +1646,17 @@ JSVAL_IS_VOID(jsval v)
 }
 
 static JS_ALWAYS_INLINE JSBool
 JSVAL_IS_INT(jsval v)
 {
     return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));
 }
 
-static JS_ALWAYS_INLINE jsint
+static JS_ALWAYS_INLINE int32_t
 JSVAL_TO_INT(jsval v)
 {
     JS_ASSERT(JSVAL_IS_INT(v));
     return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));
 }
 
 static JS_ALWAYS_INLINE jsval
 INT_TO_JSVAL(int32_t i)
@@ -2057,17 +2057,17 @@ class AutoIdRooter : private AutoGCRoote
 #define JSPROP_PERMANENT        0x04    /* property cannot be deleted */
 #define JSPROP_GETTER           0x10    /* property holds getter function */
 #define JSPROP_SETTER           0x20    /* property holds setter function */
 #define JSPROP_SHARED           0x40    /* don't allocate a value slot for this
                                            property; don't copy the property on
                                            set of the same-named property in an
                                            object that delegates to a prototype
                                            containing this property */
-#define JSPROP_INDEX            0x80    /* name is actually (jsint) index */
+#define JSPROP_INDEX            0x80    /* name is actually (int) index */
 #define JSPROP_SHORTID          0x100   /* set in JS_DefineProperty attrs
                                            if getters/setters use a shortid */
 #define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags
                                            if getters/setters are JSNatives */
 
 /* Function flags, internal use only, returned by JS_GetFunctionFlags. */
 #define JSFUN_LAMBDA            0x08    /* expressed, not declared, function */
 #define JSFUN_HEAVYWEIGHT       0x80    /* activation requires a Call object */
@@ -2239,17 +2239,17 @@ JS_ValueToString(JSContext *cx, jsval v)
 
 extern JS_PUBLIC_API(JSString *)
 JS_ValueToSource(JSContext *cx, jsval v);
 
 extern JS_PUBLIC_API(JSBool)
 JS_ValueToNumber(JSContext *cx, jsval v, double *dp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_DoubleIsInt32(double d, jsint *ip);
+JS_DoubleIsInt32(double d, int32_t *ip);
 
 extern JS_PUBLIC_API(int32_t)
 JS_DoubleToInt32(double d);
 
 extern JS_PUBLIC_API(uint32_t)
 JS_DoubleToUint32(double d);
 
 /*
@@ -3487,21 +3487,21 @@ struct JSClass {
                                          (((clasp)->flags                     \
                                            >> JSCLASS_CACHED_PROTO_SHIFT)     \
                                           & JSCLASS_CACHED_PROTO_MASK))
 
 /* Initializer for unused members of statically initialized JSClass structs. */
 #define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 #define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS
 
-extern JS_PUBLIC_API(jsint)
+extern JS_PUBLIC_API(int)
 JS_IdArrayLength(JSContext *cx, JSIdArray *ida);
 
 extern JS_PUBLIC_API(jsid)
-JS_IdArrayGet(JSContext *cx, JSIdArray *ida, jsint index);
+JS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);
 
 extern JS_PUBLIC_API(void)
 JS_DestroyIdArray(JSContext *cx, JSIdArray *ida);
 
 #ifdef __cplusplus
 
 namespace JS {
 
@@ -3975,17 +3975,17 @@ JS_SetUCProperty(JSContext *cx, JSObject
                  jsval *vp);
 
 extern JS_PUBLIC_API(JSBool)
 JS_DeleteUCProperty2(JSContext *cx, JSObject *obj,
                      const jschar *name, size_t namelen,
                      jsval *rval);
 
 extern JS_PUBLIC_API(JSObject *)
-JS_NewArrayObject(JSContext *cx, jsint length, jsval *vector);
+JS_NewArrayObject(JSContext *cx, int length, jsval *vector);
 
 extern JS_PUBLIC_API(JSBool)
 JS_IsArrayObject(JSContext *cx, JSObject *obj);
 
 extern JS_PUBLIC_API(JSBool)
 JS_GetArrayLength(JSContext *cx, JSObject *obj, jsuint *lengthp);
 
 extern JS_PUBLIC_API(JSBool)
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -162,17 +162,17 @@ js_GetLengthProperty(JSContext *cx, JSOb
         }
     }
 
     AutoValueRooter tvr(cx);
     if (!obj->getProperty(cx, cx->runtime->atomState.lengthAtom, tvr.addr()))
         return false;
 
     if (tvr.value().isInt32()) {
-        *lengthp = jsuint(jsint(tvr.value().toInt32())); /* jsuint cast does ToUint32_t */
+        *lengthp = jsuint(tvr.value().toInt32()); /* jsuint cast does ToUint32_t */
         return true;
     }
 
     JS_STATIC_ASSERT(sizeof(jsuint) == sizeof(uint32_t));
     return ToUint32(cx, tvr.value(), (uint32_t *)lengthp);
 }
 
 namespace js {
@@ -3077,17 +3077,17 @@ enum IndexOfKind {
     LastIndexOf
 };
 
 static JSBool
 array_indexOfHelper(JSContext *cx, IndexOfKind mode, CallArgs &args)
 {
     jsuint length, i, stop;
     Value tosearch;
-    jsint direction;
+    int direction;
     JSBool hole;
 
     JSObject *obj = ToObject(cx, &args.thisv());
     if (!obj)
         return false;
     if (!js_GetLengthProperty(cx, obj, &length))
         return JS_FALSE;
     if (length == 0)
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -55,18 +55,17 @@ namespace js {
 /* 2^32-2, inclusive */
 const uint32_t MAX_ARRAY_INDEX = 4294967294u;
 }
 
 inline JSBool
 js_IdIsIndex(jsid id, jsuint *indexp)
 {
     if (JSID_IS_INT(id)) {
-        jsint i;
-        i = JSID_TO_INT(id);
+        int32_t i = JSID_TO_INT(id);
         if (i < 0)
             return JS_FALSE;
         *indexp = (jsuint)i;
         return JS_TRUE;
     }
 
     if (JS_UNLIKELY(!JSID_IS_STRING(id)))
         return JS_FALSE;
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -731,23 +731,23 @@ js_CheckForStringIndex(jsid id)
      */
     if (cp != end || (negative && index == 0))
         return id;
 
     if (negative) {
         if (oldIndex < -(JSID_INT_MIN / 10) ||
             (oldIndex == -(JSID_INT_MIN / 10) && c <= (-JSID_INT_MIN % 10)))
         {
-            id = INT_TO_JSID(-jsint(index));
+            id = INT_TO_JSID(-int32_t(index));
         }
     } else {
         if (oldIndex < JSID_INT_MAX / 10 ||
             (oldIndex == JSID_INT_MAX / 10 && c <= (JSID_INT_MAX % 10)))
         {
-            id = INT_TO_JSID(jsint(index));
+            id = INT_TO_JSID(int32_t(index));
         }
     }
 
     return id;
 }
 
 #if JS_HAS_XML_SUPPORT
 bool
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -48,17 +48,17 @@
 #include "jshash.h"
 #include "jspubtd.h"
 #include "jslock.h"
 
 #include "gc/Barrier.h"
 #include "js/HashTable.h"
 
 struct JSIdArray {
-    jsint length;
+    int length;
     js::HeapId vector[1];    /* actually, length jsid words */
 };
 
 /* Engine-internal extensions of jsid */
 
 static JS_ALWAYS_INLINE jsid
 JSID_FROM_BITS(size_t bits)
 {
--- a/js/src/jscntxtinlines.h
+++ b/js/src/jscntxtinlines.h
@@ -209,17 +209,17 @@ class CompartmentChecker
 
     void check(jsid id) {
         if (JSID_IS_OBJECT(id))
             check(JSID_TO_OBJECT(id));
     }
     
     void check(JSIdArray *ida) {
         if (ida) {
-            for (jsint i = 0; i < ida->length; i++) {
+            for (int i = 0; i < ida->length; i++) {
                 if (JSID_IS_OBJECT(ida->vector[i]))
                     check(ida->vector[i]);
             }
         }
     }
 
     void check(JSScript *script) {
         if (script) {
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -391,17 +391,17 @@ JSCompartment::wrap(JSContext *cx, Prope
            (!(desc->attrs & JSPROP_SETTER) || wrap(cx, &desc->setter)) &&
            wrap(cx, &desc->value);
 }
 
 bool
 JSCompartment::wrap(JSContext *cx, AutoIdVector &props)
 {
     jsid *vector = props.begin();
-    jsint length = props.length();
+    int length = props.length();
     for (size_t n = 0; n < size_t(length); ++n) {
         if (!wrapId(cx, &vector[n]))
             return false;
     }
     return true;
 }
 
 /*
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -120,27 +120,27 @@ class MathCache;
  * A single-entry cache for some base-10 double-to-string conversions. This
  * helps date-format-xparb.js.  It also avoids skewing the results for
  * v8-splay.js when measured by the SunSpider harness, where the splay tree
  * initialization (which includes many repeated double-to-string conversions)
  * is erroneously included in the measurement; see bug 562553.
  */
 class DtoaCache {
     double        d;
-    jsint         base;
+    int         base;
     JSFixedString *s;      // if s==NULL, d and base are not valid
   public:
     DtoaCache() : s(NULL) {}
     void purge() { s = NULL; }
 
-    JSFixedString *lookup(jsint base, double d) {
+    JSFixedString *lookup(int base, double d) {
         return this->s && base == this->base && d == this->d ? this->s : NULL;
     }
 
-    void cache(jsint base, double d, JSFixedString *s) {
+    void cache(int base, double d, JSFixedString *s) {
         this->base = base;
         this->d = d;
         this->s = s;
     }
 
 };
 
 struct ScriptFilenameEntry
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -195,44 +195,44 @@ TimeWithinDay(double t)
     double result;
     result = fmod(t, msPerDay);
     if (result < 0)
         result += msPerDay;
     return result;
 }
 
 static inline bool
-IsLeapYear(jsint year)
+IsLeapYear(int year)
 {
     return year % 4 == 0 && (year % 100 || (year % 400 == 0));
 }
 
-static inline jsint
-DaysInYear(jsint year)
+static inline int
+DaysInYear(int year)
 {
     return IsLeapYear(year) ? 366 : 365;
 }
 
-static inline jsint
-DaysInFebruary(jsint year)
+static inline int
+DaysInFebruary(int year)
 {
     return IsLeapYear(year) ? 29 : 28;
 }
 
 /* math here has to be f.p, because we need
  *  floor((1968 - 1969) / 4) == -1
  */
 #define DayFromYear(y)  (365 * ((y)-1970) + floor(((y)-1969)/4.0)            \
                          - floor(((y)-1901)/100.0) + floor(((y)-1601)/400.0))
 #define TimeFromYear(y) (DayFromYear(y) * msPerDay)
 
-static jsint
+static int
 YearFromTime(double t)
 {
-    jsint y = (jsint) floor(t /(msPerDay*365.2425)) + 1970;
+    int y = (int) floor(t /(msPerDay*365.2425)) + 1970;
     double t2 = (double) TimeFromYear(y);
 
     /*
      * Adjust the year if the approximation was wrong.  Since the year was
      * computed using the average number of ms per year, it will usually
      * be wrong for dates within several hours of a year transition.
      */
     if (t2 > t) {
@@ -253,28 +253,28 @@ YearFromTime(double t)
 static double firstDayOfMonth[2][13] = {
     {0.0, 31.0, 59.0, 90.0, 120.0, 151.0, 181.0, 212.0, 243.0, 273.0, 304.0, 334.0, 365.0},
     {0.0, 31.0, 60.0, 91.0, 121.0, 152.0, 182.0, 213.0, 244.0, 274.0, 305.0, 335.0, 366.0}
 };
 
 #define DayFromMonth(m, leap) firstDayOfMonth[leap][(int)m]
 
 static int
-DaysInMonth(jsint year, jsint month)
+DaysInMonth(int year, int month)
 {
     JSBool leap = IsLeapYear(year);
     int result = int(DayFromMonth(month, leap) - DayFromMonth(month-1, leap));
     return result;
 }
 
 static int
 MonthFromTime(double t)
 {
     int d, step;
-    jsint year = YearFromTime(t);
+    int year = YearFromTime(t);
     d = DayWithinYear(t, year);
 
     if (d < (step = 31))
         return 0;
     if (d < (step += DaysInFebruary(year)))
         return 1;
     if (d < (step += 31))
         return 2;
@@ -296,17 +296,17 @@ MonthFromTime(double t)
         return 10;
     return 11;
 }
 
 static int
 DateFromTime(double t)
 {
     int d, step, next;
-    jsint year = YearFromTime(t);
+    int year = YearFromTime(t);
     d = DayWithinYear(t, year);
 
     if (d <= (next = 30))
         return d + 1;
     step = next;
     if (d <= (next += DaysInFebruary(year)))
         return d - step;
     step = next;
@@ -338,18 +338,18 @@ DateFromTime(double t)
         return d - step;
     step = next;
     return d - step;
 }
 
 static int
 WeekDay(double t)
 {
-    jsint result;
-    result = (jsint) Day(t) + 4;
+    int result;
+    result = (int) Day(t) + 4;
     result = result % 7;
     if (result < 0)
         result += 7;
     return (int) result;
 }
 
 #define MakeTime(hour, min, sec, ms) \
 ((((hour) * MinutesPerHour + (min)) * SecondsPerMinute + (sec)) * msPerSecond + (ms))
@@ -362,17 +362,17 @@ MakeDay(double year, double month, doubl
     double monthday;
 
     year += floor(month / 12);
 
     month = fmod(month, 12.0);
     if (month < 0)
         month += 12;
 
-    leap = IsLeapYear((jsint) year);
+    leap = IsLeapYear((int) year);
 
     yearday = floor(TimeFromYear(year) / msPerDay);
     monthday = DayFromMonth(month, leap);
 
     return yearday + monthday + date - 1;
 }
 
 #define MakeDate(day, time) ((day) * msPerDay + (time))
@@ -381,34 +381,34 @@ MakeDay(double year, double month, doubl
  * Years and leap years on which Jan 1 is a Sunday, Monday, etc.
  *
  * yearStartingWith[0][i] is an example non-leap year where
  * Jan 1 appears on Sunday (i == 0), Monday (i == 1), etc.
  *
  * yearStartingWith[1][i] is an example leap year where
  * Jan 1 appears on Sunday (i == 0), Monday (i == 1), etc.
  */
-static jsint yearStartingWith[2][7] = {
+static int yearStartingWith[2][7] = {
     {1978, 1973, 1974, 1975, 1981, 1971, 1977},
     {1984, 1996, 1980, 1992, 1976, 1988, 1972}
 };
 
 /*
  * Find a year for which any given date will fall on the same weekday.
  *
  * This function should be used with caution when used other than
  * for determining DST; it hasn't been proven not to produce an
  * incorrect year for times near year boundaries.
  */
-static jsint
-EquivalentYearForDST(jsint year)
+static int
+EquivalentYearForDST(int year)
 {
-    jsint day;
-
-    day = (jsint) DayFromYear(year) + 4;
+    int day;
+
+    day = (int) DayFromYear(year) + 4;
     day = day % 7;
     if (day < 0)
         day += 7;
 
     return yearStartingWith[IsLeapYear(year)][day];
 }
 
 /* LocalTZA gets set by js_InitDateClass() */
@@ -421,17 +421,17 @@ DaylightSavingTA(double t, JSContext *cx
     if (JSDOUBLE_IS_NaN(t))
         return t;
 
     /*
      * If earlier than 1970 or after 2038, potentially beyond the ken of
      * many OSes, map it to an equivalent year before asking.
      */
     if (t < 0.0 || t > 2145916800000.0) {
-        jsint year = EquivalentYearForDST(YearFromTime(t));
+        int year = EquivalentYearForDST(YearFromTime(t));
         double day = MakeDay(year, MonthFromTime(t), DateFromTime(t));
         t = MakeDate(day, TimeWithinDay(t));
     }
 
     int64_t timeMilliseconds = static_cast<int64_t>(t);
     int64_t offsetMilliseconds = cx->dstOffsetCache.getDSTOffsetMilliseconds(timeMilliseconds, cx);
     return static_cast<double>(offsetMilliseconds);
 }
@@ -1268,21 +1268,21 @@ FillLocalTimes(JSContext *cx, JSObject *
         }
         return true;
     }
 
     double localTime = LocalTime(utcTime, cx);
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_TIME, DoubleValue(localTime));
 
-    jsint year = (jsint) floor(localTime /(msPerDay*365.2425)) + 1970;
+    int year = (int) floor(localTime /(msPerDay*365.2425)) + 1970;
     double yearStartTime = (double) TimeFromYear(year);
 
     /* Adjust the year in case the approximation was wrong, as in YearFromTime. */
-    jsint yearDays;
+    int yearDays;
     if (yearStartTime > localTime) {
         year--;
         yearStartTime -= (msPerDay * DaysInYear(year));
         yearDays = DaysInYear(year);
     } else {
         yearDays = DaysInYear(year);
         double nextStart = yearStartTime + (msPerDay * yearDays);
         if (nextStart <= localTime) {
@@ -1290,22 +1290,22 @@ FillLocalTimes(JSContext *cx, JSObject *
             yearStartTime = nextStart;
             yearDays = DaysInYear(year);
         }
     }
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_YEAR, Int32Value(year));
 
     uint64_t yearTime = uint64_t(localTime - yearStartTime);
-    jsint yearSeconds = uint32_t(yearTime / 1000);
-
-    jsint day = yearSeconds / jsint(SecondsPerDay);
-
-    jsint step = -1, next = 30;
-    jsint month;
+    int yearSeconds = uint32_t(yearTime / 1000);
+
+    int day = yearSeconds / int(SecondsPerDay);
+
+    int step = -1, next = 30;
+    int month;
 
     do {
         if (day <= next) {
             month = 0;
             break;
         }
         step = next;
         next += ((yearDays == 366) ? 29 : 28);
@@ -1360,29 +1360,29 @@ FillLocalTimes(JSContext *cx, JSObject *
         }
         step = next;
         month = 11;
     } while (0);
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_MONTH, Int32Value(month));
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_DATE, Int32Value(day - step));
 
-    jsint weekday = WeekDay(localTime);
+    int weekday = WeekDay(localTime);
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_DAY, Int32Value(weekday));
 
-    jsint seconds = yearSeconds % 60;
+    int seconds = yearSeconds % 60;
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_SECONDS, Int32Value(seconds));
 
-    jsint minutes = (yearSeconds / 60) % 60;
+    int minutes = (yearSeconds / 60) % 60;
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_MINUTES, Int32Value(minutes));
 
-    jsint hours = (yearSeconds / (60 * 60)) % 24;
+    int hours = (yearSeconds / (60 * 60)) % 24;
 
     obj->setSlot(JSObject::JSSLOT_DATE_LOCAL_HOURS, Int32Value(hours));
 
     return true;
 }
 
 /* Cache the local times in obj, if necessary. */
 static inline bool
@@ -1436,17 +1436,17 @@ date_getYear(JSContext *cx, unsigned arg
         return ok;
 
     if (!GetAndCacheLocalTime(cx, obj))
         return false;
 
     Value yearVal = obj->getSlot(JSObject::JSSLOT_DATE_LOCAL_YEAR);
     if (yearVal.isInt32()) {
         /* Follow ECMA-262 to the letter, contrary to IE JScript. */
-        jsint year = yearVal.toInt32() - 1900;
+        int year = yearVal.toInt32() - 1900;
         args.rval().setInt32(year);
     } else {
         args.rval() = yearVal;
     }
 
     return true;
 }
 
@@ -2157,17 +2157,17 @@ date_toJSON(JSContext *cx, unsigned argc
     return true;
 }
 
 /* for Date.toLocaleString; interface to PRMJTime date struct.
  */
 static void
 new_explode(double timeval, PRMJTime *split, JSContext *cx)
 {
-    jsint year = YearFromTime(timeval);
+    int year = YearFromTime(timeval);
 
     split->tm_usec = int32_t(msFromTime(timeval)) * 1000;
     split->tm_sec = int8_t(SecFromTime(timeval));
     split->tm_min = int8_t(MinFromTime(timeval));
     split->tm_hour = int8_t(HourFromTime(timeval));
     split->tm_mday = int8_t(DateFromTime(timeval));
     split->tm_mon = int8_t(MonthFromTime(timeval));
     split->tm_wday = int8_t(WeekDay(timeval));
@@ -2196,17 +2196,17 @@ date_format(JSContext *cx, double date, 
 
     if (!JSDOUBLE_IS_FINITE(date)) {
         JS_snprintf(buf, sizeof buf, js_NaN_date_str);
     } else {
         double local = LocalTime(date, cx);
 
         /* offset from GMT in minutes.  The offset includes daylight savings,
            if it applies. */
-        jsint minutes = (jsint) floor(AdjustTime(date, cx) / msPerMinute);
+        int minutes = (int) floor(AdjustTime(date, cx) / msPerMinute);
 
         /* map 510 minutes to 0830 hours */
         int offset = (minutes / 60) * 100 + minutes % 60;
 
         /* print as "Wed Nov 05 19:38:03 GMT-0800 (PST) 1997" The TZA is
          * printed as 'GMT-0800' rather than as 'PST' to avoid
          * operating-system dependence on strftime (which
          * PRMJ_FormatTimeUSEnglish calls, for %Z only.)  win32 prints
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -897,17 +897,17 @@ js::ValueToId(JSContext *cx, const Value
     return js_ValueToStringId(cx, v, idp);
 }
 
 /*
  * Enter the new with scope using an object at sp[-1] and associate the depth
  * of the with block with sp + stackIndex.
  */
 static bool
-EnterWith(JSContext *cx, jsint stackIndex)
+EnterWith(JSContext *cx, int stackIndex)
 {
     StackFrame *fp = cx->fp();
     Value *sp = cx->regs().sp;
     JS_ASSERT(stackIndex < 0);
     JS_ASSERT(fp->base() <= sp + stackIndex);
 
     JSObject *obj;
     if (sp[-1].isObject()) {
@@ -1530,17 +1530,17 @@ js::Interpret(JSContext *cx, StackFrame 
 
     /*
      * It is important that "op" be initialized before calling DO_OP because
      * it is possible for "op" to be specially assigned during the normal
      * processing of an opcode while looping. We rely on DO_NEXT_OP to manage
      * "op" correctly in all other cases.
      */
     JSOp op;
-    jsint len;
+    int32_t len;
     len = 0;
 
     /* Check for too deep of a native thread stack. */
     JS_CHECK_RECURSION(cx, goto error);
 
     DO_NEXT_OP(len);
 
 #if JS_THREADED_INTERP
@@ -2891,67 +2891,67 @@ END_CASE(JSOP_TRUE)
 BEGIN_CASE(JSOP_TABLESWITCH)
 {
     jsbytecode *pc2 = regs.pc;
     len = GET_JUMP_OFFSET(pc2);
 
     /*
      * ECMAv2+ forbids conversion of discriminant, so we will skip to the
      * default case if the discriminant isn't already an int jsval.  (This
-     * opcode is emitted only for dense jsint-domain switches.)
+     * opcode is emitted only for dense int-domain switches.)
      */
     const Value &rref = *--regs.sp;
     int32_t i;
     if (rref.isInt32()) {
         i = rref.toInt32();
     } else {
         double d;
         /* Don't use JSDOUBLE_IS_INT32; treat -0 (double) as 0. */
         if (!rref.isDouble() || (d = rref.toDouble()) != (i = int32_t(rref.toDouble())))
             DO_NEXT_OP(len);
     }
 
     pc2 += JUMP_OFFSET_LEN;
-    jsint low = GET_JUMP_OFFSET(pc2);
+    int32_t low = GET_JUMP_OFFSET(pc2);
     pc2 += JUMP_OFFSET_LEN;
-    jsint high = GET_JUMP_OFFSET(pc2);
+    int32_t high = GET_JUMP_OFFSET(pc2);
 
     i -= low;
     if ((jsuint)i < (jsuint)(high - low + 1)) {
         pc2 += JUMP_OFFSET_LEN + JUMP_OFFSET_LEN * i;
-        jsint off = (jsint) GET_JUMP_OFFSET(pc2);
+        int32_t off = (int32_t) GET_JUMP_OFFSET(pc2);
         if (off)
             len = off;
     }
 }
 END_VARLEN_CASE
 }
 
 {
 BEGIN_CASE(JSOP_LOOKUPSWITCH)
 {
-    jsint off;
+    int32_t off;
     off = JUMP_OFFSET_LEN;
 
     /*
      * JSOP_LOOKUPSWITCH are never used if any atom index in it would exceed
      * 64K limit.
      */
     JS_ASSERT(atoms == script->atoms);
     jsbytecode *pc2 = regs.pc;
 
     Value lval = regs.sp[-1];
     regs.sp--;
 
+    int npairs;
     if (!lval.isPrimitive())
         goto end_lookup_switch;
 
     pc2 += off;
-    jsint npairs;
-    npairs = (jsint) GET_UINT16(pc2);
+    npairs = GET_UINT16(pc2);
     pc2 += UINT16_LEN;
     JS_ASSERT(npairs);  /* empty switch uses JSOP_TABLESWITCH */
 
     bool match;
 #define SEARCH_PAIRS(MATCH_CODE)                                              \
     for (;;) {                                                                \
         Value rval = script->getConst(GET_UINT32_INDEX(pc2));                 \
         MATCH_CODE                                                            \
@@ -3349,17 +3349,17 @@ BEGIN_CASE(JSOP_CALLEE)
 END_CASE(JSOP_CALLEE)
 
 BEGIN_CASE(JSOP_GETTER)
 BEGIN_CASE(JSOP_SETTER)
 {
     JSOp op2 = JSOp(*++regs.pc);
     jsid id;
     Value rval;
-    jsint i;
+    int i;
     JSObject *obj;
     switch (op2) {
       case JSOP_SETNAME:
       case JSOP_SETPROP:
       {
         PropertyName *name;
         LOAD_NAME(0, name);
         id = ATOM_TO_JSID(name);
@@ -3578,17 +3578,17 @@ BEGIN_CASE(JSOP_INITELEM)
     }
     regs.sp -= 2;
 }
 END_CASE(JSOP_INITELEM)
 
 {
 BEGIN_CASE(JSOP_GOSUB)
     PUSH_BOOLEAN(false);
-    jsint i = (regs.pc - script->code) + JSOP_GOSUB_LENGTH;
+    int32_t i = (regs.pc - script->code) + JSOP_GOSUB_LENGTH;
     len = GET_JUMP_OFFSET(regs.pc);
     PUSH_INT32(i);
 END_VARLEN_CASE
 }
 
 {
 BEGIN_CASE(JSOP_RETSUB)
     /* Pop [exception or hole, retsub pc-index]. */
--- a/js/src/jsinterpinlines.h
+++ b/js/src/jsinterpinlines.h
@@ -800,17 +800,17 @@ GetElementOperation(JSContext *cx, const
 static JS_ALWAYS_INLINE bool
 SetObjectElementOperation(JSContext *cx, JSObject *obj, jsid id, const Value &value, bool strict)
 {
     types::TypeScript::MonitorAssign(cx, obj, id);
 
     do {
         if (obj->isDenseArray() && JSID_IS_INT(id)) {
             jsuint length = obj->getDenseArrayInitializedLength();
-            jsint i = JSID_TO_INT(id);
+            int32_t i = JSID_TO_INT(id);
             if ((jsuint)i < length) {
                 if (obj->getDenseArrayElement(i).isMagic(JS_ARRAY_HOLE)) {
                     if (js_PrototypeHasIndexedProperties(cx, obj))
                         break;
                     if ((jsuint)i >= obj->getArrayLength())
                         obj->setArrayLength(cx, i + 1);
                 }
                 obj->setDenseArrayElementWithType(cx, i, value);
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -421,19 +421,19 @@ js::VectorToIdArray(JSContext *cx, AutoI
     JS_STATIC_ASSERT(sizeof(JSIdArray) > sizeof(jsid));
     size_t len = props.length();
     size_t idsz = len * sizeof(jsid);
     size_t sz = (sizeof(JSIdArray) - sizeof(jsid)) + idsz;
     JSIdArray *ida = static_cast<JSIdArray *>(cx->malloc_(sz));
     if (!ida)
         return false;
 
-    ida->length = static_cast<jsint>(len);
+    ida->length = static_cast<int>(len);
     jsid *v = props.begin();
-    for (jsint i = 0; i < ida->length; i++)
+    for (int i = 0; i < ida->length; i++)
         ida->vector[i].init(v[i]);
     *idap = ida;
     return true;
 }
 
 JS_FRIEND_API(bool)
 js::GetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, AutoIdVector *props)
 {
@@ -1269,17 +1269,17 @@ js_IteratorNext(JSContext *cx, JSObject 
             JS_ASSERT(ni->props_cursor < ni->props_end);
             *rval = StringValue(*ni->current());
             ni->incCursor();
 
             if (rval->isString())
                 return true;
 
             JSString *str;
-            jsint i;
+            int i;
             if (rval->isInt32() && StaticStrings::hasInt(i = rval->toInt32())) {
                 str = cx->runtime->staticStrings.getInt(i);
             } else {
                 str = ToString(cx, *rval);
                 if (!str)
                     return false;
             }
 
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -428,17 +428,17 @@ js_math_min(JSContext *cx, unsigned argc
             z = (x < z) ? x : z;
         }
     }
     vp->setNumber(z);
     return JS_TRUE;
 }
 
 static double
-powi(double x, jsint y)
+powi(double x, int y)
 {
     jsuint n = (y < 0) ? -y : y;
     double m = x;
     double p = 1;
     while (true) {
         if ((n & 1) != 0) p *= m;
         n >>= 1;
         if (n == 0) {
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -570,17 +570,17 @@ js_IntToString(JSContext *cx, int32_t si
     str->initAtOffsetInBuffer(start.get(), end - start);
 
     c->dtoaCache.cache(10, si, str);
     return str;
 }
 
 /* Returns a non-NULL pointer to inside cbuf.  */
 static char *
-IntToCString(ToCStringBuf *cbuf, jsint i, jsint base = 10)
+IntToCString(ToCStringBuf *cbuf, int i, int base = 10)
 {
     jsuint u = (i < 0) ? -i : i;
 
     RangedPtr<char> cp(cbuf->sbuf + cbuf->sbufSize - 1, cbuf->sbuf, cbuf->sbufSize);
     *cp = '\0';
 
     /* Build the string from behind. */
     switch (base) {
@@ -605,17 +605,17 @@ IntToCString(ToCStringBuf *cbuf, jsint i
     }
     if (i < 0)
         *--cp = '-';
 
     return cp.get();
 }
 
 static JSString * JS_FASTCALL
-js_NumberToStringWithBase(JSContext *cx, double d, jsint base);
+js_NumberToStringWithBase(JSContext *cx, double d, int base);
 
 static JS_ALWAYS_INLINE bool
 num_toStringHelper(JSContext *cx, Native native, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     double d;
     bool ok;
@@ -783,17 +783,17 @@ js_num_valueOf(JSContext *cx, unsigned a
     return true;
 }
 
 
 #define MAX_PRECISION 100
 
 static JSBool
 num_to(JSContext *cx, Native native, JSDToStrMode zeroArgMode, JSDToStrMode oneArgMode,
-       jsint precisionMin, jsint precisionMax, jsint precisionOffset,
+       int precisionMin, int precisionMax, int precisionOffset,
        CallArgs args)
 {
     /* Use MAX_PRECISION+1 because precisionOffset can be 1. */
     char buf[DTOSTR_VARIABLE_BUFFER_SIZE(MAX_PRECISION+1)];
     char *numStr;
 
     double d;
     bool ok;
@@ -804,25 +804,25 @@ num_to(JSContext *cx, Native native, JSD
     if (args.length() == 0) {
         precision = 0.0;
         oneArgMode = zeroArgMode;
     } else {
         if (!ToInteger(cx, args[0], &precision))
             return false;
         if (precision < precisionMin || precision > precisionMax) {
             ToCStringBuf cbuf;
-            numStr = IntToCString(&cbuf, jsint(precision));
+            numStr = IntToCString(&cbuf, int(precision));
             JS_ASSERT(numStr);
             JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_PRECISION_RANGE, numStr);
             return JS_FALSE;
         }
     }
 
     numStr = js_dtostr(cx->runtime->dtoaState, buf, sizeof buf,
-                       oneArgMode, (jsint)precision + precisionOffset, d);
+                       oneArgMode, (int)precision + precisionOffset, d);
     if (!numStr) {
         JS_ReportOutOfMemory(cx);
         return JS_FALSE;
     }
     JSString *str = js_NewStringCopyZ(cx, numStr);
     if (!str)
         return JS_FALSE;
     args.rval().setString(str);
@@ -1060,17 +1060,17 @@ namespace v8 {
 namespace internal {
 extern char* DoubleToCString(double v, char* buffer, int buflen);
 }
 }
 
 namespace js {
 
 static char *
-FracNumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, jsint base = 10)
+FracNumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, int base = 10)
 {
 #ifdef DEBUG
     {
         int32_t _;
         JS_ASSERT(!JSDOUBLE_IS_INT32(d, &_));
     }
 #endif
 
@@ -1092,28 +1092,28 @@ FracNumberToCString(JSContext *cx, ToCSt
                                DTOSTR_STANDARD, 0, d);
     } else {
         numStr = cbuf->dbuf = js_dtobasestr(cx->runtime->dtoaState, base, d);
     }
     return numStr;
 }
 
 char *
-NumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, jsint base/* = 10*/)
+NumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, int base/* = 10*/)
 {
     int32_t i;
     return (JSDOUBLE_IS_INT32(d, &i))
            ? IntToCString(cbuf, i, base)
            : FracNumberToCString(cx, cbuf, d, base);
 }
 
 }
 
 static JSString * JS_FASTCALL
-js_NumberToStringWithBase(JSContext *cx, double d, jsint base)
+js_NumberToStringWithBase(JSContext *cx, double d, int base)
 {
     ToCStringBuf cbuf;
     char *numStr;
 
     /*
      * Caller is responsible for error reporting. When called from trace,
      * returning NULL here will cause us to fall of trace and then retry
      * from the interpreter (which will report the error).
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -155,17 +155,17 @@ extern const char js_isNaN_str[];
 extern const char js_isFinite_str[];
 extern const char js_parseFloat_str[];
 extern const char js_parseInt_str[];
 
 class JSString;
 class JSFixedString;
 
 extern JSString * JS_FASTCALL
-js_IntToString(JSContext *cx, jsint i);
+js_IntToString(JSContext *cx, int i);
 
 /*
  * When base == 10, this function implements ToString() as specified by
  * ECMA-262-5 section 9.8.1; but note that it handles integers specially for
  * performance.  See also js::NumberToCString().
  */
 extern JSString * JS_FASTCALL
 js_NumberToString(JSContext *cx, double d);
@@ -208,17 +208,17 @@ struct ToCStringBuf
 
 /*
  * Convert a number to a C string.  When base==10, this function implements
  * ToString() as specified by ECMA-262-5 section 9.8.1.  It handles integral
  * values cheaply.  Return NULL if we ran out of memory.  See also
  * js_NumberToCString().
  */
 extern char *
-NumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, jsint base = 10);
+NumberToCString(JSContext *cx, ToCStringBuf *cbuf, double d, int base = 10);
 
 /*
  * The largest positive integer such that all positive integers less than it
  * may be precisely represented using the IEEE-754 double-precision format.
  */
 const double DOUBLE_INTEGRAL_PRECISION_LIMIT = uint64_t(1) << 53;
 
 /*
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -209,17 +209,17 @@ MarkSharpObjects(JSContext *cx, JSObject
         if (!map->table.put(obj, sharpid))
             return false;
 
         ida = JS_Enumerate(cx, obj);
         if (!ida)
             return false;
 
         bool ok = true;
-        for (jsint i = 0, length = ida->length; i < length; i++) {
+        for (int i = 0, length = ida->length; i < length; i++) {
             jsid id = ida->vector[i];
             JSObject *obj2;
             JSProperty *prop;
             ok = obj->lookupGeneric(cx, id, &obj2, &prop);
             if (!ok)
                 break;
             if (!prop)
                 continue;
@@ -481,17 +481,17 @@ obj_toSource(JSContext *cx, unsigned arg
 
     /*
      * We have four local roots for cooked and raw value GC safety.  Hoist the
      * "localroot + 2" out of the loop using the val local, which refers to
      * the raw (unconverted, "uncooked") values.
      */
     val = localroot + 2;
 
-    for (jsint i = 0; i < ida->length; i++) {
+    for (int i = 0; i < ida->length; i++) {
         /* Get strings for id and value and GC-root them via vp. */
         jsid id = ida->vector[i];
         JSLinearString *idstr;
 
         JSObject *obj2;
         JSProperty *prop;
         if (!obj->lookupGeneric(cx, id, &obj2, &prop))
             return false;
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -143,17 +143,17 @@ Dup(const char *chars, DupBuffer *cb)
 {
     return cb->append(chars, strlen(chars) + 1);
 }
 
 size_t
 js_GetVariableBytecodeLength(jsbytecode *pc)
 {
     unsigned ncases;
-    jsint low, high;
+    int32_t low, high;
 
     JSOp op = JSOp(*pc);
     JS_ASSERT(js_CodeSpec[op].length == -1);
     switch (op) {
       case JSOP_TABLESWITCH:
         /* Structure: default-jump case-low case-high case1-jump ... */
         pc += JUMP_OFFSET_LEN;
         low = GET_JUMP_OFFSET(pc);
@@ -581,17 +581,17 @@ js_Disassemble1(JSContext *cx, JSScript 
         if (!ToDisassemblySource(cx, ObjectValue(*obj), &bytes))
             return 0;
         Sprint(sp, " %s", bytes.ptr());
         break;
       }
 
       case JOF_TABLESWITCH:
       {
-        jsint i, low, high;
+        int32_t i, low, high;
 
         ptrdiff_t off = GET_JUMP_OFFSET(pc);
         jsbytecode *pc2 = pc + JUMP_OFFSET_LEN;
         low = GET_JUMP_OFFSET(pc2);
         pc2 += JUMP_OFFSET_LEN;
         high = GET_JUMP_OFFSET(pc2);
         pc2 += JUMP_OFFSET_LEN;
         Sprint(sp, " defaultOffset %d low %d high %d", int(off), low, high);
@@ -646,28 +646,28 @@ js_Disassemble1(JSContext *cx, JSScript 
         Sprint(sp, " %s", bytes.ptr());
         break;
       }
 
       {
         int i;
 
       case JOF_UINT16PAIR:
-        i = (jsint)GET_UINT16(pc);
+        i = (int)GET_UINT16(pc);
         Sprint(sp, " %d", i);
         pc += UINT16_LEN;
         /* FALL THROUGH */
 
       case JOF_UINT16:
-        i = (jsint)GET_UINT16(pc);
+        i = (int)GET_UINT16(pc);
         goto print_int;
 
       case JOF_UINT24:
         JS_ASSERT(op == JSOP_UINT24 || op == JSOP_NEWARRAY);
-        i = (jsint)GET_UINT24(pc);
+        i = (int)GET_UINT24(pc);
         goto print_int;
 
       case JOF_UINT8:
         i = GET_UINT8(pc);
         goto print_int;
 
       case JOF_INT8:
         i = GET_INT8(pc);
@@ -1553,17 +1553,17 @@ IsInitializerOp(unsigned char op)
 {
     return op == JSOP_NEWINIT || op == JSOP_NEWARRAY || op == JSOP_NEWOBJECT;
 }
 
 struct TableEntry {
     jsval       key;
     ptrdiff_t   offset;
     JSAtom      *label;
-    jsint       order;          /* source order for stable tableswitch sort */
+    int         order;          /* source order for stable tableswitch sort */
 };
 
 inline bool
 CompareTableEntries(const TableEntry &a, const TableEntry &b, bool *lessOrEqualp)
 {
     *lessOrEqualp = (a.offset != b.offset) ? a.offset <= b.offset : a.order <= b.order;
     return true;
 }
@@ -1761,17 +1761,17 @@ GetArgOrVarAtom(JSPrinter *jp, unsigned 
     LOCAL_ASSERT_RV(name, NULL);
 #endif
     return name;
 }
 
 #define LOCAL_ASSERT(expr)      LOCAL_ASSERT_RV(expr, "")
 
 static const char *
-GetLocalInSlot(SprintStack *ss, jsint i, jsint slot, JSObject *obj)
+GetLocalInSlot(SprintStack *ss, int i, int slot, JSObject *obj)
 {
     for (Shape::Range r(obj->lastProperty()); !r.empty(); r.popFront()) {
         const Shape &shape = r.front();
 
         if (shape.shortid() == slot) {
             /* Ignore the empty destructuring dummy. */
             if (!JSID_IS_ATOM(shape.propid()))
                 continue;
@@ -1785,17 +1785,17 @@ GetLocalInSlot(SprintStack *ss, jsint i,
             return rval;
         }
     }
 
     return GetStr(ss, i);
 }
 
 const char *
-GetLocal(SprintStack *ss, jsint i)
+GetLocal(SprintStack *ss, int i)
 {
     ptrdiff_t off = ss->offsets[i];
     if (off >= 0)
         return ss->sprinter.stringAt(off);
 
     /*
      * We must be called from js_DecompileValueGenerator (via Decompile) when
      * dereferencing a local that's undefined or null. Search script->objects
@@ -1821,40 +1821,40 @@ GetLocal(SprintStack *ss, jsint i)
 
         if (JSOP_ENTERBLOCK == (JSOp)*pc) {
             JSObject *obj = script->getObject(GET_UINT32_INDEX(pc));
 
             if (obj->isBlock()) {
                 uint32_t depth = obj->asBlock().stackDepth();
                 uint32_t count = obj->asBlock().slotCount();
                 if (jsuint(i - depth) < jsuint(count))
-                    return GetLocalInSlot(ss, i, jsint(i - depth), obj);
+                    return GetLocalInSlot(ss, i, int(i - depth), obj);
             }
         }
     }
 
     // Iterate over all objects.
     for (jsatomid j = 0, n = script->objects()->length; j != n; j++) {
         JSObject *obj = script->getObject(j);
 
         if (obj->isBlock()) {
             uint32_t depth = obj->asBlock().stackDepth();
             uint32_t count = obj->asBlock().slotCount();
             if (jsuint(i - depth) < jsuint(count))
-                return GetLocalInSlot(ss, i, jsint(i - depth), obj);
+                return GetLocalInSlot(ss, i, int(i - depth), obj);
         }
     }
 
     return GetStr(ss, i);
 }
 
 #undef LOCAL_ASSERT
 
 static JSBool
-IsVarSlot(JSPrinter *jp, jsbytecode *pc, jsint *indexp)
+IsVarSlot(JSPrinter *jp, jsbytecode *pc, int *indexp)
 {
     unsigned slot;
 
     slot = GET_SLOTNO(pc);
     if (slot < jp->script->nfixed) {
         /* The slot refers to a variable with name stored in jp->localNames. */
         *indexp = jp->fun->nargs + slot;
         return JS_TRUE;
@@ -1895,17 +1895,17 @@ DecompileDestructuring(SprintStack *ss, 
 static jsbytecode *
 DecompileDestructuringLHS(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc, JSBool *hole,
                           AtomRange *letNames = NULL)
 {
     JSPrinter *jp;
     JSOp op;
     const JSCodeSpec *cs;
     unsigned oplen;
-    jsint i;
+    int i;
     const char *lval, *xval;
     JSAtom *atom;
 
     *hole = JS_FALSE;
     jp = ss->printer;
     LOAD_OP_DATA(pc);
 
     switch (op) {
@@ -2112,17 +2112,17 @@ DecompileDestructuring(SprintStack *ss, 
           case JSOP_UINT16: d = i = GET_UINT16(pc); goto do_getelem;
           case JSOP_UINT24: d = i = GET_UINT24(pc); goto do_getelem;
           case JSOP_INT8:   d = i = GET_INT8(pc);   goto do_getelem;
           case JSOP_INT32:  d = i = GET_INT32(pc);  goto do_getelem;
 
           case JSOP_DOUBLE:
             d = jp->script->getConst(GET_UINT32_INDEX(pc)).toDouble();
             LOCAL_ASSERT(JSDOUBLE_IS_FINITE(d) && !JSDOUBLE_IS_NEGZERO(d));
-            i = (jsint)d;
+            i = (int)d;
 
           do_getelem:
           {
             jssrcnote *sn = js_GetSrcNote(jp->script, pc);
             pc += oplen;
             if (pc == endpc)
                 return pc;
             LOAD_OP_DATA(pc);
@@ -2556,17 +2556,17 @@ Decompile(SprintStack *ss, jsbytecode *p
     JSPrinter *jp, *jp2;
     jsbytecode *startpc, *endpc, *pc2, *done, *lvalpc, *rvalpc, *xvalpc;
     ptrdiff_t tail, todo, len, oplen, cond, next;
     JSOp op, lastop, saveop;
     const JSCodeSpec *cs;
     jssrcnote *sn, *sn2;
     const char *lval, *rval, *xval, *fmt, *token;
     unsigned nuses;
-    jsint i, argc;
+    int i, argc;
     JSAtom *atom;
     JSObject *obj;
     JSFunction *fun = NULL; /* init to shut GCC up */
     JSString *str;
     JSBool ok;
 #if JS_HAS_XML_SUPPORT
     JSBool foreach, inXML, quoteAttr;
 #else
@@ -4676,21 +4676,21 @@ Decompile(SprintStack *ss, jsbytecode *p
                 if (!rval)
                     return NULL;
                 ss->sprinter.setOffset(rval);
                 todo = Sprint(&ss->sprinter, sss_format,
                               VarPrefix(sn), lval, rval);
                 break;
 
               case JSOP_UINT16:
-                i = (jsint) GET_UINT16(pc);
+                i = (int) GET_UINT16(pc);
                 goto do_sprint_int;
 
               case JSOP_UINT24:
-                i = (jsint) GET_UINT24(pc);
+                i = (int) GET_UINT24(pc);
                 goto do_sprint_int;
 
               case JSOP_INT8:
                 i = GET_INT8(pc);
                 goto do_sprint_int;
 
               case JSOP_INT32:
                 i = GET_INT32(pc);
@@ -4888,17 +4888,17 @@ Decompile(SprintStack *ss, jsbytecode *p
                 str = obj->asRegExp().toString(cx);
                 if (!str)
                     return NULL;
                 goto sprint_string;
 
               case JSOP_TABLESWITCH:
               {
                 ptrdiff_t off, off2;
-                jsint j, n, low, high;
+                int32_t j, n, low, high;
                 TableEntry *table, *tmp;
 
                 sn = js_GetSrcNote(jp->script, pc);
                 LOCAL_ASSERT(sn && SN_TYPE(sn) == SRC_SWITCH);
                 len = js_GetSrcNoteOffset(sn, 0);
                 off = GET_JUMP_OFFSET(pc);
                 pc2 = pc + JUMP_OFFSET_LEN;
                 low = GET_JUMP_OFFSET(pc2);
@@ -4993,17 +4993,17 @@ Decompile(SprintStack *ss, jsbytecode *p
                     return NULL;
                 todo = -2;
                 break;
               }
 
               case JSOP_CONDSWITCH:
               {
                 ptrdiff_t off, off2, caseOff;
-                jsint ncases;
+                int ncases;
                 TableEntry *table;
 
                 sn = js_GetSrcNote(jp->script, pc);
                 LOCAL_ASSERT(sn && SN_TYPE(sn) == SRC_SWITCH);
                 len = js_GetSrcNoteOffset(sn, 0);
                 off = js_GetSrcNoteOffset(sn, 1);
 
                 /*
@@ -5035,17 +5035,17 @@ Decompile(SprintStack *ss, jsbytecode *p
                 if (!table)
                     return NULL;
                 pc2 = pc;
                 off2 = off;
                 for (i = 0; i < ncases; i++) {
                     pc2 += off2;
                     LOCAL_ASSERT(*pc2 == JSOP_CASE || *pc2 == JSOP_DEFAULT);
                     caseOff = pc2 - pc;
-                    table[i].key = INT_TO_JSVAL((jsint) caseOff);
+                    table[i].key = INT_TO_JSVAL((int32_t) caseOff);
                     table[i].offset = caseOff + GET_JUMP_OFFSET(pc2);
                     if (*pc2 == JSOP_CASE) {
                         sn = js_GetSrcNote(jp->script, pc2);
                         LOCAL_ASSERT(sn && SN_TYPE(sn) == SRC_PCDELTA);
                         off2 = js_GetSrcNoteOffset(sn, 0);
                     }
                 }
 
--- a/js/src/jsopcode.h
+++ b/js/src/jsopcode.h
@@ -211,22 +211,22 @@ SET_UINT32_INDEX(jsbytecode *pc, uint32_
 #define UINT24_LO(i)            ((jsbytecode)(i))
 #define GET_UINT24(pc)          ((jsatomid)(((pc)[1] << 16) |                 \
                                             ((pc)[2] << 8) |                  \
                                             (pc)[3]))
 #define SET_UINT24(pc,i)        ((pc)[1] = UINT24_HI(i),                      \
                                  (pc)[2] = UINT24_MID(i),                     \
                                  (pc)[3] = UINT24_LO(i))
 
-#define GET_INT8(pc)            ((jsint)int8_t((pc)[1]))
+#define GET_INT8(pc)            (int8_t((pc)[1]))
 
-#define GET_INT32(pc)           ((jsint)((uint32_t((pc)[1]) << 24) |          \
-                                         (uint32_t((pc)[2]) << 16) |          \
-                                         (uint32_t((pc)[3]) << 8)  |          \
-                                         uint32_t((pc)[4])))
+#define GET_INT32(pc)           (((uint32_t((pc)[1]) << 24) |                 \
+                                  (uint32_t((pc)[2]) << 16) |                 \
+                                  (uint32_t((pc)[3]) << 8)  |                 \
+                                  uint32_t((pc)[4])))
 #define SET_INT32(pc,i)         ((pc)[1] = (jsbytecode)(uint32_t(i) >> 24),   \
                                  (pc)[2] = (jsbytecode)(uint32_t(i) >> 16),   \
                                  (pc)[3] = (jsbytecode)(uint32_t(i) >> 8),    \
                                  (pc)[4] = (jsbytecode)uint32_t(i))
 
 /* Index limit is determined by SN_3BYTE_OFFSET_FLAG, see frontend/BytecodeEmitter.h. */
 #define INDEX_LIMIT_LOG2        23
 #define INDEX_LIMIT             (uint32_t(1) << INDEX_LIMIT_LOG2)
--- a/js/src/jspubtd.h
+++ b/js/src/jspubtd.h
@@ -89,17 +89,16 @@ typedef ptrdiff_t jsid;
 #else  /* defined(__cplusplus) */
 typedef ptrdiff_t jsid;
 # define JSID_BITS(id) (id)
 #endif
 
 JS_BEGIN_EXTERN_C
 
 /* Scalar typedefs. */
-typedef int32_t   jsint;
 typedef uint32_t  jsuint;
 
 #ifdef WIN32
 typedef wchar_t   jschar;
 #else
 typedef uint16_t  jschar;
 #endif
 
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -419,17 +419,17 @@ static JSBool
 str_resolve(JSContext *cx, JSObject *obj, jsid id, unsigned flags,
             JSObject **objp)
 {
     if (!JSID_IS_INT(id))
         return JS_TRUE;
 
     JSString *str = obj->asString().unbox();
 
-    jsint slot = JSID_TO_INT(id);
+    int32_t slot = JSID_TO_INT(id);
     if ((size_t)slot < str->length()) {
         JSString *str1 = cx->runtime->staticStrings.getUnitStringForElement(cx, str, size_t(slot));
         if (!str1)
             return JS_FALSE;
         if (!obj->defineElement(cx, uint32_t(slot), StringValue(str1), NULL, NULL,
                                 STRING_ELEMENT_ATTRS)) {
             return JS_FALSE;
         }
@@ -872,19 +872,19 @@ out_of_range:
 /*
  * Boyer-Moore-Horspool superlinear search for pat:patlen in text:textlen.
  * The patlen argument must be positive and no greater than sBMHPatLenMax.
  *
  * Return the index of pat in text, or -1 if not found.
  */
 static const jsuint sBMHCharSetSize = 256; /* ISO-Latin-1 */
 static const jsuint sBMHPatLenMax   = 255; /* skip table element is uint8_t */
-static const jsint  sBMHBadPattern  = -2;  /* return value if pat is not ISO-Latin-1 */
-
-jsint
+static const int  sBMHBadPattern  = -2;  /* return value if pat is not ISO-Latin-1 */
+
+int
 js_BoyerMooreHorspool(const jschar *text, jsuint textlen,
                       const jschar *pat, jsuint patlen)
 {
     uint8_t skip[sBMHCharSetSize];
 
     JS_ASSERT(0 < patlen && patlen <= sBMHPatLenMax);
     for (jsuint i = 0; i < sBMHCharSetSize; i++)
         skip[i] = (uint8_t)patlen;
@@ -898,17 +898,17 @@ js_BoyerMooreHorspool(const jschar *text
     jschar c;
     for (jsuint k = m;
          k < textlen;
          k += ((c = text[k]) >= sBMHCharSetSize) ? patlen : skip[c]) {
         for (jsuint i = k, j = m; ; i--, j--) {
             if (text[i] != pat[j])
                 break;
             if (j == 0)
-                return static_cast<jsint>(i);  /* safe: max string size */
+                return static_cast<int>(i);  /* safe: max string size */
         }
     }
     return -1;
 }
 
 struct MemCmp {
     typedef jsuint Extent;
     static JS_ALWAYS_INLINE Extent computeExtent(const jschar *, jsuint patlen) {
@@ -929,17 +929,17 @@ struct ManualCmp {
             if (*p != *t)
                 return false;
         }
         return true;
     }
 };
 
 template <class InnerMatch>
-static jsint
+static int
 UnrolledMatch(const jschar *text, jsuint textlen, const jschar *pat, jsuint patlen)
 {
     JS_ASSERT(patlen > 0 && textlen > 0);
     const jschar *textend = text + textlen - (patlen - 1);
     const jschar p0 = *pat;
     const jschar *const patNext = pat + 1;
     const typename InnerMatch::Extent extent = InnerMatch::computeExtent(pat, patlen);
     uint8_t fixup;
@@ -974,17 +974,17 @@ UnrolledMatch(const jschar *text, jsuint
                 return t - text - 1;
             }
           failed_match:;
         } while (--fixup > 0);
     }
     return -1;
 }
 
-static JS_ALWAYS_INLINE jsint
+static JS_ALWAYS_INLINE int
 StringMatch(const jschar *text, jsuint textlen,
             const jschar *pat, jsuint patlen)
 {
     if (patlen == 0)
         return 0;
     if (textlen < patlen)
         return -1;
 
@@ -1012,17 +1012,17 @@ StringMatch(const jschar *text, jsuint t
      *    proportionally small, so the worst-case slowdown is minimized.
      *  - When |patlen| is "too small", even the best case for BMH will be
      *    slower than a simple scan for large |textlen| due to the more complex
      *    loop body of BMH.
      * From this, the values for "big enough" and "too small" are determined
      * empirically. See bug 526348.
      */
     if (textlen >= 512 && patlen >= 11 && patlen <= sBMHPatLenMax) {
-        jsint index = js_BoyerMooreHorspool(text, textlen, pat, patlen);
+        int index = js_BoyerMooreHorspool(text, textlen, pat, patlen);
         if (index != sBMHBadPattern)
             return index;
     }
 
     /*
      * For big patterns with large potential overlap we want the SIMD-optimized
      * speed of memcmp. For small patterns, a simple loop is faster.
      *
@@ -1039,17 +1039,17 @@ StringMatch(const jschar *text, jsuint t
 static const size_t sRopeMatchThresholdRatioLog2 = 5;
 
 /*
  * RopeMatch takes the text to search, the patern to search for in the text.
  * RopeMatch returns false on OOM and otherwise returns the match index through
  * the 'match' outparam (-1 for not found).
  */
 static bool
-RopeMatch(JSContext *cx, JSString *textstr, const jschar *pat, jsuint patlen, jsint *match)
+RopeMatch(JSContext *cx, JSString *textstr, const jschar *pat, jsuint patlen, int *match)
 {
     JS_ASSERT(textstr->isRope());
 
     if (patlen == 0) {
         *match = 0;
         return true;
     }
     if (textstr->length() < patlen) {
@@ -1085,24 +1085,24 @@ RopeMatch(JSContext *cx, JSString *texts
                 return true;
             }
             if (!r.popFront())
                 return false;
         }
     }
 
     /* Absolute offset from the beginning of the logical string textstr. */
-    jsint pos = 0;
+    int pos = 0;
 
     for (JSLinearString **outerp = strs.begin(); outerp != strs.end(); ++outerp) {
         /* Try to find a match within 'outer'. */
         JSLinearString *outer = *outerp;
         const jschar *chars = outer->chars();
         size_t len = outer->length();
-        jsint matchResult = StringMatch(chars, len, pat, patlen);
+        int matchResult = StringMatch(chars, len, pat, patlen);
         if (matchResult != -1) {
             /* Matched! */
             *match = pos + matchResult;
             return true;
         }
 
         /* Try to find a match starting in 'outer' and running into other nodes. */
         const jschar *const text = chars + (patlen > len ? 0 : len - patlen + 1);
@@ -1161,17 +1161,17 @@ str_indexOf(JSContext *cx, unsigned argc
         return false;
 
     jsuint patlen = patstr->length();
     const jschar *pat = patstr->chars();
 
     jsuint start;
     if (args.length() > 1) {
         if (args[1].isInt32()) {
-            jsint i = args[1].toInt32();
+            int i = args[1].toInt32();
             if (i <= 0) {
                 start = 0;
             } else if (jsuint(i) > textlen) {
                 start = textlen;
                 textlen = 0;
             } else {
                 start = i;
                 text += start;
@@ -1182,26 +1182,26 @@ str_indexOf(JSContext *cx, unsigned argc
             if (!ToInteger(cx, args[1], &d))
                 return false;
             if (d <= 0) {
                 start = 0;
             } else if (d > textlen) {
                 start = textlen;
                 textlen = 0;
             } else {
-                start = (jsint)d;
+                start = (int)d;
                 text += start;
                 textlen -= start;
             }
         }
     } else {
         start = 0;
     }
 
-    jsint match = StringMatch(text, textlen, pat, patlen);
+    int match = StringMatch(text, textlen, pat, patlen);
     args.rval() = Int32Value((match == -1) ? -1 : start + match);
     return true;
 }
 
 static JSBool
 str_lastIndexOf(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -1216,39 +1216,39 @@ str_lastIndexOf(JSContext *cx, unsigned 
 
     JSLinearString *patstr = ArgToRootedString(cx, args, 0);
     if (!patstr)
         return false;
 
     size_t patlen = patstr->length();
     const jschar *pat = patstr->chars();
 
-    jsint i = textlen - patlen; // Start searching here
+    int i = textlen - patlen; // Start searching here
     if (i < 0) {
         args.rval() = Int32Value(-1);
         return true;
     }
 
     if (args.length() > 1) {
         if (args[1].isInt32()) {
-            jsint j = args[1].toInt32();
+            int j = args[1].toInt32();
             if (j <= 0)
                 i = 0;
             else if (j < i)
                 i = j;
         } else {
             double d;
             if (!ToNumber(cx, args[1], &d))
                 return false;
             if (!JSDOUBLE_IS_NaN(d)) {
                 d = js_DoubleToInteger(d);
                 if (d <= 0)
                     i = 0;
                 else if (d < i)
-                    i = (jsint)d;
+                    i = (int)d;
             }
         }
     }
 
     if (patlen == 0) {
         args.rval() = Int32Value(i);
         return true;
     }
@@ -1712,17 +1712,17 @@ struct ReplaceData
 
     JSString           *str;           /* 'this' parameter object as a string */
     StringRegExpGuard  g;              /* regexp parameter object and private data */
     JSObject           *lambda;        /* replacement function object or null */
     JSObject           *elembase;      /* object for function(a){return b[a]} replace */
     JSLinearString     *repstr;        /* replacement string */
     const jschar       *dollar;        /* null or pointer to first $ in repstr */
     const jschar       *dollarEnd;     /* limit pointer for js_strchr_limit */
-    jsint              leftIndex;      /* left context index in str->chars */
+    int                leftIndex;      /* left context index in str->chars */
     JSSubString        dollarStr;      /* for "$$" InterpretDollar result */
     bool               calledBack;     /* record whether callback has been called */
     InvokeArgsGuard    args;           /* arguments for lambda call */
     StringBuffer       sb;             /* buffer built during DoMatch */
 };
 
 static bool
 InterpretDollar(JSContext *cx, RegExpStatics *res, const jschar *dp, const jschar *ep,
@@ -2523,17 +2523,17 @@ class SplitStringMatcher
     }
 
     static const bool returnsCaptures = false;
 
     bool operator()(JSContext *cx, JSLinearString *str, size_t index, SplitMatchResult *res)
     {
         JS_ASSERT(index == 0 || index < str->length());
         const jschar *chars = str->chars();
-        jsint match = StringMatch(chars + index, str->length() - index, sepChars, sepLength);
+        int match = StringMatch(chars + index, str->length() - index, sepChars, sepLength);
         if (match == -1)
             res->setFailure();
         else
             res->setResult(sepLength, index + match + sepLength);
         return true;
     }
 };
 
--- a/js/src/jsstrinlines.h
+++ b/js/src/jsstrinlines.h
@@ -112,17 +112,17 @@ class StringBuffer
     static JSAtom *atomize(JSContext *cx, const jschar *begin, size_t length, unsigned flags = 0);
 
     void replaceRawBuffer(jschar *chars, size_t len) { cb.replaceRawBuffer(chars, len); }
     jschar *begin() { return cb.begin(); }
     jschar *end() { return cb.end(); }
     const jschar *begin() const { return cb.begin(); }
     const jschar *end() const { return cb.end(); }
     bool empty() const { return cb.empty(); }
-    inline jsint length() const;
+    inline int length() const;
 
     /*
      * Creates a string from the characters in this buffer, then (regardless
      * whether string creation succeeded or failed) empties the buffer.
      */
     JSFixedString *finishString();
 
     /* Identical to finishString() except that an atom is created. */
@@ -211,22 +211,22 @@ StringBuffer::appendInflated(const char 
         return false;
     DebugOnly<size_t> oldcstrlen = cstrlen;
     DebugOnly<bool> ok = InflateStringToBuffer(context(), cstr, cstrlen,
                                                begin() + lengthBefore, &cstrlen);
     JS_ASSERT(ok && oldcstrlen == cstrlen);
     return true;
 }
 
-inline jsint
+inline int
 StringBuffer::length() const
 {
-    JS_STATIC_ASSERT(jsint(JSString::MAX_LENGTH) == JSString::MAX_LENGTH);
+    JS_STATIC_ASSERT(int(JSString::MAX_LENGTH) == JSString::MAX_LENGTH);
     JS_ASSERT(cb.length() <= JSString::MAX_LENGTH);
-    return jsint(cb.length());
+    return int(cb.length());
 }
 
 inline bool
 StringBuffer::checkLength(size_t length)
 {
     return JSString::validateLength(context(), length);
 }
 
--- a/js/src/jstypedarray.cpp
+++ b/js/src/jstypedarray.cpp
@@ -151,17 +151,17 @@ ArrayBuffer::getArrayBuffer(JSObject *ob
 JSBool
 ArrayBuffer::prop_getByteLength(JSContext *cx, JSObject *obj, jsid id, Value *vp)
 {
     JSObject *arrayBuffer = getArrayBuffer(obj);
     if (!arrayBuffer) {
         vp->setInt32(0);
         return true;
     }
-    vp->setInt32(jsint(arrayBuffer->arrayBufferByteLength()));
+    vp->setInt32(int32_t(arrayBuffer->arrayBufferByteLength()));
     return true;
 }
 
 JSBool
 ArrayBuffer::fun_slice(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
@@ -2537,17 +2537,17 @@ js_CreateArrayBuffer(JSContext *cx, jsui
 
 JS_FRIEND_API(JSObject *)
 JS_NewArrayBuffer(JSContext *cx, jsuint nbytes)
 {
     return js_CreateArrayBuffer(cx, nbytes);
 }
 
 static inline JSObject *
-TypedArrayConstruct(JSContext *cx, jsint atype, unsigned argc, Value *argv)
+TypedArrayConstruct(JSContext *cx, int atype, unsigned argc, Value *argv)
 {
     switch (atype) {
       case TypedArray::TYPE_INT8:
         return Int8Array::create(cx, argc, argv);
 
       case TypedArray::TYPE_UINT8:
         return Uint8Array::create(cx, argc, argv);
 
@@ -2574,36 +2574,36 @@ TypedArrayConstruct(JSContext *cx, jsint
 
       default:
         JS_NOT_REACHED("shouldn't have gotten here");
         return NULL;
     }
 }
 
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArray(JSContext *cx, jsint atype, jsuint nelements)
+js_CreateTypedArray(JSContext *cx, int atype, jsuint nelements)
 {
     JS_ASSERT(atype >= 0 && atype < TypedArray::TYPE_MAX);
 
     Value nelems = Int32Value(nelements);
     return TypedArrayConstruct(cx, atype, 1, &nelems);
 }
 
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArrayWithArray(JSContext *cx, jsint atype, JSObject *arrayArg)
+js_CreateTypedArrayWithArray(JSContext *cx, int atype, JSObject *arrayArg)
 {
     JS_ASSERT(atype >= 0 && atype < TypedArray::TYPE_MAX);
 
     Value arrval = ObjectValue(*arrayArg);
     return TypedArrayConstruct(cx, atype, 1, &arrval);
 }
 
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArrayWithBuffer(JSContext *cx, jsint atype, JSObject *bufArg,
-                              jsint byteoffset, jsint length)
+js_CreateTypedArrayWithBuffer(JSContext *cx, int atype, JSObject *bufArg,
+                              int byteoffset, int length)
 {
     JS_ASSERT(atype >= 0 && atype < TypedArray::TYPE_MAX);
     JS_ASSERT(bufArg && js_IsArrayBuffer(bufArg));
     JS_ASSERT_IF(byteoffset < 0, length < 0);
 
     Value vals[4];
 
     int argc = 1;
--- a/js/src/jstypedarray.h
+++ b/js/src/jstypedarray.h
@@ -302,36 +302,36 @@ js_IsArrayBuffer(JSObject *obj);
 JS_FRIEND_API(JSObject *)
 js_CreateArrayBuffer(JSContext *cx, uint32_t nbytes);
 
 /*
  * Create a new typed array of type atype (one of the TypedArray
  * enumerant values above), with nelements elements.
  */
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArray(JSContext *cx, jsint atype, uint32_t nelements);
+js_CreateTypedArray(JSContext *cx, int atype, uint32_t nelements);
 
 /*
  * Create a new typed array of type atype (one of the TypedArray
  * enumerant values above), and copy in values from the given JSObject,
  * which must either be a typed array or an array-like object.
  */
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArrayWithArray(JSContext *cx, jsint atype, JSObject *arrayArg);
+js_CreateTypedArrayWithArray(JSContext *cx, int atype, JSObject *arrayArg);
 
 /*
  * Create a new typed array of type atype (one of the TypedArray
  * enumerant values above), using a given ArrayBuffer for storage.
  * The byteoffset and length values are optional; if -1 is passed, an
  * offset of 0 and enough elements to use up the remainder of the byte
  * array are used as the default values.
  */
 JS_FRIEND_API(JSObject *)
-js_CreateTypedArrayWithBuffer(JSContext *cx, jsint atype, JSObject *bufArg,
-                              jsint byteoffset, jsint length);
+js_CreateTypedArrayWithBuffer(JSContext *cx, int atype, JSObject *bufArg,
+                              int byteoffset, int length);
 
 extern int32_t JS_FASTCALL
 js_TypedArray_uint8_clamp_double(const double x);
 
 JS_FRIEND_API(JSBool)
 JS_IsArrayBufferObject(JSObject *obj);
 
 JS_FRIEND_API(JSObject *)
--- a/js/src/jsxml.cpp
+++ b/js/src/jsxml.cpp
@@ -4663,18 +4663,17 @@ HasFunctionProperty(JSContext *cx, JSObj
     *found = (prop != NULL);
     return true;
 }
 
 static bool
 IdValIsIndex(JSContext *cx, jsval id, jsuint *indexp, bool *isIndex)
 {
     if (JSVAL_IS_INT(id)) {
-        jsint i;
-        i = JSVAL_TO_INT(id);
+        int32_t i = JSVAL_TO_INT(id);
         if (i < 0) {
             *isIndex = false;
             return true;
         }
         *indexp = (jsuint)i;
         *isIndex = true;
         return true;
     }
@@ -5597,17 +5596,17 @@ xml_list_helper(JSContext *cx, JSXML *xm
     list->xml_target = xml;
     return list;
 }
 
 static JSBool
 ValueToId(JSContext *cx, jsval v, AutoIdRooter *idr)
 {
     if (JSVAL_IS_INT(v)) {
-        jsint i = JSVAL_TO_INT(v);
+        int32_t i = JSVAL_TO_INT(v);
         if (INT_FITS_IN_JSID(i))
             *idr->addr() = INT_TO_JSID(i);
         else if (!js_ValueToStringId(cx, v, idr->addr()))
             return JS_FALSE;
     } else if (JSVAL_IS_STRING(v)) {
         JSAtom *atom = js_AtomizeString(cx, JSVAL_TO_STRING(v));
         if (!atom)
             return JS_FALSE;
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -729,28 +729,28 @@ MakeJITScript(JSContext *cx, JSScript *s
                         return NULL;
                 }
             }
 
             if (op == JSOP_TABLESWITCH) {
                 jsbytecode *pc2 = pc;
                 unsigned defaultOffset = offset + GET_JUMP_OFFSET(pc);
                 pc2 += JUMP_OFFSET_LEN;
-                jsint low = GET_JUMP_OFFSET(pc2);
+                int32_t low = GET_JUMP_OFFSET(pc2);
                 pc2 += JUMP_OFFSET_LEN;
-                jsint high = GET_JUMP_OFFSET(pc2);
+                int32_t high = GET_JUMP_OFFSET(pc2);
                 pc2 += JUMP_OFFSET_LEN;
 
                 CrossChunkEdge edge;
                 edge.source = offset;
                 edge.target = defaultOffset;
                 if (!currentEdges.append(edge))
                     return NULL;
 
-                for (jsint i = low; i <= high; i++) {
+                for (int32_t i = low; i <= high; i++) {
                     unsigned targetOffset = offset + GET_JUMP_OFFSET(pc2);
                     if (targetOffset != offset) {
                         /*
                          * This can end up inserting duplicate edges, all but
                          * the first of which will be ignored.
                          */
                         CrossChunkEdge edge;
                         edge.source = offset;
@@ -7342,19 +7342,19 @@ mjit::Compiler::jsop_tableswitch(jsbytec
 #else
     jsbytecode *originalPC = pc;
     DebugOnly<JSOp> op = JSOp(*originalPC);
     JS_ASSERT(op == JSOP_TABLESWITCH);
 
     uint32_t defaultTarget = GET_JUMP_OFFSET(pc);
     pc += JUMP_OFFSET_LEN;
 
-    jsint low = GET_JUMP_OFFSET(pc);
+    int32_t low = GET_JUMP_OFFSET(pc);
     pc += JUMP_OFFSET_LEN;
-    jsint high = GET_JUMP_OFFSET(pc);
+    int32_t high = GET_JUMP_OFFSET(pc);
     pc += JUMP_OFFSET_LEN;
     int numJumps = high + 1 - low;
     JS_ASSERT(numJumps >= 0);
 
     FrameEntry *fe = frame.peek(-1);
     if (fe->isNotType(JSVAL_TYPE_INT32) || numJumps > 256) {
         frame.syncAndForgetEverything();
         masm.move(ImmPtr(originalPC), Registers::ArgReg1);
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -230,17 +230,17 @@ stubs::SetElem(VMFrame &f)
     if (!FetchElementId(f.cx, obj, idval, id, &regs.sp[-2]))
         THROW();
 
     TypeScript::MonitorAssign(cx, obj, id);
 
     do {
         if (obj->isDenseArray() && JSID_IS_INT(id)) {
             jsuint length = obj->getDenseArrayInitializedLength();
-            jsint i = JSID_TO_INT(id);
+            int32_t i = JSID_TO_INT(id);
             if ((jsuint)i < length) {
                 if (obj->getDenseArrayElement(i).isMagic(JS_ARRAY_HOLE)) {
                     if (js_PrototypeHasIndexedProperties(cx, obj))
                         break;
                     if ((jsuint)i >= obj->getArrayLength())
                         obj->setArrayLength(cx, i + 1);
                 }
                 obj->setDenseArrayElementWithType(cx, i, rval);
@@ -1573,19 +1573,19 @@ stubs::TableSwitch(VMFrame &f, jsbytecod
         } else if (!JSDOUBLE_IS_INT32(d, &tableIdx)) {
             goto finally;
         }
     } else {
         goto finally;
     }
 
     {
-        jsint low = GET_JUMP_OFFSET(pc);
+        int32_t low = GET_JUMP_OFFSET(pc);
         pc += JUMP_OFFSET_LEN;
-        jsint high = GET_JUMP_OFFSET(pc);
+        int32_t high = GET_JUMP_OFFSET(pc);
         pc += JUMP_OFFSET_LEN;
 
         tableIdx -= low;
         if ((jsuint) tableIdx < (jsuint)(high - low + 1)) {
             pc += JUMP_OFFSET_LEN * tableIdx;
             if (uint32_t candidateOffset = GET_JUMP_OFFSET(pc))
                 jumpOffset = candidateOffset;
         }
@@ -1923,17 +1923,17 @@ stubs::ConvertToTypedInt(JSContext *cx, 
         return vp->toBoolean() ? 1 : 0;
 
     JS_ASSERT(vp->isString());
 
     int32_t i32 = 0;
 #ifdef DEBUG
     bool success = 
 #endif
-        StringToNumberType<jsint>(cx, vp->toString(), &i32);
+        StringToNumberType<int32_t>(cx, vp->toString(), &i32);
     JS_ASSERT(success);
 
     return i32;
 }
 
 template int32_t JS_FASTCALL stubs::ConvertToTypedInt<true>(JSContext *, Value *);
 template int32_t JS_FASTCALL stubs::ConvertToTypedInt<false>(JSContext *, Value *);
 
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1904,17 +1904,17 @@ PCToLine(JSContext *cx, unsigned argc, j
 
 static void
 UpdateSwitchTableBounds(JSContext *cx, JSScript *script, unsigned offset,
                         unsigned *start, unsigned *end)
 {
     jsbytecode *pc;
     JSOp op;
     ptrdiff_t jmplen;
-    jsint low, high, n;
+    int32_t low, high, n;
 
     pc = script->code + offset;
     op = JSOp(*pc);
     switch (op) {
       case JSOP_TABLESWITCH:
         jmplen = JUMP_OFFSET_LEN;
         pc += jmplen;
         low = GET_JUMP_OFFSET(pc);
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2365,29 +2365,29 @@ class FlowGraphSummary : public Vector<s
             } else if (op == JSOP_TABLESWITCH || op == JSOP_LOOKUPSWITCH) {
                 jsbytecode *pc = r.frontPC();
                 size_t offset = r.frontOffset();
                 ptrdiff_t step = JUMP_OFFSET_LEN;
                 size_t defaultOffset = offset + GET_JUMP_OFFSET(pc);
                 pc += step;
                 addEdge(lineno, defaultOffset);
 
-                jsint ncases;
+                int ncases;
                 if (op == JSOP_TABLESWITCH) {
-                    jsint low = GET_JUMP_OFFSET(pc);
+                    int32_t low = GET_JUMP_OFFSET(pc);
                     pc += JUMP_OFFSET_LEN;
                     ncases = GET_JUMP_OFFSET(pc) - low + 1;
                     pc += JUMP_OFFSET_LEN;
                 } else {
-                    ncases = (jsint) GET_UINT16(pc);
+                    ncases = GET_UINT16(pc);
                     pc += UINT16_LEN;
                     JS_ASSERT(ncases > 0);
                 }
 
-                for (jsint i = 0; i < ncases; i++) {
+                for (int i = 0; i < ncases; i++) {
                     if (op == JSOP_LOOKUPSWITCH)
                         pc += UINT32_INDEX_LEN;
                     size_t target = offset + GET_JUMP_OFFSET(pc);
                     addEdge(lineno, target);
                     pc += step;
                 }
             }
 
--- a/js/src/vm/String-inl.h
+++ b/js/src/vm/String-inl.h
@@ -288,17 +288,17 @@ js::StaticStrings::getUint(uint32_t u)
 
 inline bool
 js::StaticStrings::hasInt(int32_t i)
 {
     return uint32_t(i) < INT_STATIC_LIMIT;
 }
 
 inline JSAtom *
-js::StaticStrings::getInt(jsint i)
+js::StaticStrings::getInt(int32_t i)
 {
     JS_ASSERT(hasInt(i));
     return getUint(uint32_t(i));
 }
 
 inline JSLinearString *
 js::StaticStrings::getUnitStringForElement(JSContext *cx, JSString *str, size_t index)
 {
@@ -347,17 +347,17 @@ js::StaticStrings::lookup(const jschar *
          * not 1000 or more) chars. We rely on order here to resolve the unit vs.
          * int string/length-2 string atom identity issue by giving priority to unit
          * strings for "0" through "9" and length-2 strings for "10" through "99".
          */
         JS_STATIC_ASSERT(INT_STATIC_LIMIT <= 999);
         if ('1' <= chars[0] && chars[0] <= '9' &&
             '0' <= chars[1] && chars[1] <= '9' &&
             '0' <= chars[2] && chars[2] <= '9') {
-            jsint i = (chars[0] - '0') * 100 +
+            int i = (chars[0] - '0') * 100 +
                       (chars[1] - '0') * 10 +
                       (chars[2] - '0');
 
             if (jsuint(i) < INT_STATIC_LIMIT)
                 return getInt(i);
         }
         return NULL;
     }
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -524,17 +524,17 @@ StaticStrings::isStatic(JSAtom *atom)
       case 1:
         return (chars[0] < UNIT_STATIC_LIMIT);
       case 2:
         return (fitsInSmallChar(chars[0]) && fitsInSmallChar(chars[1]));
       case 3:
         if ('1' <= chars[0] && chars[0] <= '9' &&
             '0' <= chars[1] && chars[1] <= '9' &&
             '0' <= chars[2] && chars[2] <= '9') {
-            jsint i = (chars[0] - '0') * 100 +
+            int i = (chars[0] - '0') * 100 +
                       (chars[1] - '0') * 10 +
                       (chars[2] - '0');
 
             return (jsuint(i) < INT_STATIC_LIMIT);
         }
         return false;
       default:
         return false;
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -718,17 +718,17 @@ class StaticStrings
 
     bool init(JSContext *cx);
     void trace(JSTracer *trc);
 
     static inline bool hasUint(uint32_t u);
     inline JSAtom *getUint(uint32_t u);
 
     static inline bool hasInt(int32_t i);
-    inline JSAtom *getInt(jsint i);
+    inline JSAtom *getInt(int32_t i);
 
     static inline bool hasUnit(jschar c);
     JSAtom *getUnit(jschar c);
 
     /* May not return atom, returns null on (reported) failure. */
     inline JSLinearString *getUnitStringForElement(JSContext *cx, JSString *str, size_t index);
 
     static bool isStatic(JSAtom *atom);