Bug 708735 - Use <stdint.h> types in JSAPI and throughout SpiderMonkey. Continue to provide the {u,}int{8,16,32,64} and JS{Uint,Int}{8,16,32,64} integer types through a single header, however, for a simpler backout strategy -- and also to ease the transition for embedders. r=timeless on switching the jsd API to use the <stdint.h> types, r=luke, r=dmandelin
authorJeff Walden <jwalden@mit.edu>
Thu, 08 Dec 2011 22:54:10 -0500
changeset 84407 d6d732ef5650562f1f1593df4bd446614e3f2dfa
parent 84406 dcf6e5163e631a470678cd35d1b6733687d9f034
child 84408 f879c54dffae14bc5d0d22fea56298cb8a07e118
push idunknown
push userunknown
push dateunknown
reviewerstimeless, luke, dmandelin
bugs708735
milestone11.0a1
Bug 708735 - Use <stdint.h> types in JSAPI and throughout SpiderMonkey. Continue to provide the {u,}int{8,16,32,64} and JS{Uint,Int}{8,16,32,64} integer types through a single header, however, for a simpler backout strategy -- and also to ease the transition for embedders. r=timeless on switching the jsd API to use the <stdint.h> types, r=luke, r=dmandelin
caps/src/nsJSPrincipals.cpp
content/canvas/src/CustomQS_Canvas2D.h
content/canvas/src/CustomQS_WebGL.h
content/html/content/src/nsHTMLImageElement.cpp
content/xbl/src/nsXBLSerialize.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
dom/base/nsJSTimeoutHandler.cpp
dom/base/nsStructuredCloneContainer.cpp
dom/base/nsStructuredCloneContainer.h
dom/src/json/nsJSON.cpp
dom/system/b2g/RadioManager.cpp
dom/workers/Events.cpp
dom/workers/FileReaderSync.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerScope.cpp
ipc/testshell/XPCShellEnvironment.cpp
js/ipc/ObjectWrapperChild.cpp
js/jsd/jsd.h
js/jsd/jsd_lock.c
js/jsd/jsd_scpt.c
js/jsd/jsd_step.c
js/jsd/jsd_val.c
js/jsd/jsdebug.c
js/jsd/jsdebug.h
js/public/HashTable.h
js/public/LegacyIntTypes.h
js/public/Utility.h
js/src/Makefile.in
js/src/assembler/assembler/AbstractMacroAssembler.h
js/src/assembler/assembler/LinkBuffer.h
js/src/assembler/assembler/MacroAssemblerARM.h
js/src/assembler/assembler/MacroAssemblerCodeRef.h
js/src/assembler/assembler/MacroAssemblerSparc.h
js/src/assembler/assembler/MacroAssemblerX86Common.h
js/src/builtin/RegExp.cpp
js/src/ctypes/CTypes.cpp
js/src/ctypes/CTypes.h
js/src/ctypes/typedefs.h
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeCompiler.h
js/src/frontend/BytecodeEmitter-inl.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/frontend/FoldConstants.cpp
js/src/frontend/ParseNode.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SemanticAnalysis.cpp
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
js/src/gc/Barrier-inl.h
js/src/gc/Barrier.h
js/src/gc/Statistics.h
js/src/jit-test/tests/basic/truncateDouble.js
js/src/jit-test/tests/jaeger/bug549393-1.js
js/src/jit-test/tests/jaeger/getelem-sanity-5.js
js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js
js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js
js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js
js/src/jsanalyze.cpp
js/src/jsanalyze.h
js/src/jsapi-tests/testDebugger.cpp
js/src/jsapi-tests/testIndexToString.cpp
js/src/jsapi-tests/testXDR.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsarrayinlines.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsatominlines.h
js/src/jscell.h
js/src/jsclass.h
js/src/jsclone.cpp
js/src/jsclone.h
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartment.h
js/src/jscrashformat.h
js/src/jscrashreport.cpp
js/src/jscrashreport.h
js/src/jsdate.cpp
js/src/jsdate.h
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsdhash.cpp
js/src/jsdhash.h
js/src/jsdtoa.cpp
js/src/jsexn.cpp
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsfuninlines.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcinlines.h
js/src/jsgcmark.cpp
js/src/jsgcstats.h
js/src/jshash.cpp
js/src/jshash.h
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsinferinlines.h
js/src/jsinterp.cpp
js/src/jsinttypes.h
js/src/jsiter.cpp
js/src/jsiter.h
js/src/jslock.cpp
js/src/jslock.h
js/src/jslog2.cpp
js/src/jsmath.cpp
js/src/jsmath.h
js/src/jsnum.cpp
js/src/jsnum.h
js/src/jsnuminlines.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsopcode.tbl
js/src/jsotypes.h
js/src/jsprf.cpp
js/src/jsprf.h
js/src/jsprobes.cpp
js/src/jspropertycache.cpp
js/src/jspropertycache.h
js/src/jsproxy.cpp
js/src/jsproxy.h
js/src/jsprvtd.h
js/src/jspubtd.h
js/src/jsreflect.cpp
js/src/jsscope.cpp
js/src/jsscope.h
js/src/jsscopeinlines.h
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsscriptinlines.h
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jstypedarray.cpp
js/src/jstypedarray.h
js/src/jstypedarrayinlines.h
js/src/jstypes.h
js/src/jsutil.cpp
js/src/jsutil.h
js/src/jsval.h
js/src/jswatchpoint.cpp
js/src/jsxdrapi.cpp
js/src/jsxdrapi.h
js/src/jsxml.cpp
js/src/jsxml.h
js/src/methodjit/BaseAssembler.h
js/src/methodjit/BaseCompiler.h
js/src/methodjit/Compiler.cpp
js/src/methodjit/Compiler.h
js/src/methodjit/FastArithmetic.cpp
js/src/methodjit/FastBuiltins.cpp
js/src/methodjit/FastOps.cpp
js/src/methodjit/FrameEntry.h
js/src/methodjit/FrameState-inl.h
js/src/methodjit/FrameState.cpp
js/src/methodjit/FrameState.h
js/src/methodjit/ICChecker.h
js/src/methodjit/ICLabels.h
js/src/methodjit/ICRepatcher.h
js/src/methodjit/ImmutableSync.cpp
js/src/methodjit/ImmutableSync.h
js/src/methodjit/InlineFrameAssembler.h
js/src/methodjit/InvokeHelpers.cpp
js/src/methodjit/Logging.cpp
js/src/methodjit/Logging.h
js/src/methodjit/LoopState.cpp
js/src/methodjit/LoopState.h
js/src/methodjit/MachineRegs.h
js/src/methodjit/MethodJIT.cpp
js/src/methodjit/MethodJIT.h
js/src/methodjit/MonoIC.cpp
js/src/methodjit/MonoIC.h
js/src/methodjit/NunboxAssembler.h
js/src/methodjit/PolyIC.cpp
js/src/methodjit/PolyIC.h
js/src/methodjit/PunboxAssembler.h
js/src/methodjit/RematInfo.h
js/src/methodjit/Retcon.cpp
js/src/methodjit/StubCalls.cpp
js/src/methodjit/StubCalls.h
js/src/methodjit/StubCompiler.cpp
js/src/methodjit/StubCompiler.h
js/src/methodjit/TrampolineCompiler.cpp
js/src/methodjit/TypedArrayIC.h
js/src/perf/jsperf.cpp
js/src/perf/jsperf.h
js/src/perf/pm_linux.cpp
js/src/prmjtime.cpp
js/src/prmjtime.h
js/src/shell/js.cpp
js/src/shell/jsheaptools.cpp
js/src/shell/jsworkers.cpp
js/src/tests/e4x/Regress/regress-473709.js
js/src/tests/ecma/Array/15.4.2.2-1.js
js/src/tests/ecma/String/15.5.3.2-1.js
js/src/tests/ecma/String/15.5.3.2-2.js
js/src/tests/ecma/String/15.5.3.2-3.js
js/src/tests/ecma_2/RegExp/properties-002.js
js/src/tests/ecma_3/RegExp/15.10.6.2-2.js
js/src/tests/js1_5/Array/regress-157652.js
js/src/tests/js1_5/Regress/regress-452336.js
js/src/tests/js1_5/Regress/regress-479353.js
js/src/tests/js1_6/extensions/regress-470310.js
js/src/tests/js1_8/regress/regress-479353.js
js/src/tests/js1_8_1/regress/regress-452498-053.js
js/src/tests/js1_8_1/regress/regress-452498-099.js
js/src/vm/ArgumentsObject-inl.h
js/src/vm/ArgumentsObject.h
js/src/vm/CallObject.h
js/src/vm/Debugger.cpp
js/src/vm/GlobalObject-inl.h
js/src/vm/GlobalObject.cpp
js/src/vm/GlobalObject.h
js/src/vm/RegExpObject.cpp
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/StackSpace.h
js/src/vm/String-inl.h
js/src/vm/String.cpp
js/src/vm/String.h
js/src/vm/StringObject.h
js/src/vm/Unicode.cpp
js/src/vm/Unicode.h
js/src/vm/make_unicode.py
js/src/yarr/pcre/pcre_exec.cpp
js/xpconnect/loader/mozJSLoaderUtils.cpp
js/xpconnect/shell/xpcshell.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCDebug.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCMaps.cpp
js/xpconnect/src/XPCMaps.h
js/xpconnect/src/XPCQuickStubs.h
js/xpconnect/src/XPCVariant.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
js/xpconnect/src/XPCWrappedNativeScope.cpp
js/xpconnect/src/codegen.py
js/xpconnect/src/dombindings.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/qsgen.py
js/xpconnect/src/xpcprivate.h
mfbt/Util.h
tools/trace-malloc/lib/nsTraceMalloc.h
--- a/caps/src/nsJSPrincipals.cpp
+++ b/caps/src/nsJSPrincipals.cpp
@@ -105,17 +105,17 @@ nsTranscodeJSPrincipals(JSXDRState *xdr,
 {
     nsresult rv;
 
     if (xdr->mode == JSXDR_ENCODE) {
         nsIObjectOutputStream *stream =
             reinterpret_cast<nsIObjectOutputStream*>(xdr->userdata);
 
         // Flush xdr'ed data to the underlying object output stream.
-        uint32 size;
+        uint32_t size;
         char *data = (char*) ::JS_XDRMemGetData(xdr, &size);
 
         rv = stream->Write32(size);
         if (NS_SUCCEEDED(rv)) {
             rv = stream->WriteBytes(data, size);
             if (NS_SUCCEEDED(rv)) {
                 ::JS_XDRMemResetData(xdr);
 
@@ -138,17 +138,17 @@ nsTranscodeJSPrincipals(JSXDRState *xdr,
             PRUint32 size;
             rv = stream->Read32(&size);
             if (NS_SUCCEEDED(rv)) {
                 char *data = nsnull;
                 if (size != 0)
                     rv = stream->ReadBytes(size, &data);
                 if (NS_SUCCEEDED(rv)) {
                     char *olddata;
-                    uint32 oldsize;
+                    uint32_t oldsize;
 
                     // Any decode-mode JSXDRState whose userdata points to an
                     // nsIObjectInputStream instance must use nsMemory to Alloc
                     // and Free its data buffer.  Swap the new buffer we just
                     // read for the old, exhausted data.
                     olddata = (char*) ::JS_XDRMemGetData(xdr, &oldsize);
                     nsMemory::Free(olddata);
                     ::JS_XDRMemSetData(xdr, data, size);
--- a/content/canvas/src/CustomQS_Canvas2D.h
+++ b/content/canvas/src/CustomQS_Canvas2D.h
@@ -168,17 +168,17 @@ CreateImageData(JSContext* cx,
 {
     using mozilla::CheckedInt;
 
     if (w == 0)
         w = 1;
     if (h == 0)
         h = 1;
 
-    CheckedInt<uint32> len = CheckedInt<uint32>(w) * h * 4;
+    CheckedInt<uint32_t> len = CheckedInt<uint32_t>(w) * h * 4;
     if (!len.valid()) {
         return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
     }
 
     // Create the fast typed array; it's initialized to 0 by default.
     JSObject* darray =
       js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT8_CLAMPED, len.value());
     js::AutoObjectRooter rd(cx, darray);
@@ -216,38 +216,38 @@ CreateImageData(JSContext* cx,
         return false;
     }
 
     *vp = OBJECT_TO_JSVAL(result);
     return true;
 }
 
 static bool
-GetImageDataDimensions(JSContext *cx, JSObject *dataObject, uint32 *width, uint32 *height)
+GetImageDataDimensions(JSContext *cx, JSObject *dataObject, uint32_t *width, uint32_t *height)
 {
     jsval temp;
-    int32 wi, hi;
+    int32_t wi, hi;
     
     // Need to check that dataObject is ImageData object. That's hard for the moment 
     // because they're just vanilla objects in our implementation.
     // Let's guess, if the object has valid width and height then it's suitable
     // for this operation.
     if (!JS_GetProperty(cx, dataObject, "width", &temp) ||
         !JS_ValueToECMAInt32(cx, temp, &wi))
         return false;
 
     if (!JS_GetProperty(cx, dataObject, "height", &temp) ||
         !JS_ValueToECMAInt32(cx, temp, &hi))
         return false;
 
     if (wi <= 0 || hi <= 0)
         return xpc_qsThrow(cx, NS_ERROR_DOM_INDEX_SIZE_ERR);
 
-    *width = (uint32)wi;
-    *height = (uint32)hi;
+    *width = uint32_t(wi);
+    *height = uint32_t(hi);
     return true;
 }
 
 static JSBool
 nsIDOMCanvasRenderingContext2D_CreateImageData(JSContext *cx, uintN argc, jsval *vp)
 {
     XPC_QS_ASSERT_CONTEXT_OK(cx);
 
@@ -261,17 +261,17 @@ nsIDOMCanvasRenderingContext2D_CreateIma
     if (argc == 1) {
         // The specification asks to throw NOT_SUPPORTED if first argument is NULL,
         // An object is expected, so throw an exception for all primitives.
         if (JSVAL_IS_PRIMITIVE(argv[0]))
             return xpc_qsThrow(cx, NS_ERROR_DOM_NOT_SUPPORTED_ERR);
 
         JSObject *dataObject = JSVAL_TO_OBJECT(argv[0]);
 
-        uint32 data_width, data_height;
+        uint32_t data_width, data_height;
         if (!GetImageDataDimensions(cx, dataObject, &data_width, &data_height))
             return false;
 
         return CreateImageData(cx, data_width, data_height, NULL, 0, 0, vp);
     }
 
     jsdouble width, height;
     if (!JS_ValueToNumber(cx, argv[0], &width) ||
@@ -387,17 +387,17 @@ nsIDOMCanvasRenderingContext2D_PutImageD
     }
 
     int32 x = JS_DoubleToInt32(xd);
     int32 y = JS_DoubleToInt32(yd);
 
     // Grab width, height, and the dense array from the dataObject.
     js::AutoValueRooter tv(cx);
 
-    uint32 w, h;
+    uint32_t w, h;
     if (!GetImageDataDimensions(cx, dataObject, &w, &h))
         return JS_FALSE;
 
     // the optional dirty rect
     bool hasDirtyRect = false;
     int32 dirtyX = 0,
           dirtyY = 0,
           dirtyWidth = w,
--- a/content/canvas/src/CustomQS_WebGL.h
+++ b/content/canvas/src/CustomQS_WebGL.h
@@ -38,31 +38,31 @@
 
 /*
  * Intended to be #included in dom_quickstubs.cpp via qsconf!
  */
 
 #include "jstypedarray.h"
 
 #define GET_INT32_ARG(var, index) \
-  int32 var; \
+  int32_t var; \
   do { \
     if (!JS_ValueToECMAInt32(cx, argv[index], &(var))) \
       return JS_FALSE; \
   } while (0)
 
 #define GET_UINT32_ARG(var, index) \
-  uint32 var; \
+  uint32_t var; \
   do { \
     if (!JS_ValueToECMAUint32(cx, argv[index], &(var))) \
       return JS_FALSE; \
   } while (0)
 
 #define GET_OPTIONAL_UINT32_ARG(var, index) \
-  uint32 var = 0; \
+  uint32_t var = 0; \
   do { \
     if (argc > index) \
       if (!JS_ValueToECMAUint32(cx, argv[index], &(var))) \
         return JS_FALSE; \
   } while (0)
 
 
 static inline bool
@@ -95,21 +95,21 @@ nsIDOMWebGLRenderingContext_BufferData(J
     if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull))
         return JS_FALSE;
 
     if (argc < 3)
         return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
 
     jsval *argv = JS_ARGV(cx, vp);
 
-    int32 target;
+    int32_t target;
     JSObject *wa = 0;
     JSObject *wb = 0;
-    int32 size;
-    int32 usage;
+    int32_t size;
+    int32_t usage;
 
     if (!JS_ValueToECMAInt32(cx, argv[0], &target))
         return JS_FALSE;
     if (!JS_ValueToECMAInt32(cx, argv[2], &usage))
         return JS_FALSE;
 
     JSBool nullobject = JSVAL_IS_NULL(argv[1]);
 
@@ -168,18 +168,18 @@ nsIDOMWebGLRenderingContext_BufferSubDat
     if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull))
         return JS_FALSE;
 
     if (argc < 3)
         return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
 
     jsval *argv = JS_ARGV(cx, vp);
 
-    int32 target;
-    int32 offset;
+    int32_t target;
+    int32_t offset;
     JSObject *wa = 0;
     JSObject *wb = 0;
 
     if (!JS_ValueToECMAInt32(cx, argv[0], &target))
         return JS_FALSE;
     if (!JS_ValueToECMAInt32(cx, argv[1], &offset))
         return JS_FALSE;
 
@@ -343,17 +343,17 @@ nsIDOMWebGLRenderingContext_TexImage2D(J
             JS_GetProperty(cx, argv5, "data", &js_data);
             if (js_width  == JSVAL_VOID ||
                 js_height == JSVAL_VOID ||
                 js_data   == JSVAL_VOID)
             {
                 xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 5);
                 return JS_FALSE;
             }
-            int32 int_width, int_height;
+            int32_t int_width, int_height;
             JSObject *obj_data = JSVAL_TO_OBJECT(js_data);
             if (!JS_ValueToECMAInt32(cx, js_width, &int_width) ||
                 !JS_ValueToECMAInt32(cx, js_height, &int_height))
             {
                 return JS_FALSE;
             }
             if (!js_IsTypedArray(obj_data))
             {
@@ -464,17 +464,17 @@ nsIDOMWebGLRenderingContext_TexSubImage2
             JS_GetProperty(cx, argv6, "data", &js_data);
             if (js_width  == JSVAL_VOID ||
                 js_height == JSVAL_VOID ||
                 js_data   == JSVAL_VOID)
             {
                 xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 6);
                 return JS_FALSE;
             }
-            int32 int_width, int_height;
+            int32_t int_width, int_height;
             JSObject *obj_data = JSVAL_TO_OBJECT(js_data);
             if (!JS_ValueToECMAInt32(cx, js_width, &int_width) ||
                 !JS_ValueToECMAInt32(cx, js_height, &int_height))
             {
                 return JS_FALSE;
             }
             if (!js_IsTypedArray(obj_data))
             {
@@ -688,17 +688,17 @@ helper_nsIDOMWebGLRenderingContext_Unifo
     nsIWebGLUniformLocation *location;
     xpc_qsSelfRef location_selfref;
     nsresult rv = xpc_qsUnwrapArg(cx, argv[0], &location, &location_selfref.ptr, &argv[0]);
     if (NS_FAILED(rv)) {
         xpc_qsThrowBadArg(cx, rv, vp, 0);
         return JS_FALSE;
     }
 
-    int32 transpose;
+    int32_t transpose;
     if (!JS_ValueToECMAInt32(cx, argv[1], &transpose))
         return JS_FALSE;
 
     if (JSVAL_IS_PRIMITIVE(argv[2])) {
         xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 2);
         return JS_FALSE;
     }
 
@@ -753,17 +753,17 @@ helper_nsIDOMWebGLRenderingContext_Verte
     if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr, tvr.jsval_addr(), nsnull))
         return JS_FALSE;
 
     if (argc < 2)
         return xpc_qsThrow(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);
 
     jsval *argv = JS_ARGV(cx, vp);
 
-    uint32 location;
+    uint32_t location;
     if (!JS_ValueToECMAUint32(cx, argv[0], &location))
         return JS_FALSE;
 
     if (JSVAL_IS_PRIMITIVE(argv[1])) {
         xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 1);
         return JS_FALSE;
     }
 
--- a/content/html/content/src/nsHTMLImageElement.cpp
+++ b/content/html/content/src/nsHTMLImageElement.cpp
@@ -589,25 +589,25 @@ nsHTMLImageElement::Initialize(nsISuppor
 {
   if (argc <= 0) {
     // Nothing to do here if we don't get any arguments.
 
     return NS_OK;
   }
 
   // The first (optional) argument is the width of the image
-  uint32 width;
+  uint32_t width;
   JSBool ret = JS_ValueToECMAUint32(aContext, argv[0], &width);
   NS_ENSURE_TRUE(ret, NS_ERROR_INVALID_ARG);
 
   nsresult rv = SetIntAttr(nsGkAtoms::width, static_cast<PRInt32>(width));
 
   if (NS_SUCCEEDED(rv) && (argc > 1)) {
     // The second (optional) argument is the height of the image
-    uint32 height;
+    uint32_t height;
     ret = JS_ValueToECMAUint32(aContext, argv[1], &height);
     NS_ENSURE_TRUE(ret, NS_ERROR_INVALID_ARG);
 
     rv = SetIntAttr(nsGkAtoms::height, static_cast<PRInt32>(height));
   }
 
   return rv;
 }
--- a/content/xbl/src/nsXBLSerialize.cpp
+++ b/content/xbl/src/nsXBLSerialize.cpp
@@ -51,17 +51,17 @@ XBL_SerializeFunction(nsIScriptContext* 
     return NS_ERROR_OUT_OF_MEMORY;
   xdr->userdata = static_cast<void*>(aStream);
 
   JSAutoRequest ar(cx);
   nsresult rv;
   if (!JS_XDRFunctionObject(xdr, &aFunctionObject)) {
     rv = NS_ERROR_FAILURE;
   } else {
-    uint32 size;
+    uint32_t size;
     const char* data = reinterpret_cast<const char*>
                                        (JS_XDRMemGetData(xdr, &size));
     NS_ASSERTION(data, "no decoded JSXDRState data!");
 
     rv = aStream->Write32(size);
     if (NS_SUCCEEDED(rv))
       rv = aStream->WriteBytes(data, size);
   }
@@ -97,17 +97,17 @@ XBL_DeserializeFunction(nsIScriptContext
     xdr->userdata = static_cast<void*>(aStream);
     JSAutoRequest ar(cx);
     JS_XDRMemSetData(xdr, data, size);
 
     if (!JS_XDRFunctionObject(xdr, aFunctionObject)) {
       rv = NS_ERROR_FAILURE;
     }
 
-    uint32 junk;
+    uint32_t junk;
     data = static_cast<char*>(JS_XDRMemGetData(xdr, &junk));
     JS_XDRMemSetData(xdr, NULL, 0);
     JS_XDRDestroy(xdr);
   }
 
   nsMemory::Free(data);
   NS_ENSURE_SUCCESS(rv, rv);
   return rv;
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -5972,17 +5972,17 @@ class PostMessageEvent : public nsRunnab
     {
       mSupportsArray.AppendElement(aSupports);
       return true;
     }
 
   private:
     nsRefPtr<nsGlobalWindow> mSource;
     nsString mCallerOrigin;
-    JSUint64* mMessage;
+    uint64_t* mMessage;
     size_t mMessageLen;
     nsRefPtr<nsGlobalWindow> mTargetWindow;
     nsCOMPtr<nsIURI> mProvidedOrigin;
     bool mTrustedCaller;
     nsTArray<nsCOMPtr<nsISupports> > mSupportsArray;
 };
 
 namespace {
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2060,17 +2060,17 @@ nsJSContext::Serialize(nsIObjectOutputSt
         // from the JSXDRState to aStream, then write the object, then return
         // to JS XDR code with xdr reset so new JS data is encoded at the front
         // of the xdr's data buffer.
         //
         // However many XPCOM objects are interleaved with JS XDR data in the
         // stream, when control returns here from ::JS_XDRScript, we'll have
         // one last buffer of data to write to aStream.
 
-        uint32 size;
+        uint32_t size;
         const char* data = reinterpret_cast<const char*>
                                            (::JS_XDRMemGetData(xdr, &size));
         NS_ASSERTION(data, "no decoded JSXDRState data!");
 
         rv = aStream->Write32(size);
         if (NS_SUCCEEDED(rv))
             rv = aStream->WriteBytes(data, size);
     }
@@ -2125,17 +2125,17 @@ nsJSContext::Deserialize(nsIObjectInputS
         // to the JSXDRState, so more JS data can be decoded.
         //
         // This interleaving of JS XDR data and XPCOM object data may occur
         // several times beneath the call to ::JS_XDRScript, above.  At the
         // end of the day, we need to free (via nsMemory) the data owned by
         // the JSXDRState.  So we steal it back, nulling xdr's buffer so it
         // doesn't get passed to ::JS_free by ::JS_XDRDestroy.
 
-        uint32 junk;
+        uint32_t junk;
         data = (char*) ::JS_XDRMemGetData(xdr, &junk);
         if (data)
             ::JS_XDRMemSetData(xdr, NULL, 0);
         ::JS_XDRDestroy(xdr);
     }
 
     // If data is null now, it must have been freed while deserializing an
     // XPCOM object (e.g., a principal) beneath ::JS_XDRScript.
@@ -2772,21 +2772,20 @@ TraceMallocOpenLogFile(JSContext *cx, ui
     }
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(fd));
     return JS_TRUE;
 }
 
 static JSBool
 TraceMallocChangeLogFD(JSContext *cx, uintN argc, jsval *vp)
 {
-    int32 fd, oldfd;
-
     if (!CheckUniversalXPConnectForTraceMalloc(cx))
         return JS_FALSE;
 
+    int32_t fd, oldfd;
     if (argc == 0) {
         oldfd = -1;
     } else {
         if (!JS_ValueToECMAInt32(cx, JS_ARGV(cx, vp)[0], &fd))
             return JS_FALSE;
         oldfd = NS_TraceMallocChangeLogFD(fd);
         if (oldfd == -2) {
             JS_ReportOutOfMemory(cx);
@@ -2795,21 +2794,20 @@ TraceMallocChangeLogFD(JSContext *cx, ui
     }
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(oldfd));
     return JS_TRUE;
 }
 
 static JSBool
 TraceMallocCloseLogFD(JSContext *cx, uintN argc, jsval *vp)
 {
-    int32 fd;
-
     if (!CheckUniversalXPConnectForTraceMalloc(cx))
         return JS_FALSE;
 
+    int32_t fd;
     JS_SET_RVAL(cx, vp, JSVAL_VOID);
     if (argc == 0)
         return JS_TRUE;
     if (!JS_ValueToECMAInt32(cx, JS_ARGV(cx, vp)[0], &fd))
         return JS_FALSE;
     NS_TraceMallocCloseLogFD((int) fd);
     return JS_TRUE;
 }
@@ -3666,18 +3664,18 @@ ObjectPrincipalFinder(JSContext *cx, JSO
   JSPRINCIPALS_DROP(cx, jsPrincipals);
 
   return jsPrincipals;
 }
 
 JSObject*
 NS_DOMReadStructuredClone(JSContext* cx,
                           JSStructuredCloneReader* reader,
-                          uint32 tag,
-                          uint32 data,
+                          uint32_t tag,
+                          uint32_t data,
                           void* closure)
 {
   // We don't currently support any extensions to structured cloning.
   nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_DOM_DATA_CLONE_ERR);
   return nsnull;
 }
 
 JSBool
@@ -3688,17 +3686,17 @@ NS_DOMWriteStructuredClone(JSContext* cx
 {
   // We don't currently support any extensions to structured cloning.
   nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_DOM_DATA_CLONE_ERR);
   return JS_FALSE;
 }
 
 void
 NS_DOMStructuredCloneError(JSContext* cx,
-                           uint32 errorid)
+                           uint32_t errorid)
 {
   // We don't currently support any extensions to structured cloning.
   nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_DOM_DATA_CLONE_ERR);
 }
 
 //static
 nsresult
 nsJSRuntime::Init()
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -353,18 +353,18 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSArgAr
 
 /* factory functions */
 nsresult NS_CreateJSRuntime(nsIScriptRuntime **aRuntime);
 
 /* prototypes */
 void NS_ScriptErrorReporter(JSContext *cx, const char *message, JSErrorReport *report);
 
 JSObject* NS_DOMReadStructuredClone(JSContext* cx,
-                                    JSStructuredCloneReader* reader, uint32 tag,
-                                    uint32 data, void* closure);
+                                    JSStructuredCloneReader* reader, uint32_t tag,
+                                    uint32_t data, void* closure);
 
 JSBool NS_DOMWriteStructuredClone(JSContext* cx,
                                   JSStructuredCloneWriter* writer,
                                   JSObject* obj, void *closure);
 
-void NS_DOMStructuredCloneError(JSContext* cx, uint32 errorid);
+void NS_DOMStructuredCloneError(JSContext* cx, uint32_t errorid);
 
 #endif /* nsJSEnvironment_h */
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -225,26 +225,26 @@ nsJSScriptTimeoutHandler::Init(nsGlobalW
   PRUint32 argc;
   jsval *argv = nsnull;
 
   ncc->GetArgc(&argc);
   ncc->GetArgvPtr(&argv);
 
   JSFlatString *expr = nsnull;
   JSObject *funobj = nsnull;
-  int32 interval = 0;
 
   JSAutoRequest ar(cx);
 
   if (argc < 1) {
     ::JS_ReportError(cx, "Function %s requires at least 2 parameter",
                      *aIsInterval ? kSetIntervalStr : kSetTimeoutStr);
     return NS_ERROR_DOM_TYPE_ERR;
   }
 
+  int32_t interval = 0;
   if (argc > 1 && !::JS_ValueToECMAInt32(cx, argv[1], &interval)) {
     ::JS_ReportError(cx,
                      "Second argument to %s must be a millisecond interval",
                      aIsInterval ? kSetIntervalStr : kSetTimeoutStr);
     return NS_ERROR_DOM_TYPE_ERR;
   }
 
   if (argc == 1) {
--- a/dom/base/nsStructuredCloneContainer.cpp
+++ b/dom/base/nsStructuredCloneContainer.cpp
@@ -81,17 +81,17 @@ nsStructuredCloneContainer::InitFromVari
   // Make sure that we serialize in the right context.
   JSAutoRequest ar(aCx);
   JSAutoEnterCompartment ac;
   NS_ENSURE_STATE(ac.enter(aCx, JS_GetGlobalObject(aCx)));
 
   nsCxPusher cxPusher;
   cxPusher.Push(aCx);
 
-  PRUint64* jsBytes = nsnull;
+  uint64_t* jsBytes = nsnull;
   bool success = JS_WriteStructuredClone(aCx, jsData, &jsBytes, &mSize,
                                            nsnull, nsnull);
   NS_ENSURE_STATE(success);
   NS_ENSURE_STATE(jsBytes);
 
   // Copy jsBytes into our own buffer.
   mData = (PRUint64*) malloc(mSize);
   if (!mData) {
--- a/dom/base/nsStructuredCloneContainer.h
+++ b/dom/base/nsStructuredCloneContainer.h
@@ -58,16 +58,16 @@ class nsStructuredCloneContainer : publi
   public:
     nsStructuredCloneContainer();
     ~nsStructuredCloneContainer();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTRUCTUREDCLONECONTAINER
 
   private:
-    PRUint64* mData;
+    uint64_t* mData;
 
     // This needs to be size_t rather than a PR-type so it matches the JS API.
     size_t mSize;
-    PRUint32 mVersion;
+    uint32_t mVersion;
 };
 
 #endif
--- a/dom/src/json/nsJSON.cpp
+++ b/dom/src/json/nsJSON.cpp
@@ -188,17 +188,17 @@ nsJSON::EncodeToStream(nsIOutputStream *
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = bufferedStream->Flush();
 
   return rv;
 }
 
 static JSBool
-WriteCallback(const jschar *buf, uint32 len, void *data)
+WriteCallback(const jschar *buf, uint32_t len, void *data)
 {
   nsJSONWriter *writer = static_cast<nsJSONWriter*>(data);
   nsresult rv =  writer->Write((const PRUnichar*)buf, (PRUint32)len);
   if (NS_FAILED(rv))
     return JS_FALSE;
 
   return JS_TRUE;
 }
--- a/dom/system/b2g/RadioManager.cpp
+++ b/dom/system/b2g/RadioManager.cpp
@@ -102,17 +102,17 @@ PostToRIL(JSContext *cx, uintN argc, jsv
     data = abs.ptr();
   } else if (!JSVAL_IS_PRIMITIVE(v)) {
     JSObject *obj = JSVAL_TO_OBJECT(v);
     if (!js_IsTypedArray(obj)) {
       JS_ReportError(cx, "Object passed in wasn't a typed array");
       return false;
     }
 
-    JSUint32 type = JS_GetTypedArrayType(obj);
+    uint32_t type = JS_GetTypedArrayType(obj);
     if (type != js::TypedArray::TYPE_INT8 &&
         type != js::TypedArray::TYPE_UINT8 &&
         type != js::TypedArray::TYPE_UINT8_CLAMPED) {
       JS_ReportError(cx, "Typed array data is not octets");
       return false;
     }
 
     size = JS_GetTypedArrayByteLength(obj);
--- a/dom/workers/Events.cpp
+++ b/dom/workers/Events.cpp
@@ -450,17 +450,17 @@ class MessageEvent : public Event
 {
   static JSClass sClass;
   static JSClass sMainRuntimeClass;
 
   static JSPropertySpec sProperties[];
   static JSFunctionSpec sFunctions[];
 
 protected:
-  uint64* mData;
+  uint64_t* mData;
   size_t mDataByteCount;
   nsTArray<nsCOMPtr<nsISupports> > mClonedObjects;
   bool mMainRuntime;
 
 public:
   static bool
   IsThisClass(JSClass* aClass)
   {
@@ -844,17 +844,17 @@ private:
 
     ErrorEvent* event = GetInstancePrivate(aCx, obj, sFunctions[0].name);
     if (!event) {
       return false;
     }
 
     JSString* type, *message, *filename;
     JSBool bubbles, cancelable;
-    uint32 lineNumber;
+    uint32_t lineNumber;
     if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "SbbSSu", &type,
                              &bubbles, &cancelable, &message, &filename,
                              &lineNumber)) {
       return false;
     }
 
     return InitErrorEventCommon(aCx, obj, event, type, bubbles, cancelable,
                                 message, filename, lineNumber, false);
--- a/dom/workers/FileReaderSync.cpp
+++ b/dom/workers/FileReaderSync.cpp
@@ -206,18 +206,18 @@ private:
       return false;
     }
 
     JSObject* jsArrayBuffer = js_CreateArrayBuffer(aCx, blobSize);
     if (!jsArrayBuffer) {
       return false;
     }
 
-    JSUint32 bufferLength = JS_GetArrayBufferByteLength(jsArrayBuffer);
-    uint8* arrayBuffer = JS_GetArrayBufferData(jsArrayBuffer);
+    uint32_t bufferLength = JS_GetArrayBufferByteLength(jsArrayBuffer);
+    uint8_t* arrayBuffer = JS_GetArrayBufferData(jsArrayBuffer);
 
     rv = fileReader->ReadAsArrayBuffer(blob, bufferLength, arrayBuffer);
     if (!EnsureSucceededOrThrow(aCx, rv)) {
       return false;
     }
 
     JS_SET_RVAL(aCx, aVp, OBJECT_TO_JSVAL(jsArrayBuffer));
     return true;
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -161,19 +161,19 @@ public:
     escapedDomain.ReplaceChar('/', '\\');
 
     NS_ConvertUTF16toUTF8 escapedURL(aWorkerPrivate->ScriptURL());
     escapedURL.ReplaceChar('/', '\\');
 
     {
       // 64bit address plus '0x' plus null terminator.
       char address[21];
-      JSUint32 addressSize =
+      uint32_t addressSize =
         JS_snprintf(address, sizeof(address), "0x%llx", aWorkerPrivate);
-      if (addressSize != JSUint32(-1)) {
+      if (addressSize != uint32_t(-1)) {
         mAddressString.Assign(address, addressSize);
       }
       else {
         NS_WARNING("JS_snprintf failed!");
         mAddressString.AssignLiteral("<unknown address>");
       }
     }
 
@@ -222,18 +222,18 @@ public:
   }
 };
 
 NS_IMPL_THREADSAFE_ISUPPORTS1(WorkerMemoryReporter, nsIMemoryMultiReporter)
 
 struct WorkerStructuredCloneCallbacks
 {
   static JSObject*
-  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32 aTag,
-       uint32 aData, void* aClosure)
+  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32_t aTag,
+       uint32_t aData, void* aClosure)
   {
     // See if object is a nsIDOMFile pointer.
     if (aTag == DOMWORKER_SCTAG_FILE) {
       JS_ASSERT(!aData);
 
       nsIDOMFile* file;
       if (JS_ReadBytes(aReader, &file, sizeof(file))) {
         JS_ASSERT(file);
@@ -321,33 +321,33 @@ struct WorkerStructuredCloneCallbacks
       }
     }
 
     Error(aCx, 0);
     return false;
   }
 
   static void
-  Error(JSContext* aCx, uint32 /* aErrorId */)
+  Error(JSContext* aCx, uint32_t /* aErrorId */)
   {
     ThrowDOMExceptionForCode(aCx, DATA_CLONE_ERR);
   }
 };
 
 JSStructuredCloneCallbacks gWorkerStructuredCloneCallbacks = {
   WorkerStructuredCloneCallbacks::Read,
   WorkerStructuredCloneCallbacks::Write,
   WorkerStructuredCloneCallbacks::Error
 };
 
 struct MainThreadWorkerStructuredCloneCallbacks
 {
   static JSObject*
-  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32 aTag,
-       uint32 aData, void* aClosure)
+  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32_t aTag,
+       uint32_t aData, void* aClosure)
   {
     AssertIsOnMainThread();
 
     // See if object is a nsIDOMFile pointer.
     if (aTag == DOMWORKER_SCTAG_FILE) {
       JS_ASSERT(!aData);
 
       nsIDOMFile* file;
@@ -480,65 +480,65 @@ struct MainThreadWorkerStructuredCloneCa
       return ok;
     }
 
     JS_ClearPendingException(aCx);
     return NS_DOMWriteStructuredClone(aCx, aWriter, aObj, nsnull);
   }
 
   static void
-  Error(JSContext* aCx, uint32 aErrorId)
+  Error(JSContext* aCx, uint32_t aErrorId)
   {
     AssertIsOnMainThread();
 
     NS_DOMStructuredCloneError(aCx, aErrorId);
   }
 };
 
 JSStructuredCloneCallbacks gMainThreadWorkerStructuredCloneCallbacks = {
   MainThreadWorkerStructuredCloneCallbacks::Read,
   MainThreadWorkerStructuredCloneCallbacks::Write,
   MainThreadWorkerStructuredCloneCallbacks::Error
 };
 
 struct ChromeWorkerStructuredCloneCallbacks
 {
   static JSObject*
-  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32 aTag,
-       uint32 aData, void* aClosure)
+  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32_t aTag,
+       uint32_t aData, void* aClosure)
   {
     return WorkerStructuredCloneCallbacks::Read(aCx, aReader, aTag, aData,
                                                 aClosure);
   }
 
   static JSBool
   Write(JSContext* aCx, JSStructuredCloneWriter* aWriter, JSObject* aObj,
         void* aClosure)
   {
     return WorkerStructuredCloneCallbacks::Write(aCx, aWriter, aObj, aClosure);
   }
 
   static void
-  Error(JSContext* aCx, uint32 aErrorId)
+  Error(JSContext* aCx, uint32_t aErrorId)
   {
     return WorkerStructuredCloneCallbacks::Error(aCx, aErrorId);
   }
 };
 
 JSStructuredCloneCallbacks gChromeWorkerStructuredCloneCallbacks = {
   ChromeWorkerStructuredCloneCallbacks::Read,
   ChromeWorkerStructuredCloneCallbacks::Write,
   ChromeWorkerStructuredCloneCallbacks::Error
 };
 
 struct MainThreadChromeWorkerStructuredCloneCallbacks
 {
   static JSObject*
-  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32 aTag,
-       uint32 aData, void* aClosure)
+  Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32_t aTag,
+       uint32_t aData, void* aClosure)
   {
     AssertIsOnMainThread();
 
     JSObject* clone =
       MainThreadWorkerStructuredCloneCallbacks::Read(aCx, aReader, aTag, aData,
                                                      aClosure);
     if (clone) {
       return clone;
@@ -568,17 +568,17 @@ struct MainThreadChromeWorkerStructuredC
         NS_DOMWriteStructuredClone(aCx, aWriter, aObj, nsnull)) {
       return true;
     }
 
     return false;
   }
 
   static void
-  Error(JSContext* aCx, uint32 aErrorId)
+  Error(JSContext* aCx, uint32_t aErrorId)
   {
     AssertIsOnMainThread();
 
     NS_DOMStructuredCloneError(aCx, aErrorId);
   }
 };
 
 JSStructuredCloneCallbacks gMainThreadChromeWorkerStructuredCloneCallbacks = {
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -439,17 +439,17 @@ private:
       return false;
     }
 
     WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[3].name);
     if (!scope) {
       return false;
     }
 
-    uint32 id;
+    uint32_t id;
     if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "u", &id)) {
       return false;
     }
 
     return scope->mWorker->ClearTimeout(aCx, id);
   }
 
   static JSBool
@@ -481,17 +481,17 @@ private:
       return false;
     }
 
     WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[5].name);
     if (!scope) {
       return false;
     }
 
-    uint32 id;
+    uint32_t id;
     if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "u", &id)) {
       return false;
     }
 
     return scope->mWorker->ClearTimeout(aCx, id);
   }
 
   static JSBool
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -384,26 +384,26 @@ Quit(JSContext *cx,
     return JS_FALSE;
 }
 
 static JSBool
 DumpXPC(JSContext *cx,
         uintN argc,
         jsval *vp)
 {
-    int32 depth = 2;
+    int32_t depth = 2;
 
     if (argc > 0) {
         if (!JS_ValueToInt32(cx, JS_ARGV(cx, vp)[0], &depth))
             return JS_FALSE;
     }
 
     nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID());
     if(xpc)
-        xpc->DebugDump((int16)depth);
+        xpc->DebugDump(int16_t(depth));
     JS_SET_RVAL(cx, vp, JSVAL_VOID);
     return JS_TRUE;
 }
 
 static JSBool
 GC(JSContext *cx,
    uintN argc,
    jsval *vp)
@@ -420,17 +420,17 @@ GC(JSContext *cx,
 #ifdef JS_GC_ZEAL
 static JSBool
 GCZeal(JSContext *cx, 
        uintN argc,
        jsval *vp)
 {
   jsval* argv = JS_ARGV(cx, vp);
 
-  uint32 zeal;
+  uint32_t zeal;
   if (!JS_ValueToECMAUint32(cx, argv[0], &zeal))
     return JS_FALSE;
 
   JS_SetGCZeal(cx, PRUint8(zeal), JS_DEFAULT_ZEAL_FREQ, JS_FALSE);
   return JS_TRUE;
 }
 #endif
 
@@ -477,17 +477,17 @@ DumpHeap(JSContext *cx,
     if (argc > 2 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
         if (!JSVAL_IS_TRACEABLE(*vp))
             goto not_traceable_arg;
         thingToFind = JSVAL_TO_TRACEABLE(*vp);
     }
 
     vp = argv + 3;
     if (argc > 3 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
-        uint32 depth;
+        uint32_t depth;
 
         if (!JS_ValueToECMAUint32(cx, *vp, &depth))
             return JS_FALSE;
         maxDepth = depth;
     }
 
     vp = argv + 4;
     if (argc > 4 && *vp != JSVAL_NULL && *vp != JSVAL_VOID) {
--- a/js/ipc/ObjectWrapperChild.cpp
+++ b/js/ipc/ObjectWrapperChild.cpp
@@ -451,28 +451,28 @@ ObjectWrapperChild::AnswerNewEnumerateIn
         return false;
     AutoObjectRooter tvr(cx, state);
 
     for (JSObject* proto = mObj;
          proto;
          proto = JS_GetPrototype(cx, proto))
     {
         AutoIdArray ids(cx, JS_Enumerate(cx, proto));
-        for (uint i = 0; i < ids.length(); ++i)
+        for (size_t i = 0; i < ids.length(); ++i)
             JS_DefinePropertyById(cx, state, ids[i], JSVAL_VOID,
                                   NULL, NULL, JSPROP_ENUMERATE | JSPROP_SHARED);
     }
 
     InfallibleTArray<nsString>* strIds;
     {
         AutoIdArray ids(cx, JS_Enumerate(cx, state));
         if (!ids)
             return false;
         strIds = new InfallibleTArray<nsString>(ids.length());
-        for (uint i = 0; i < ids.length(); ++i)
+        for (size_t i = 0; i < ids.length(); ++i)
             if (!jsid_to_nsString(cx, ids[i], strIds->AppendElement())) {
                 delete strIds;
                 return false;
             }
     }
     *idp = strIds->Length();
 
     *status = (JS_SetPrivate(cx, state, strIds) &&
--- a/js/jsd/jsd.h
+++ b/js/jsd/jsd.h
@@ -131,17 +131,17 @@ typedef struct JSDProfileData       JSDP
 * XXX What I'm calling a JSDContext is really more of a JSDTaskState. 
 */
 
 struct JSDContext
 {
     JSCList                 links;      /* we are part of a JSCList */
     JSBool                  inited;
     void*                   data;
-    uint32                  flags;
+    uint32_t                flags;
     JSD_ScriptHookProc      scriptHook;
     void*                   scriptHookData;
     JSD_ExecutionHookProc   interruptHook;
     void*                   interruptHookData;
     JSRuntime*              jsrt;
     JSD_ErrorReporter       errorReporter;
     void*                   errorReporterData;
     JSCList                 threadsStates;
@@ -163,17 +163,17 @@ struct JSDContext
     JSHashTable*            scriptsTable;
     JSCList                 sources;
     JSCList                 removedSources;
     uintN                   sourceAlterCount;
     JSHashTable*            atoms;
     JSCList                 objectsList;
     JSHashTable*            objectsTable;
     JSDProfileData*         callingFunctionPData;
-    int64                   lastReturnTime;
+    int64_t                 lastReturnTime;
 #ifdef JSD_THREADSAFE
     void*                   scriptsLock;
     void*                   sourceTextLock;
     void*                   objectsLock;
     void*                   atomsLock;
     void*                   threadStatesLock;
 #endif /* JSD_THREADSAFE */
 #ifdef JSD_HAS_DANGEROUS_THREAD
@@ -186,32 +186,32 @@ struct JSDScript
 {
     JSCList     links;      /* we are part of a JSCList */
     JSDContext* jsdc;       /* JSDContext for this jsdscript */
     JSScript*   script;     /* script we are wrapping */
     uintN       lineBase;   /* we cache this */
     uintN       lineExtent; /* we cache this */
     JSCList     hooks;      /* JSCList of JSDExecHooks for this script */
     char*       url;
-    uint32      flags;
+    uint32_t    flags;
     void*       data;
 
     JSDProfileData  *profileData;
 
 #ifdef LIVEWIRE
     LWDBGApp*    app;
     LWDBGScript* lwscript;
 #endif
 };
 
 struct JSDProfileData
 {
     JSDProfileData* caller;
-    int64    lastCallStart;
-    int64    runningTime;
+    int64_t  lastCallStart;
+    int64_t  runningTime;
     uintN    callCount;
     uintN    recurseDepth;
     uintN    maxRecurseDepth;
     jsdouble minExecutionTime;
     jsdouble maxExecutionTime;
     jsdouble totalExecutionTime;
     jsdouble minOwnExecutionTime;
     jsdouble maxOwnExecutionTime;
@@ -400,21 +400,21 @@ extern JSDScript*
 jsd_FindOrCreateJSDScript(JSDContext    *jsdc,
                           JSContext     *cx,
                           JSScript      *script,
                           JSStackFrame  *fp);
 
 extern JSDProfileData*
 jsd_GetScriptProfileData(JSDContext* jsdc, JSDScript *script);
 
-extern uint32
+extern uint32_t
 jsd_GetScriptFlags(JSDContext *jsdc, JSDScript *script);
 
 extern void
-jsd_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32 flags);
+jsd_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32_t flags);
 
 extern uintN
 jsd_GetScriptCallCount(JSDContext* jsdc, JSDScript *script);
 
 extern  uintN
 jsd_GetScriptMaxRecurseDepth(JSDContext* jsdc, JSDScript *script);
 
 extern jsdouble
@@ -964,17 +964,17 @@ jsd_IsValueFunction(JSDContext* jsdc, JS
 extern JSBool
 jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval);
 
 /**************************************************/
 
 extern JSBool
 jsd_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval);
 
-extern int32
+extern int32_t
 jsd_GetValueInt(JSDContext* jsdc, JSDValue* jsdval);
 
 extern jsdouble
 jsd_GetValueDouble(JSDContext* jsdc, JSDValue* jsdval);
 
 extern JSString*
 jsd_GetValueString(JSDContext* jsdc, JSDValue* jsdval);
 
--- a/js/jsd/jsd_lock.c
+++ b/js/jsd/jsd_lock.c
@@ -61,17 +61,17 @@
 #endif
 
 struct JSDStaticLock
 {
     void*     owner;
     PRLock*   lock;
     int       count;
 #ifdef DEBUG
-    uint16    sig;
+    uint16_t  sig;
 #endif
 };
 
 /* 
  * This exists to wrap non-NSPR theads (e.g. Java threads) in NSPR wrappers.
  * XXX We ignore the memory leak issue.
  * It is claimed that future versions of NSPR will automatically wrap on 
  * the call to PR_GetCurrentThread.
@@ -98,17 +98,17 @@ JS_END_MACRO
 
 #ifdef DEBUG
 #define JSD_LOCK_SIG 0x10CC10CC
 void ASSERT_VALID_LOCK(JSDStaticLock* lock)
 {
     JS_ASSERT(lock);
     JS_ASSERT(lock->lock);
     JS_ASSERT(lock->count >= 0);
-    JS_ASSERT(lock->sig == (uint16) JSD_LOCK_SIG);
+    JS_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
 }    
 #else
 #define ASSERT_VALID_LOCK(x) ((void)0)
 #endif
 
 void*
 jsd_CreateLock()
 {
@@ -119,17 +119,17 @@ jsd_CreateLock()
     {
         if(lock)
         {
             free(lock);
             lock = NULL;
         }
     }
 #ifdef DEBUG
-    if(lock) lock->sig = (uint16) JSD_LOCK_SIG;
+    if(lock) lock->sig = (uint16_t) JSD_LOCK_SIG;
 #endif
     return lock;
 }    
 
 void
 jsd_Lock(JSDStaticLock* lock)
 {
     void* me;
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -332,24 +332,24 @@ JSDProfileData*
 jsd_GetScriptProfileData(JSDContext* jsdc, JSDScript *script)
 {
     if (!script->profileData)
         script->profileData = (JSDProfileData*)calloc(1, sizeof(JSDProfileData));
 
     return script->profileData;
 }
 
-uint32
+uint32_t
 jsd_GetScriptFlags(JSDContext *jsdc, JSDScript *script)
 {
     return script->flags;
 }
 
 void
-jsd_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32 flags)
+jsd_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32_t flags)
 {
     script->flags = flags;
 }
 
 uintN
 jsd_GetScriptCallCount(JSDContext* jsdc, JSDScript *script)
 {
     if (script->profileData)
--- a/js/jsd/jsd_step.c
+++ b/js/jsd/jsd_step.c
@@ -147,27 +147,27 @@ JSBool
                 JSDProfileData *pdata;
                 pdata = jsd_GetScriptProfileData (jsdc, jsdscript);
                 if (pdata)
                 {
                     if (before)
                     {
                         if (!pdata->lastCallStart)
                         {
-                            int64 now;
+                            int64_t now;
                             JSDProfileData *callerpdata;
                             
                             /* Get the time just the once, for consistency. */
                             now = JS_Now();
                             /* This contains a pointer to the profile data for
                              * the caller of this function. */
                             callerpdata = jsdc->callingFunctionPData;
                             if (callerpdata)
                             {
-                                int64 ll_delta;
+                                int64_t ll_delta;
                                 pdata->caller = callerpdata;
                                 /* We need to 'stop' the timer for the caller.
                                  * Use time since last return if appropriate. */
                                 ll_delta = jsdc->lastReturnTime
                                            ? now - jsdc->lastReturnTime
                                            : now - callerpdata->lastCallStart;
                                 callerpdata->runningTime += ll_delta;
                             }
@@ -181,17 +181,17 @@ JSBool
                             pdata->lastCallStart = now;
                         } else {
                             if (++pdata->recurseDepth > pdata->maxRecurseDepth)
                                 pdata->maxRecurseDepth = pdata->recurseDepth;
                         }
                         /* make sure we're called for the return too. */
                         hookresult = JS_TRUE;
                     } else if (!pdata->recurseDepth && pdata->lastCallStart) {
-                        int64 now, ll_delta;
+                        int64_t now, ll_delta;
                         jsdouble delta;
                         now = JS_Now();
                         ll_delta = now - pdata->lastCallStart;
                         delta = ll_delta;
                         delta /= 1000.0;
                         pdata->totalExecutionTime += delta;
                         /* minExecutionTime starts as 0, so we need to overwrite
                          * it on the first call always. */
--- a/js/jsd/jsd_val.c
+++ b/js/jsd/jsd_val.c
@@ -183,17 +183,17 @@ JSBool
 jsd_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval)
 {
     jsval val = jsdval->val;
     if(!JSVAL_IS_BOOLEAN(val))
         return JS_FALSE;
     return JSVAL_TO_BOOLEAN(val);
 }
 
-int32
+int32_t
 jsd_GetValueInt(JSDContext* jsdc, JSDValue* jsdval)
 {
     jsval val = jsdval->val;
     if(!JSVAL_IS_INT(val))
         return 0;
     return JSVAL_TO_INT(val);
 }
 
--- a/js/jsd/jsdebug.c
+++ b/js/jsd/jsdebug.c
@@ -128,29 +128,29 @@ JSD_GetContextPrivate(JSDContext *jsdc)
 JSD_PUBLIC_API(void)
 JSD_ClearAllProfileData(JSDContext *jsdc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     jsd_ClearAllProfileData(jsdc);    
 }
 
 JSD_PUBLIC_API(void)
-JSD_SetContextFlags(JSDContext *jsdc, uint32 flags)
+JSD_SetContextFlags(JSDContext *jsdc, uint32_t flags)
 {
-    uint32 oldFlags = jsdc->flags;
+    uint32_t oldFlags = jsdc->flags;
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     jsdc->flags = flags;
     if (flags & JSD_COLLECT_PROFILE_DATA) {
         /* Need to reenable our call hooks now */
         JS_SetExecuteHook(jsdc->jsrt, jsd_TopLevelCallHook, jsdc);
         JS_SetCallHook(jsdc->jsrt, jsd_FunctionCallHook, jsdc);
     }
 }
 
-JSD_PUBLIC_API(uint32)
+JSD_PUBLIC_API(uint32_t)
 JSD_GetContextFlags(JSDContext *jsdc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsdc->flags;
 }
     
 JSD_PUBLIC_API(JSDContext*)
 JSD_JSDContextForJSContext(JSContext* context)
@@ -177,25 +177,25 @@ JSD_UnlockScriptSubsystem(JSDContext* js
 
 JSD_PUBLIC_API(JSDScript*)
 JSD_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_IterateScripts(jsdc, iterp);
 }
 
-JSD_PUBLIC_API(uint32)
+JSD_PUBLIC_API(uint32_t)
 JSD_GetScriptFlags(JSDContext *jsdc, JSDScript *script)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_GetScriptFlags(jsdc, script);
 }
     
 JSD_PUBLIC_API(void)
-JSD_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32 flags)
+JSD_SetScriptFlags(JSDContext *jsdc, JSDScript *script, uint32_t flags)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     jsd_SetScriptFlags(jsdc, script, flags);
 }
 
 JSD_PUBLIC_API(uintN)
 JSD_GetScriptCallCount(JSDContext* jsdc, JSDScript *script)
 {
@@ -1097,17 +1097,17 @@ JSD_IsValueNative(JSDContext* jsdc, JSDV
 JSD_PUBLIC_API(JSBool)
 JSD_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
     return jsd_GetValueBoolean(jsdc, jsdval);
 }
 
-JSD_PUBLIC_API(int32)
+JSD_PUBLIC_API(int32_t)
 JSD_GetValueInt(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
     return jsd_GetValueInt(jsdc, jsdval);
 }
 
 JSD_PUBLIC_API(jsdouble)
--- a/js/jsd/jsdebug.h
+++ b/js/jsd/jsdebug.h
@@ -253,19 +253,19 @@ JSD_ClearAllProfileData(JSDContext* jsdc
 
 /*
 * 0x40 was formerly used to hook into object creation.
 */
 #define JSD_DISABLE_OBJECT_TRACE_RETIRED 0x40
 
 
 extern JSD_PUBLIC_API(void)
-JSD_SetContextFlags (JSDContext* jsdc, uint32 flags);
+JSD_SetContextFlags (JSDContext* jsdc, uint32_t flags);
 
-extern JSD_PUBLIC_API(uint32)
+extern JSD_PUBLIC_API(uint32_t)
 JSD_GetContextFlags (JSDContext* jsdc);     
 
 /*
 * Notify JSD that this JSContext is 'in use'. This allows JSD to hook the
 * ErrorReporter. For the most part this is done automatically whenever
 * events like script loading happen. But, it is a good idea to call this
 * from the embedding when new contexts come into use.
 */
@@ -393,21 +393,21 @@ JSD_GetJSFunction(JSDContext* jsdc, JSDS
 */
 #define JSD_SCRIPT_PROFILE_BIT 0x01
 /*
 * Determines whether or not to ignore breakpoints, etc. in this script.
 * The context flag JSD_DEBUG_WHEN_SET decides the logic.
 */
 #define JSD_SCRIPT_DEBUG_BIT   0x02
 
-extern JSD_PUBLIC_API(uint32)
+extern JSD_PUBLIC_API(uint32_t)
 JSD_GetScriptFlags(JSDContext *jsdc, JSDScript* jsdscript);
 
 extern JSD_PUBLIC_API(void)
-JSD_SetScriptFlags(JSDContext *jsdc, JSDScript* jsdscript, uint32 flags);
+JSD_SetScriptFlags(JSDContext *jsdc, JSDScript* jsdscript, uint32_t flags);
 
 /*
 * Set the private data for this script, returns previous value
 */
 extern JSD_PUBLIC_API(void *)
 JSD_SetScriptPrivate(JSDScript* jsdscript, void *data);
 
 /*
@@ -1278,20 +1278,20 @@ JSD_IsValueNative(JSDContext* jsdc, JSDV
 /*
 * Return JSBool value (does NOT do conversion).
 * *** new for version 1.1 ****
 */
 extern JSD_PUBLIC_API(JSBool)
 JSD_GetValueBoolean(JSDContext* jsdc, JSDValue* jsdval);
 
 /*
-* Return int32 value (does NOT do conversion).
+* Return int32_t value (does NOT do conversion).
 * *** new for version 1.1 ****
 */
-extern JSD_PUBLIC_API(int32)
+extern JSD_PUBLIC_API(int32_t)
 JSD_GetValueInt(JSDContext* jsdc, JSDValue* jsdval);
 
 /*
 * Return double value (does NOT do conversion).
 * *** new for version 1.1 ****
 */
 extern JSD_PUBLIC_API(jsdouble)
 JSD_GetValueDouble(JSDContext* jsdc, JSDValue* jsdval);
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -44,17 +44,17 @@
 #define jshashtable_h_
 
 #include "TemplateLib.h"
 #include "Utility.h"
 
 namespace js {
 
 /* Integral types for all hash functions. */
-typedef uint32 HashNumber;
+typedef uint32_t HashNumber;
 
 /*****************************************************************************/
 
 namespace detail {
 
 template <class T, class HashPolicy, class AllocPolicy>
 class HashTable;
 
@@ -152,19 +152,19 @@ class HashTable : private AllocPolicy
     };
 
     /* A Ptr that can be used to add a key after a failed lookup. */
     class AddPtr : public Ptr
     {
         friend class HashTable;
         HashNumber keyHash;
 #ifdef DEBUG
-        uint64 mutationCount;
+        uint64_t mutationCount;
 
-        AddPtr(Entry &entry, HashNumber hn, uint64 mutationCount)
+        AddPtr(Entry &entry, HashNumber hn, uint64_t mutationCount)
             : Ptr(entry), keyHash(hn), mutationCount(mutationCount) {}
 #else
         AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}
 #endif
       public:
         /* Leaves AddPtr uninitialized. */
         AddPtr() {}
     };
@@ -254,63 +254,63 @@ class HashTable : private AllocPolicy
             if (removed) {
                 table.checkUnderloaded();
                 removed = false;
             }
         }
     };
 
   private:
-    uint32      hashShift;      /* multiplicative hash shift */
-    uint32      entryCount;     /* number of entries in table */
-    uint32      gen;            /* entry storage generation number */
-    uint32      removedCount;   /* removed entry sentinels in table */
+    uint32_t    hashShift;      /* multiplicative hash shift */
+    uint32_t    entryCount;     /* number of entries in table */
+    uint32_t    gen;            /* entry storage generation number */
+    uint32_t    removedCount;   /* removed entry sentinels in table */
     Entry       *table;         /* entry storage */
 
     void setTableSizeLog2(unsigned sizeLog2) {
         hashShift = sHashBits - sizeLog2;
     }
 
 #ifdef DEBUG
     mutable struct Stats {
-        uint32          searches;       /* total number of table searches */
-        uint32          steps;          /* hash chain links traversed */
-        uint32          hits;           /* searches that found key */
-        uint32          misses;         /* searches that didn't find key */
-        uint32          addOverRemoved; /* adds that recycled a removed entry */
-        uint32          removes;        /* calls to remove */
-        uint32          removeFrees;    /* calls to remove that freed the entry */
-        uint32          grows;          /* table expansions */
-        uint32          shrinks;        /* table contractions */
-        uint32          compresses;     /* table compressions */
+        uint32_t        searches;       /* total number of table searches */
+        uint32_t        steps;          /* hash chain links traversed */
+        uint32_t        hits;           /* searches that found key */
+        uint32_t        misses;         /* searches that didn't find key */
+        uint32_t        addOverRemoved; /* adds that recycled a removed entry */
+        uint32_t        removes;        /* calls to remove */
+        uint32_t        removeFrees;    /* calls to remove that freed the entry */
+        uint32_t        grows;          /* table expansions */
+        uint32_t        shrinks;        /* table contractions */
+        uint32_t        compresses;     /* table compressions */
     } stats;
 #   define METER(x) x
 #else
 #   define METER(x)
 #endif
 
 #ifdef DEBUG
     friend class js::ReentrancyGuard;
     mutable bool entered;
-    uint64       mutationCount;
+    uint64_t     mutationCount;
 #endif
 
     /* The default initial capacity is 16, but you can ask for as small as 4. */
     static const unsigned sMinSizeLog2  = 2;
     static const unsigned sMinSize      = 1 << sMinSizeLog2;
     static const unsigned sDefaultInitSizeLog2 = 4;
   public:
     static const unsigned sDefaultInitSize = 1 << sDefaultInitSizeLog2;
   private:
     static const unsigned sMaxInit      = JS_BIT(23);
     static const unsigned sMaxCapacity  = JS_BIT(24);
     static const unsigned sHashBits     = tl::BitSize<HashNumber>::result;
-    static const uint8    sMinAlphaFrac = 64;  /* (0x100 * .25) taken from jsdhash.h */
-    static const uint8    sMaxAlphaFrac = 192; /* (0x100 * .75) taken from jsdhash.h */
-    static const uint8    sInvMaxAlpha  = 171; /* (ceil(0x100 / .75) >> 1) */
+    static const uint8_t  sMinAlphaFrac = 64;  /* (0x100 * .25) taken from jsdhash.h */
+    static const uint8_t  sMaxAlphaFrac = 192; /* (0x100 * .75) taken from jsdhash.h */
+    static const uint8_t  sInvMaxAlpha  = 171; /* (ceil(0x100 / .75) >> 1) */
     static const HashNumber sGoldenRatio  = 0x9E3779B9U;       /* taken from jsdhash.h */
     static const HashNumber sFreeKey = Entry::sFreeKey;
     static const HashNumber sRemovedKey = Entry::sRemovedKey;
     static const HashNumber sCollisionBit = Entry::sCollisionBit;
 
     static void staticAsserts()
     {
         /* Rely on compiler "constant overflow warnings". */
@@ -332,27 +332,27 @@ class HashTable : private AllocPolicy
         keyHash *= sGoldenRatio;
 
         /* Avoid reserved hash codes. */
         if (!isLiveHash(keyHash))
             keyHash -= (sRemovedKey + 1);
         return keyHash & ~sCollisionBit;
     }
 
-    static Entry *createTable(AllocPolicy &alloc, uint32 capacity)
+    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)
     {
         Entry *newTable = (Entry *)alloc.malloc_(capacity * sizeof(Entry));
         if (!newTable)
             return NULL;
         for (Entry *e = newTable, *end = e + capacity; e != end; ++e)
             new(e) Entry();
         return newTable;
     }
 
-    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32 capacity)
+    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)
     {
         for (Entry *e = oldTable, *end = e + capacity; e != end; ++e)
             e->~Entry();
         alloc.free_(oldTable);
     }
 
   public:
     HashTable(AllocPolicy ap)
@@ -363,36 +363,36 @@ class HashTable : private AllocPolicy
         removedCount(0),
         table(NULL)
 #ifdef DEBUG
         , entered(false),
         mutationCount(0)
 #endif
     {}
 
-    bool init(uint32 length)
+    bool init(uint32_t length)
     {
         /* Make sure that init isn't called twice. */
         JS_ASSERT(table == NULL);
 
         /*
          * Correct for sMaxAlphaFrac such that the table will not resize
          * when adding 'length' entries.
          */
         if (length > sMaxInit) {
             this->reportAllocOverflow();
             return false;
         }
-        uint32 capacity = (length * sInvMaxAlpha) >> 7;
+        uint32_t capacity = (length * sInvMaxAlpha) >> 7;
 
         if (capacity < sMinSize)
             capacity = sMinSize;
 
         /* FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034). */
-        uint32 roundUp = sMinSize, roundUpLog2 = sMinSizeLog2;
+        uint32_t roundUp = sMinSize, roundUpLog2 = sMinSizeLog2;
         while (roundUp < capacity) {
             roundUp <<= 1;
             ++roundUpLog2;
         }
 
         capacity = roundUp;
         JS_ASSERT(capacity <= sMaxCapacity);
 
@@ -412,30 +412,30 @@ class HashTable : private AllocPolicy
 
     ~HashTable()
     {
         if (table)
             destroyTable(*this, table, capacity());
     }
 
   private:
-    static HashNumber hash1(HashNumber hash0, uint32 shift) {
+    static HashNumber hash1(HashNumber hash0, uint32_t shift) {
         return hash0 >> shift;
     }
 
-    static HashNumber hash2(HashNumber hash0, uint32 log2, uint32 shift) {
+    static HashNumber hash2(HashNumber hash0, uint32_t log2, uint32_t shift) {
         return ((hash0 << log2) >> shift) | 1;
     }
 
     bool overloaded() {
         return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);
     }
 
     bool underloaded() {
-        uint32 tableCapacity = capacity();
+        uint32_t tableCapacity = capacity();
         return tableCapacity > sMinSize &&
                entryCount <= ((sMinAlphaFrac * tableCapacity) >> 8);
     }
 
     static bool match(Entry &e, const Lookup &l) {
         return HashPolicy::match(HashPolicy::getKey(e.t), l);
     }
 
@@ -541,19 +541,19 @@ class HashTable : private AllocPolicy
             }
         }
     }
 
     bool changeTableSize(int deltaLog2)
     {
         /* Look, but don't touch, until we succeed in getting new entry store. */
         Entry *oldTable = table;
-        uint32 oldCap = capacity();
-        uint32 newLog2 = sHashBits - hashShift + deltaLog2;
-        uint32 newCapacity = JS_BIT(newLog2);
+        uint32_t oldCap = capacity();
+        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;
+        uint32_t newCapacity = JS_BIT(newLog2);
         if (newCapacity > sMaxCapacity) {
             this->reportAllocOverflow();
             return false;
         }
 
         Entry *newTable = createTable(*this, newCapacity);
         if (!newTable)
             return false;
@@ -601,17 +601,17 @@ class HashTable : private AllocPolicy
     }
 
   public:
     void clear()
     {
         if (tl::IsPodType<Entry>::result) {
             memset(table, 0, sizeof(*table) * capacity());
         } else {
-            uint32 tableCapacity = capacity();
+            uint32_t tableCapacity = capacity();
             for (Entry *e = table, *end = table + tableCapacity; e != end; ++e)
                 *e = Move(Entry());
         }
         removedCount = 0;
         entryCount = 0;
 #ifdef DEBUG
         mutationCount++;
 #endif
@@ -637,25 +637,25 @@ class HashTable : private AllocPolicy
     Range all() const {
         return Range(table, table + capacity());
     }
 
     bool empty() const {
         return !entryCount;
     }
 
-    uint32 count() const {
+    uint32_t count() const {
         return entryCount;
     }
 
-    uint32 capacity() const {
+    uint32_t capacity() const {
         return JS_BIT(sHashBits - hashShift);
     }
 
-    uint32 generation() const {
+    uint32_t generation() const {
         return gen;
     }
 
     size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
         return mallocSizeOf(table, capacity() * sizeof(Entry));
     }
 
     size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
@@ -983,17 +983,17 @@ class HashMap
     Impl impl;
 
   public:
     /*
      * HashMap construction is fallible (due to OOM); thus the user must call
      * init after constructing a HashMap and check the return value.
      */
     HashMap(AllocPolicy a = AllocPolicy()) : impl(a) {}
-    bool init(uint32 len = Impl::sDefaultInitSize)    { return impl.init(len); }
+    bool init(uint32_t len = Impl::sDefaultInitSize)  { return impl.init(len); }
     bool initialized() const                          { return impl.initialized(); }
 
     /*
      * Return whether the given lookup value is present in the map. E.g.:
      *
      *   typedef HashMap<int,char> HM;
      *   HM h;
      *   if (HM::Ptr p = h.lookup(3)) {
@@ -1220,17 +1220,17 @@ class HashSet
     Impl impl;
 
   public:
     /*
      * HashSet construction is fallible (due to OOM); thus the user must call
      * init after constructing a HashSet and check the return value.
      */
     HashSet(AllocPolicy a = AllocPolicy()) : impl(a) {}
-    bool init(uint32 len = Impl::sDefaultInitSize)    { return impl.init(len); }
+    bool init(uint32_t len = Impl::sDefaultInitSize)  { return impl.init(len); }
     bool initialized() const                          { return impl.initialized(); }
 
     /*
      * Return whether the given lookup value is present in the map. E.g.:
      *
      *   typedef HashSet<int> HS;
      *   HS h;
      *   if (HS::Ptr p = h.lookup(3)) {
new file mode 100644
--- /dev/null
+++ b/js/public/LegacyIntTypes.h
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * This section typedefs the old 'native' types to the new <stdint.h> types.
+ * These redefinitions are provided solely to allow JSAPI users to more easily
+ * transition to <stdint.h> types.  They are not to be used in the JSAPI, and
+ * new JSAPI user code should not use them.  This mapping file may eventually
+ * be removed from SpiderMonkey, so don't depend on it in the long run.
+ */
+
+/*
+ * BEWARE: Comity with other implementers of these types is not guaranteed.
+ *         Indeed, if you use this header and third-party code defining these
+ *         types, *expect* to encounter either compile errors or link errors,
+ *         depending how these types are used and on the order of inclusion.
+ *         It is safest to use only the JSAPI <stdint.h>-style types,
+ *         customizing those types using MOZ_CUSTOM_STDINT_H if necessary.
+ */
+#ifndef PROTYPES_H
+#define PROTYPES_H
+
+#include "mozilla/StdInt.h"
+
+#include "js-config.h"
+
+typedef uint8_t uint8;
+typedef uint16_t uint16;
+typedef uint32_t uint32;
+typedef uint64_t uint64;
+
+/*
+ * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very
+ * common header file) defines the types int8, int16, int32, and int64.
+ * So we don't define these four types here to avoid conflicts in case
+ * the code also includes sys/types.h.
+ */
+#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)
+#include <sys/inttypes.h>
+#else
+typedef int8_t int8;
+typedef int16_t int16;
+typedef int32_t int32;
+typedef int64_t int64;
+#endif /* AIX && HAVE_SYS_INTTYPES_H */
+
+typedef uint8_t JSUint8;
+typedef uint16_t JSUint16;
+typedef uint32_t JSUint32;
+typedef uint64_t JSUint64;
+
+typedef int8_t JSInt8;
+typedef int16_t JSInt16;
+typedef int32_t JSInt32;
+typedef int64_t JSInt64;
+
+#endif /* !defined(PROTYPES_H) */
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -136,18 +136,18 @@ extern JS_PUBLIC_API(void) JS_Abort(void
 #if defined JS_USE_CUSTOM_ALLOCATOR
 # include "jscustomallocator.h"
 #else
 # ifdef DEBUG
 /*
  * In order to test OOM conditions, when the shell command-line option
  * |-A NUM| is passed, we fail continuously after the NUM'th allocation.
  */
-extern JS_PUBLIC_DATA(JSUint32) OOM_maxAllocations; /* set from shell/js.cpp */
-extern JS_PUBLIC_DATA(JSUint32) OOM_counter; /* data race, who cares. */
+extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set from shell/js.cpp */
+extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */
 #  define JS_OOM_POSSIBLY_FAIL() \
     do \
     { \
         if (OOM_counter++ >= OOM_maxAllocations) { \
             return NULL; \
         } \
     } while (0)
 
@@ -269,17 +269,17 @@ unsigned char _BitScanReverse64(unsigned
 # define JS_CEILING_LOG2(_log2,_n)                                            \
     JS_BEGIN_MACRO                                                            \
         unsigned int j_ = (unsigned int)(_n);                                 \
         (_log2) = (j_ <= 1 ? 0 : 32 - js_bitscan_clz32(j_ - 1));              \
     JS_END_MACRO
 #else
 # define JS_CEILING_LOG2(_log2,_n)                                            \
     JS_BEGIN_MACRO                                                            \
-        JSUint32 j_ = (JSUint32)(_n);                                         \
+        uint32_t j_ = (uint32_t)(_n);                                         \
         (_log2) = 0;                                                          \
         if ((j_) & ((j_)-1))                                                  \
             (_log2) += 1;                                                     \
         if ((j_) >> 16)                                                       \
             (_log2) += 16, (j_) >>= 16;                                       \
         if ((j_) >> 8)                                                        \
             (_log2) += 8, (j_) >>= 8;                                         \
         if ((j_) >> 4)                                                        \
@@ -305,17 +305,17 @@ unsigned char _BitScanReverse64(unsigned
  */
 # define JS_FLOOR_LOG2(_log2,_n)                                              \
     JS_BEGIN_MACRO                                                            \
         (_log2) = 31 - js_bitscan_clz32(((unsigned int)(_n)) | 1);            \
     JS_END_MACRO
 #else
 # define JS_FLOOR_LOG2(_log2,_n)                                              \
     JS_BEGIN_MACRO                                                            \
-        JSUint32 j_ = (JSUint32)(_n);                                         \
+        uint32_t j_ = (uint32_t)(_n);                                         \
         (_log2) = 0;                                                          \
         if ((j_) >> 16)                                                       \
             (_log2) += 16, (j_) >>= 16;                                       \
         if ((j_) >> 8)                                                        \
             (_log2) += 8, (j_) >>= 8;                                         \
         if ((j_) >> 4)                                                        \
             (_log2) += 4, (j_) >>= 4;                                         \
         if ((j_) >> 2)                                                        \
@@ -520,17 +520,17 @@ JS_END_EXTERN_C
     template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\
     QUALIFIERS T *new_(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\
         JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\
     }\
     static const int JSMinAlignment = 8;\
     template <class T>\
     QUALIFIERS T *array_new(size_t n) {\
         /* The length is stored just before the vector memory. */\
-        uint64 numBytes64 = uint64(JSMinAlignment) + uint64(sizeof(T)) * uint64(n);\
+        uint64_t numBytes64 = uint64_t(JSMinAlignment) + uint64_t(sizeof(T)) * uint64_t(n);\
         size_t numBytes = size_t(numBytes64);\
         if (numBytes64 != numBytes) {\
             JS_ASSERT(0);   /* we want to know if this happens in debug builds */\
             return NULL;\
         }\
         void *memory = ALLOCATOR(numBytes);\
         if (!memory)\
             return NULL;\
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -199,22 +199,20 @@ INSTALLED_HEADERS = \
 		jsdbgapi.h \
 		jsdhash.h \
 		jsfriendapi.h \
 		jsgc.h \
 		jscell.h \
 		jsgcchunk.h \
 		jsgcstats.h \
 		jshash.h \
-		jsinttypes.h \
 		jslock.h \
 		json.h \
 		jsopcode.tbl \
 		jsopcode.h \
-		jsotypes.h \
 		jsproxy.h \
 		jsprf.h \
 		jspropertycache.h \
 		jspropertytree.h \
 		jsproto.tbl \
 		jsprvtd.h \
 		jspubtd.h \
 		jsreflect.h \
@@ -260,18 +258,22 @@ EXPORTS_gc = \
 #       the js engine
 #
 VPATH		+= \
 		$(srcdir)/../public \
 		$(NULL)
 
 EXPORTS_NAMESPACES += js
 
+# If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so
+# that we ensure we don't over-expose our internal integer typedefs.  Note that
+# LegacyIntTypes.h below is deliberately exempted from this requirement.
 EXPORTS_js = \
 		HashTable.h \
+		LegacyIntTypes.h \
 		TemplateLib.h \
 		Utility.h \
 		Vector.h \
 		$(NULL)
 
 ###############################################
 # BEGIN include sources for low-level code shared with Gecko
 #
--- a/js/src/assembler/assembler/AbstractMacroAssembler.h
+++ b/js/src/assembler/assembler/AbstractMacroAssembler.h
@@ -243,19 +243,19 @@ public:
         }
 #endif
     };
 
     struct ImmDouble {
         union {
             struct {
 #if WTF_CPU_BIG_ENDIAN || WTF_CPU_MIDDLE_ENDIAN
-                uint32 msb, lsb;
+                uint32_t msb, lsb;
 #else
-                uint32 lsb, msb;
+                uint32_t lsb, msb;
 #endif
             } s;
             uint64_t u64;
             double d;
         } u;
 
         explicit ImmDouble(double d) {
             u.d = d;
--- a/js/src/assembler/assembler/LinkBuffer.h
+++ b/js/src/assembler/assembler/LinkBuffer.h
@@ -82,17 +82,17 @@ public:
         , m_size(0)
         , m_codeKind(kind)
 #ifndef NDEBUG
         , m_completed(false)
 #endif
     {
     }
 
-    LinkBuffer(uint8* ncode, size_t size, CodeKind kind)
+    LinkBuffer(uint8_t* ncode, size_t size, CodeKind kind)
         : m_executablePool(NULL)
         , m_code(ncode)
         , m_size(size)
         , m_codeKind(kind)
 #ifndef NDEBUG
         , m_completed(false)
 #endif
     {
--- a/js/src/assembler/assembler/MacroAssemblerARM.h
+++ b/js/src/assembler/assembler/MacroAssemblerARM.h
@@ -1208,27 +1208,27 @@ public:
         m_assembler.baseIndexFloatTransfer(false, false, src,
                                            address.base, address.index,
                                            address.scale, address.offset);
     }
     void storeFloat(ImmDouble imm, Address address)
     {
         union {
             float f;
-            uint32 u32;
+            uint32_t u32;
         } u;
         u.f = imm.u.d;
         store32(Imm32(u.u32), address);
     }
 
     void storeFloat(ImmDouble imm, BaseIndex address)
     {
         union {
             float f;
-            uint32 u32;
+            uint32_t u32;
         } u;
         u.f = imm.u.d;
         store32(Imm32(u.u32), address);
     }
 
     void addDouble(FPRegisterID src, FPRegisterID dest)
     {
         m_assembler.faddd_r(dest, dest, src);
--- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h
+++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h
@@ -159,18 +159,18 @@ public:
     bool operator!()
     {
         return !m_value;
     }
 
     ptrdiff_t operator -(const MacroAssemblerCodePtr &other) const
     {
         JS_ASSERT(m_value);
-        return reinterpret_cast<uint8 *>(m_value) -
-               reinterpret_cast<uint8 *>(other.m_value);
+        return reinterpret_cast<uint8_t *>(m_value) -
+               reinterpret_cast<uint8_t *>(other.m_value);
     }
 
 private:
     void* m_value;
 };
 
 // MacroAssemblerCodeRef:
 //
--- a/js/src/assembler/assembler/MacroAssemblerSparc.h
+++ b/js/src/assembler/assembler/MacroAssemblerSparc.h
@@ -1230,27 +1230,27 @@ namespace JSC {
                 m_assembler.stf_r(src, address.base, SparcRegisters::g3);
             }
         }
 
         void storeFloat(ImmDouble imm, Address address)
         {
             union {
                 float f;
-                uint32 u32;
+                uint32_t u32;
             } u;
             u.f = imm.u.d;
             store32(Imm32(u.u32), address);
         }
 
         void storeFloat(ImmDouble imm, BaseIndex address)
         {
             union {
                 float f;
-                uint32 u32;
+                uint32_t u32;
             } u;
             u.f = imm.u.d;
             store32(Imm32(u.u32), address);
         }
 
         void storeDouble(FPRegisterID src, BaseIndex address)
         {
             m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
--- a/js/src/assembler/assembler/MacroAssemblerX86Common.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h
@@ -540,27 +540,27 @@ public:
         ASSERT(isSSE2Present());
         m_assembler.movsd_mr(address.offset, address.base, address.index, address.scale, dest);
     }
 
     void storeFloat(ImmDouble imm, Address address)
     {
         union {
             float f;
-            uint32 u32;
+            uint32_t u32;
         } u;
         u.f = imm.u.d;
         store32(Imm32(u.u32), address);
     }
 
     void storeFloat(ImmDouble imm, BaseIndex address)
     {
         union {
             float f;
-            uint32 u32;
+            uint32_t u32;
         } u;
         u.f = imm.u.d;
         store32(Imm32(u.u32), address);
     }
 
     void storeDouble(FPRegisterID src, ImplicitAddress address)
     {
         ASSERT(isSSE2Present());
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -56,17 +56,17 @@ class RegExpMatchBuilder
     bool setProperty(JSAtom *name, Value v) {
         return !!js_DefineProperty(cx, array, ATOM_TO_JSID(name), &v,
                                    JS_PropertyStub, JS_StrictPropertyStub, JSPROP_ENUMERATE);
     }
 
   public:
     RegExpMatchBuilder(JSContext *cx, JSObject *array) : cx(cx), array(array) {}
 
-    bool append(uint32 index, Value v) {
+    bool append(uint32_t index, Value v) {
         JS_ASSERT(!array->getOps()->getElement);
         return !!js_DefineElement(cx, array, index, &v, JS_PropertyStub, JS_StrictPropertyStub,
                                   JSPROP_ENUMERATE);
     }
 
     bool setIndex(int index) {
         return setProperty(cx->runtime->atomState.indexAtom, Int32Value(index));
     }
@@ -410,21 +410,21 @@ DEFINE_STATIC_SETTER(static_input_setter
                      if (!JSVAL_IS_STRING(*vp) && !JS_ConvertValue(cx, *vp, JSTYPE_STRING, vp))
                          return false;
                      res->setPendingInput(JSVAL_TO_STRING(*vp)))
 DEFINE_STATIC_SETTER(static_multiline_setter,
                      if (!JSVAL_IS_BOOLEAN(*vp) && !JS_ConvertValue(cx, *vp, JSTYPE_BOOLEAN, vp))
                          return false;
                      res->setMultiline(cx, !!JSVAL_TO_BOOLEAN(*vp)))
 
-const uint8 REGEXP_STATIC_PROP_ATTRS    = JSPROP_PERMANENT | JSPROP_SHARED | JSPROP_ENUMERATE;
-const uint8 RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | JSPROP_READONLY;
+const uint8_t REGEXP_STATIC_PROP_ATTRS    = JSPROP_PERMANENT | JSPROP_SHARED | JSPROP_ENUMERATE;
+const uint8_t RO_REGEXP_STATIC_PROP_ATTRS = REGEXP_STATIC_PROP_ATTRS | JSPROP_READONLY;
 
-const uint8 HIDDEN_PROP_ATTRS = JSPROP_PERMANENT | JSPROP_SHARED;
-const uint8 RO_HIDDEN_PROP_ATTRS = HIDDEN_PROP_ATTRS | JSPROP_READONLY;
+const uint8_t HIDDEN_PROP_ATTRS = JSPROP_PERMANENT | JSPROP_SHARED;
+const uint8_t RO_HIDDEN_PROP_ATTRS = HIDDEN_PROP_ATTRS | JSPROP_READONLY;
 
 static JSPropertySpec regexp_static_props[] = {
     {"input",        0, REGEXP_STATIC_PROP_ATTRS,    static_input_getter, static_input_setter},
     {"multiline",    0, REGEXP_STATIC_PROP_ATTRS,    static_multiline_getter,
                                                      static_multiline_setter},
     {"lastMatch",    0, RO_REGEXP_STATIC_PROP_ATTRS, static_lastMatch_getter,    NULL},
     {"lastParen",    0, RO_REGEXP_STATIC_PROP_ATTRS, static_lastParen_getter,    NULL},
     {"leftContext",  0, RO_REGEXP_STATIC_PROP_ATTRS, static_leftContext_getter,  NULL},
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -180,20 +180,20 @@ namespace CData {
                             JSBool strict, jsval* vp);
   static JSBool Address(JSContext* cx, uintN argc, jsval* vp);
   static JSBool ReadString(JSContext* cx, uintN argc, jsval* vp);
   static JSBool ToSource(JSContext* cx, uintN argc, jsval* vp);
 }
 
 // Int64Base provides functions common to Int64 and UInt64.
 namespace Int64Base {
-  JSObject* Construct(JSContext* cx, JSObject* proto, JSUint64 data,
+  JSObject* Construct(JSContext* cx, JSObject* proto, uint64_t data,
     bool isUnsigned);
 
-  JSUint64 GetInt(JSContext* cx, JSObject* obj);
+  uint64_t GetInt(JSContext* cx, JSObject* obj);
 
   JSBool ToString(JSContext* cx, JSObject* obj, uintN argc, jsval* vp,
     bool isUnsigned);
 
   JSBool ToSource(JSContext* cx, JSObject* obj, uintN argc, jsval* vp,
     bool isUnsigned);
 
   static void Finalize(JSContext* cx, JSObject* obj);
@@ -750,17 +750,17 @@ InitInt64Class(JSContext* cx,
 }
 
 static JSBool
 AttachProtos(JSContext* cx, JSObject* proto, JSObject** protos)
 {
   // For a given 'proto' of [[Class]] "CTypeProto", attach each of the 'protos'
   // to the appropriate CTypeProtoSlot. (SLOT_UINT64PROTO is the last slot
   // of [[Class]] "CTypeProto" that we fill in this automated manner.)
-  for (JSUint32 i = 0; i <= SLOT_UINT64PROTO; ++i) {
+  for (uint32_t i = 0; i <= SLOT_UINT64PROTO; ++i) {
     if (!JS_SetReservedSlot(cx, proto, i, OBJECT_TO_JSVAL(protos[i])))
       return false;
   }
 
   return true;
 }
 
 JSBool
@@ -1025,44 +1025,44 @@ struct ConvertImpl {
     return TargetType(d);
   }
 };
 
 #ifdef _MSC_VER
 // MSVC can't perform double to unsigned __int64 conversion when the
 // double is greater than 2^63 - 1. Help it along a little.
 template<>
-struct ConvertImpl<JSUint64, jsdouble> {
-  static JS_ALWAYS_INLINE JSUint64 Convert(jsdouble d) {
+struct ConvertImpl<uint64_t, jsdouble> {
+  static JS_ALWAYS_INLINE uint64_t Convert(jsdouble d) {
     return d > 0x7fffffffffffffffui64 ?
-           JSUint64(d - 0x8000000000000000ui64) + 0x8000000000000000ui64 :
-           JSUint64(d);
+           uint64_t(d - 0x8000000000000000ui64) + 0x8000000000000000ui64 :
+           uint64_t(d);
   }
 };
 #endif
 
 // C++ doesn't guarantee that exact values are the only ones that will
 // round-trip. In fact, on some platforms, including SPARC, there are pairs of
-// values, a uint64 and a double, such that neither value is exactly
+// values, a uint64_t and a double, such that neither value is exactly
 // representable in the other type, but they cast to each other.
 #ifdef SPARC
 // Simulate x86 overflow behavior
 template<>
-struct ConvertImpl<JSUint64, jsdouble> {
-  static JS_ALWAYS_INLINE JSUint64 Convert(jsdouble d) {
+struct ConvertImpl<uint64_t, jsdouble> {
+  static JS_ALWAYS_INLINE uint64_t Convert(jsdouble d) {
     return d >= 0xffffffffffffffff ?
-           0x8000000000000000 : JSUint64(d);
+           0x8000000000000000 : uint64_t(d);
   }
 };
 
 template<>
-struct ConvertImpl<JSInt64, jsdouble> {
-  static JS_ALWAYS_INLINE JSInt64 Convert(jsdouble d) {
+struct ConvertImpl<int64_t, jsdouble> {
+  static JS_ALWAYS_INLINE int64_t Convert(jsdouble d) {
     return d >= 0x7fffffffffffffff ?
-           0x8000000000000000 : JSInt64(d);
+           0x8000000000000000 : int64_t(d);
   }
 };
 #endif
 
 template<class TargetType, class FromType>
 static JS_ALWAYS_INLINE TargetType Convert(FromType d)
 {
   return ConvertImpl<TargetType, FromType>::Convert(d);
@@ -1245,23 +1245,23 @@ jsvalToInteger(JSContext* cx, jsval val,
       case TYPE_struct:
         // Not a compatible number type.
         return false;
       }
     }
 
     if (Int64::IsInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSInt64 i = Int64Base::GetInt(cx, obj);
+      int64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
 
     if (UInt64::IsUInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSUint64 i = Int64Base::GetInt(cx, obj);
+      uint64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
 
     return false; 
   }
   if (JSVAL_IS_BOOLEAN(val)) {
     // Implicitly promote boolean values to 0 or 1, like C.
     *result = JSVAL_TO_BOOLEAN(val);
@@ -1417,23 +1417,23 @@ jsvalToBigInteger(JSContext* cx,
     return StringToInteger(cx, JSVAL_TO_STRING(val), result);
   }
   if (!JSVAL_IS_PRIMITIVE(val)) {
     // Allow conversion from an Int64 or UInt64 object directly.
     JSObject* obj = JSVAL_TO_OBJECT(val);
 
     if (UInt64::IsUInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSUint64 i = Int64Base::GetInt(cx, obj);
+      uint64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
 
     if (Int64::IsInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSInt64 i = Int64Base::GetInt(cx, obj);
+      int64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
   }
   return false;
 }
 
 // Implicitly convert val to a size value, where the size value is represented
 // by size_t but must also fit in a jsdouble.
@@ -1473,23 +1473,23 @@ jsidToBigInteger(JSContext* cx,
     return StringToInteger(cx, JSID_TO_STRING(val), result);
   }
   if (JSID_IS_OBJECT(val)) {
     // Allow conversion from an Int64 or UInt64 object directly.
     JSObject* obj = JSID_TO_OBJECT(val);
 
     if (UInt64::IsUInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSUint64 i = Int64Base::GetInt(cx, obj);
+      uint64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
 
     if (Int64::IsInt64(cx, obj)) {
       // Make sure the integer fits in IntegerType.
-      JSInt64 i = Int64Base::GetInt(cx, obj);
+      int64_t i = Int64Base::GetInt(cx, obj);
       return ConvertExact(i, result);
     }
   }
   return false;
 }
 
 // Implicitly convert val to a size value, where the size value is represented
 // by size_t but must also fit in a jsdouble.
@@ -1528,22 +1528,22 @@ jsvalToIntegerExplicit(JSContext* cx, js
     jsdouble d = JSVAL_TO_DOUBLE(val);
     *result = FloatIsFinite(d) ? IntegerType(d) : 0;
     return true;
   }
   if (!JSVAL_IS_PRIMITIVE(val)) {
     // Convert Int64 and UInt64 values by C-style cast.
     JSObject* obj = JSVAL_TO_OBJECT(val);
     if (Int64::IsInt64(cx, obj)) {
-      JSInt64 i = Int64Base::GetInt(cx, obj);
+      int64_t i = Int64Base::GetInt(cx, obj);
       *result = IntegerType(i);
       return true;
     }
     if (UInt64::IsUInt64(cx, obj)) {
-      JSUint64 i = Int64Base::GetInt(cx, obj);
+      uint64_t i = Int64Base::GetInt(cx, obj);
       *result = IntegerType(i);
       return true;
     }
   }
   return false;
 }
 
 // Forcefully convert val to a pointer value when explicitly requested.
@@ -1572,32 +1572,32 @@ jsvalToPtrExplicit(JSContext* cx, jsval 
     // Don't silently lose bits here -- check that val really is an
     // integer value, and has the right sign.
     *result = Convert<uintptr_t>(d);
     return jsdouble(*result) == d;
   }
   if (!JSVAL_IS_PRIMITIVE(val)) {
     JSObject* obj = JSVAL_TO_OBJECT(val);
     if (Int64::IsInt64(cx, obj)) {
-      JSInt64 i = Int64Base::GetInt(cx, obj);
+      int64_t i = Int64Base::GetInt(cx, obj);
       intptr_t p = intptr_t(i);
 
       // Make sure the integer fits in the alotted precision.
-      if (JSInt64(p) != i)
+      if (int64_t(p) != i)
         return false;
       *result = uintptr_t(p);
       return true;
     }
 
     if (UInt64::IsUInt64(cx, obj)) {
-      JSUint64 i = Int64Base::GetInt(cx, obj);
+      uint64_t i = Int64Base::GetInt(cx, obj);
 
       // Make sure the integer fits in the alotted precision.
       *result = uintptr_t(i);
-      return JSUint64(*result) == i;
+      return uint64_t(*result) == i;
     }
   }
   return false;
 }
 
 template<class IntegerType, class CharType, size_t N, class AP>
 void
 IntegerToString(IntegerType i, jsuint radix, Vector<CharType, N, AP>& result)
@@ -1679,24 +1679,24 @@ ConvertToJS(JSContext* cx,
       *result = INT_TO_JSVAL(jsint(value));                                    \
     else if (!JS_NewNumberValue(cx, jsdouble(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. */    \
-    JSUint64 value;                                                            \
+    uint64_t value;                                                            \
     JSObject* proto;                                                           \
     if (!numeric_limits<type>::is_signed) {                                    \
       value = *static_cast<type*>(data);                                       \
       /* Get ctypes.UInt64.prototype from ctypes.CType.prototype. */           \
       proto = CType::GetProtoFromType(cx, typeObj, SLOT_UINT64PROTO);          \
     } else {                                                                   \
-      value = JSInt64(*static_cast<type*>(data));                              \
+      value = int64_t(*static_cast<type*>(data));                              \
       /* Get ctypes.Int64.prototype from ctypes.CType.prototype. */            \
       proto = CType::GetProtoFromType(cx, typeObj, SLOT_INT64PROTO);           \
     }                                                                          \
                                                                                \
     JSObject* obj = Int64Base::Construct(cx, proto, value,                     \
       !numeric_limits<type>::is_signed);                                       \
     if (!obj)                                                                  \
       return false;                                                            \
@@ -4893,17 +4893,17 @@ NewFunctionInfo(JSContext* cx,
   if (!fninfo->mArgTypes.reserve(argLength) ||
       !fninfo->mFFITypes.reserve(argLength)) {
     JS_ReportOutOfMemory(cx);
     return NULL;
   }
 
   fninfo->mIsVariadic = false;
 
-  for (JSUint32 i = 0; i < argLength; ++i) {
+  for (uint32_t i = 0; i < argLength; ++i) {
     bool isEllipsis;
     if (!IsEllipsis(cx, argTypes[i], &isEllipsis))
       return NULL;
     if (isEllipsis) {
       fninfo->mIsVariadic = true;
       if (i < 1) {
         JS_ReportError(cx, "\"...\" may not be the first and only parameter "
                        "type of a variadic function declaration");
@@ -5123,17 +5123,17 @@ FunctionType::Call(JSContext* cx,
 
   typeObj = PointerType::GetBaseType(cx, typeObj);
   if (CType::GetTypeCode(cx, typeObj) != TYPE_function) {
     JS_ReportError(cx, "not a FunctionType.ptr");
     return false;
   }
 
   FunctionInfo* fninfo = GetFunctionInfo(cx, typeObj);
-  JSUint32 argcFixed = fninfo->mArgTypes.length();
+  uint32_t argcFixed = fninfo->mArgTypes.length();
 
   if ((!fninfo->mIsVariadic && argc != argcFixed) ||
       (fninfo->mIsVariadic && argc < argcFixed)) {
     JS_ReportError(cx, "Number of arguments does not match declaration");
     return false;
   }
 
   // Check if we have a Library object. If we do, make sure it's open.
@@ -5164,17 +5164,17 @@ FunctionType::Call(JSContext* cx,
     if (!fninfo->mFFITypes.resize(argc)) {
       JS_ReportOutOfMemory(cx);
       return false;
     }
 
     JSObject* obj;  // Could reuse obj instead of declaring a second
     JSObject* type; // JSObject*, but readability would suffer.
 
-    for (JSUint32 i = argcFixed; i < argc; ++i) {
+    for (uint32_t i = argcFixed; i < argc; ++i) {
       if (JSVAL_IS_PRIMITIVE(argv[i]) ||
           !CData::IsCData(cx, obj = JSVAL_TO_OBJECT(argv[i]))) {
         // Since we know nothing about the CTypes of the ... arguments,
         // they absolutely must be CData objects already.
         JS_ReportError(cx, "argument %d of type %s is not a CData object",
                        i, JS_GetTypeName(cx, JS_TypeOfValue(cx, argv[i])));
         return false;
       }
@@ -5552,17 +5552,17 @@ CClosure::ClosureStub(ffi_cif* cif, void
   // Set up an array for converted arguments.
   Array<jsval, 16> argv;
   if (!argv.appendN(JSVAL_VOID, cif->nargs)) {
     JS_ReportOutOfMemory(cx);
     return;
   }
 
   js::AutoArrayRooter roots(cx, argv.length(), argv.begin());
-  for (JSUint32 i = 0; i < cif->nargs; ++i) {
+  for (uint32_t i = 0; i < cif->nargs; ++i) {
     // Convert each argument, and have any CData objects created depend on
     // the existing buffers.
     if (!ConvertToJS(cx, fninfo->mArgTypes[i], NULL, args[i], false, false,
            &argv[i]))
       return;
   }
 
   // Call the JS function. 'thisObj' may be NULL, in which case the JS engine
@@ -6067,27 +6067,27 @@ CData::ToSource(JSContext* cx, uintN arg
 
 /*******************************************************************************
 ** Int64 and UInt64 implementation
 *******************************************************************************/
 
 JSObject*
 Int64Base::Construct(JSContext* cx,
                      JSObject* proto,
-                     JSUint64 data,
+                     uint64_t data,
                      bool isUnsigned)
 {
   JSClass* clasp = isUnsigned ? &sUInt64Class : &sInt64Class;
   JSObject* result = JS_NewObject(cx, clasp, proto, JS_GetParent(cx, proto));
   if (!result)
     return NULL;
   js::AutoObjectRooter root(cx, result);
 
   // attach the Int64's data
-  JSUint64* buffer = cx->new_<JSUint64>(data);
+  uint64_t* buffer = cx->new_<uint64_t>(data);
   if (!buffer) {
     JS_ReportOutOfMemory(cx);
     return NULL;
   }
 
   if (!JS_SetReservedSlot(cx, result, SLOT_INT64, PRIVATE_TO_JSVAL(buffer))) {
     Foreground::delete_(buffer);
     return NULL;
@@ -6101,26 +6101,26 @@ Int64Base::Construct(JSContext* cx,
 
 void
 Int64Base::Finalize(JSContext* cx, JSObject* obj)
 {
   jsval slot;
   if (!JS_GetReservedSlot(cx, obj, SLOT_INT64, &slot) || JSVAL_IS_VOID(slot))
     return;
 
-  cx->delete_(static_cast<JSUint64*>(JSVAL_TO_PRIVATE(slot)));
-}
-
-JSUint64
+  cx->delete_(static_cast<uint64_t*>(JSVAL_TO_PRIVATE(slot)));
+}
+
+uint64_t
 Int64Base::GetInt(JSContext* cx, JSObject* obj) {
   JS_ASSERT(Int64::IsInt64(cx, obj) || UInt64::IsUInt64(cx, obj));
 
   jsval slot;
   ASSERT_OK(JS_GetReservedSlot(cx, obj, SLOT_INT64, &slot));
-  return *static_cast<JSUint64*>(JSVAL_TO_PRIVATE(slot));
+  return *static_cast<uint64_t*>(JSVAL_TO_PRIVATE(slot));
 }
 
 JSBool
 Int64Base::ToString(JSContext* cx,
                     JSObject* obj,
                     uintN argc,
                     jsval* vp,
                     bool isUnsigned)
@@ -6140,17 +6140,17 @@ Int64Base::ToString(JSContext* cx,
       return JS_FALSE;
     }
   }
 
   AutoString intString;
   if (isUnsigned) {
     IntegerToString(GetInt(cx, obj), radix, intString);
   } else {
-    IntegerToString(static_cast<JSInt64>(GetInt(cx, obj)), radix, intString);
+    IntegerToString(static_cast<int64_t>(GetInt(cx, obj)), radix, intString);
   }
 
   JSString *result = NewUCString(cx, intString);
   if (!result)
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(result));
   return JS_TRUE;
@@ -6170,17 +6170,17 @@ Int64Base::ToSource(JSContext* cx,
 
   // Return a decimal string suitable for constructing the number.
   AutoString source;
   if (isUnsigned) {
     AppendString(source, "ctypes.UInt64(\"");
     IntegerToString(GetInt(cx, obj), 10, source);
   } else {
     AppendString(source, "ctypes.Int64(\"");
-    IntegerToString(static_cast<JSInt64>(GetInt(cx, obj)), 10, source);
+    IntegerToString(static_cast<int64_t>(GetInt(cx, obj)), 10, source);
   }
   AppendString(source, "\")");
 
   JSString *result = NewUCString(cx, source);
   if (!result)
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(result));
@@ -6194,17 +6194,17 @@ Int64::Construct(JSContext* cx,
 {
   // Construct and return a new Int64 object.
   if (argc != 1) {
     JS_ReportError(cx, "Int64 takes one argument");
     return JS_FALSE;
   }
 
   jsval* argv = JS_ARGV(cx, vp);
-  JSInt64 i = 0;
+  int64_t i = 0;
   if (!jsvalToBigInteger(cx, argv[0], true, &i))
     return TypeError(cx, "int64", argv[0]);
 
   // Get ctypes.Int64.prototype from the 'prototype' property of the ctor.
   jsval slot;
   ASSERT_OK(JS_GetProperty(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)),
     "prototype", &slot));
   JSObject* proto = JSVAL_TO_OBJECT(slot);
@@ -6259,46 +6259,46 @@ Int64::Compare(JSContext* cx, uintN argc
       !Int64::IsInt64(cx, JSVAL_TO_OBJECT(argv[1]))) {
     JS_ReportError(cx, "compare takes two Int64 arguments");
     return JS_FALSE;
   }
 
   JSObject* obj1 = JSVAL_TO_OBJECT(argv[0]);
   JSObject* obj2 = JSVAL_TO_OBJECT(argv[1]);
 
-  JSInt64 i1 = Int64Base::GetInt(cx, obj1);
-  JSInt64 i2 = Int64Base::GetInt(cx, obj2);
+  int64_t i1 = Int64Base::GetInt(cx, obj1);
+  int64_t i2 = Int64Base::GetInt(cx, obj2);
 
   if (i1 == i2)
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(0));
   else if (i1 < i2)
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(-1));
   else
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(1));
 
   return JS_TRUE;
 }
 
-#define LO_MASK ((JSUint64(1) << 32) - 1)
+#define LO_MASK ((uint64_t(1) << 32) - 1)
 #define INT64_LO(i) ((i) & LO_MASK)
 #define INT64_HI(i) ((i) >> 32)
 
 JSBool
 Int64::Lo(JSContext* cx, uintN argc, jsval* vp)
 {
   jsval* argv = JS_ARGV(cx, vp);
   if (argc != 1 || JSVAL_IS_PRIMITIVE(argv[0]) ||
       !Int64::IsInt64(cx, JSVAL_TO_OBJECT(argv[0]))) {
     JS_ReportError(cx, "lo takes one Int64 argument");
     return JS_FALSE;
   }
 
   JSObject* obj = JSVAL_TO_OBJECT(argv[0]);
-  JSInt64 u = Int64Base::GetInt(cx, obj);
-  jsdouble d = JSUint32(INT64_LO(u));
+  int64_t u = Int64Base::GetInt(cx, obj);
+  jsdouble d = uint32_t(INT64_LO(u));
 
   jsval result;
   if (!JS_NewNumberValue(cx, d, &result))
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, result);
   return JS_TRUE;
 }
@@ -6309,18 +6309,18 @@ Int64::Hi(JSContext* cx, uintN argc, jsv
   jsval* argv = JS_ARGV(cx, vp);
   if (argc != 1 || JSVAL_IS_PRIMITIVE(argv[0]) ||
       !Int64::IsInt64(cx, JSVAL_TO_OBJECT(argv[0]))) {
     JS_ReportError(cx, "hi takes one Int64 argument");
     return JS_FALSE;
   }
 
   JSObject* obj = JSVAL_TO_OBJECT(argv[0]);
-  JSInt64 u = Int64Base::GetInt(cx, obj);
-  jsdouble d = JSInt32(INT64_HI(u));
+  int64_t u = Int64Base::GetInt(cx, obj);
+  jsdouble d = int32_t(INT64_HI(u));
 
   jsval result;
   if (!JS_NewNumberValue(cx, d, &result))
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, result);
   return JS_TRUE;
 }
@@ -6329,24 +6329,24 @@ JSBool
 Int64::Join(JSContext* cx, uintN argc, jsval* vp)
 {
   if (argc != 2) {
     JS_ReportError(cx, "join takes two arguments");
     return JS_FALSE;
   }
 
   jsval* argv = JS_ARGV(cx, vp);
-  JSInt32 hi;
-  JSUint32 lo;
+  int32_t hi;
+  uint32_t lo;
   if (!jsvalToInteger(cx, argv[0], &hi))
     return TypeError(cx, "int32", argv[0]);
   if (!jsvalToInteger(cx, argv[1], &lo))
     return TypeError(cx, "uint32", argv[1]);
 
-  JSInt64 i = (JSInt64(hi) << 32) + JSInt64(lo);
+  int64_t i = (int64_t(hi) << 32) + int64_t(lo);
 
   // Get Int64.prototype from the function's reserved slot.
   JSObject* callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
 
   jsval slot = js::GetFunctionNativeReserved(callee, SLOT_FN_INT64PROTO);
   JSObject* proto = JSVAL_TO_OBJECT(slot);
   JS_ASSERT(JS_GET_CLASS(cx, proto) == &sInt64ProtoClass);
 
@@ -6365,17 +6365,17 @@ UInt64::Construct(JSContext* cx,
 {
   // Construct and return a new UInt64 object.
   if (argc != 1) {
     JS_ReportError(cx, "UInt64 takes one argument");
     return JS_FALSE;
   }
 
   jsval* argv = JS_ARGV(cx, vp);
-  JSUint64 u = 0;
+  uint64_t u = 0;
   if (!jsvalToBigInteger(cx, argv[0], true, &u))
     return TypeError(cx, "uint64", argv[0]);
 
   // Get ctypes.UInt64.prototype from the 'prototype' property of the ctor.
   jsval slot;
   ASSERT_OK(JS_GetProperty(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp)),
     "prototype", &slot));
   JSObject* proto = JSVAL_TO_OBJECT(slot);
@@ -6430,18 +6430,18 @@ UInt64::Compare(JSContext* cx, uintN arg
       !UInt64::IsUInt64(cx, JSVAL_TO_OBJECT(argv[1]))) {
     JS_ReportError(cx, "compare takes two UInt64 arguments");
     return JS_FALSE;
   }
 
   JSObject* obj1 = JSVAL_TO_OBJECT(argv[0]);
   JSObject* obj2 = JSVAL_TO_OBJECT(argv[1]);
 
-  JSUint64 u1 = Int64Base::GetInt(cx, obj1);
-  JSUint64 u2 = Int64Base::GetInt(cx, obj2);
+  uint64_t u1 = Int64Base::GetInt(cx, obj1);
+  uint64_t u2 = Int64Base::GetInt(cx, obj2);
 
   if (u1 == u2)
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(0));
   else if (u1 < u2)
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(-1));
   else
     JS_SET_RVAL(cx, vp, INT_TO_JSVAL(1));
 
@@ -6454,18 +6454,18 @@ UInt64::Lo(JSContext* cx, uintN argc, js
   jsval* argv = JS_ARGV(cx, vp);
   if (argc != 1 || JSVAL_IS_PRIMITIVE(argv[0]) ||
       !UInt64::IsUInt64(cx, JSVAL_TO_OBJECT(argv[0]))) {
     JS_ReportError(cx, "lo takes one UInt64 argument");
     return JS_FALSE;
   }
 
   JSObject* obj = JSVAL_TO_OBJECT(argv[0]);
-  JSUint64 u = Int64Base::GetInt(cx, obj);
-  jsdouble d = JSUint32(INT64_LO(u));
+  uint64_t u = Int64Base::GetInt(cx, obj);
+  jsdouble d = uint32_t(INT64_LO(u));
 
   jsval result;
   if (!JS_NewNumberValue(cx, d, &result))
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, result);
   return JS_TRUE;
 }
@@ -6476,18 +6476,18 @@ UInt64::Hi(JSContext* cx, uintN argc, js
   jsval* argv = JS_ARGV(cx, vp);
   if (argc != 1 || JSVAL_IS_PRIMITIVE(argv[0]) ||
       !UInt64::IsUInt64(cx, JSVAL_TO_OBJECT(argv[0]))) {
     JS_ReportError(cx, "hi takes one UInt64 argument");
     return JS_FALSE;
   }
 
   JSObject* obj = JSVAL_TO_OBJECT(argv[0]);
-  JSUint64 u = Int64Base::GetInt(cx, obj);
-  jsdouble d = JSUint32(INT64_HI(u));
+  uint64_t u = Int64Base::GetInt(cx, obj);
+  jsdouble d = uint32_t(INT64_HI(u));
 
   jsval result;
   if (!JS_NewNumberValue(cx, d, &result))
     return JS_FALSE;
 
   JS_SET_RVAL(cx, vp, result);
   return JS_TRUE;
 }
@@ -6496,24 +6496,24 @@ JSBool
 UInt64::Join(JSContext* cx, uintN argc, jsval* vp)
 {
   if (argc != 2) {
     JS_ReportError(cx, "join takes two arguments");
     return JS_FALSE;
   }
 
   jsval* argv = JS_ARGV(cx, vp);
-  JSUint32 hi;
-  JSUint32 lo;
+  uint32_t hi;
+  uint32_t lo;
   if (!jsvalToInteger(cx, argv[0], &hi))
     return TypeError(cx, "uint32_t", argv[0]);
   if (!jsvalToInteger(cx, argv[1], &lo))
     return TypeError(cx, "uint32_t", argv[1]);
 
-  JSUint64 u = (JSUint64(hi) << 32) + JSUint64(lo);
+  uint64_t u = (uint64_t(hi) << 32) + uint64_t(lo);
 
   // Get UInt64.prototype from the function's reserved slot.
   JSObject* callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
 
   jsval slot = js::GetFunctionNativeReserved(callee, SLOT_FN_INT64PROTO);
   JSObject* proto = JSVAL_TO_OBJECT(slot);
   JS_ASSERT(JS_GET_CLASS(cx, proto) == &sUInt64ProtoClass);
 
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -262,20 +262,20 @@ struct FieldInfo
 };
 
 // Hash policy for FieldInfos.
 struct FieldHashPolicy
 {
   typedef JSFlatString* Key;
   typedef Key Lookup;
 
-  static uint32 hash(const Lookup &l) {
+  static uint32_t hash(const Lookup &l) {
     const jschar* s = l->chars();
     size_t n = l->length();
-    uint32 hash = 0;
+    uint32_t hash = 0;
     for (; n > 0; s++, n--)
       hash = hash * 33 + *s;
     return hash;
   }
 
   static JSBool match(const Key &k, const Lookup &l) {
     if (k == l)
       return true;
--- a/js/src/ctypes/typedefs.h
+++ b/js/src/ctypes/typedefs.h
@@ -97,28 +97,28 @@
 #define CTYPES_FFI_ULONG     (sizeof(long)      == 4 ? ffi_type_uint32 : ffi_type_uint64)
 #define CTYPES_FFI_SIZE_T    (sizeof(size_t)    == 4 ? ffi_type_uint32 : ffi_type_uint64)
 #define CTYPES_FFI_SSIZE_T   (sizeof(size_t)    == 4 ? ffi_type_sint32 : ffi_type_sint64)
 #define CTYPES_FFI_INTPTR_T  (sizeof(uintptr_t) == 4 ? ffi_type_sint32 : ffi_type_sint64)
 #define CTYPES_FFI_UINTPTR_T (sizeof(uintptr_t) == 4 ? ffi_type_uint32 : ffi_type_uint64)
 
 // The meat.
 DEFINE_BOOL_TYPE       (bool,               bool,               CTYPES_FFI_BOOL)
-DEFINE_INT_TYPE        (int8_t,             JSInt8,             ffi_type_sint8)
-DEFINE_INT_TYPE        (int16_t,            JSInt16,            ffi_type_sint16)
-DEFINE_INT_TYPE        (int32_t,            JSInt32,            ffi_type_sint32)
-DEFINE_INT_TYPE        (uint8_t,            JSUint8,            ffi_type_uint8)
-DEFINE_INT_TYPE        (uint16_t,           JSUint16,           ffi_type_uint16)
-DEFINE_INT_TYPE        (uint32_t,           JSUint32,           ffi_type_uint32)
+DEFINE_INT_TYPE        (int8_t,             int8_t,             ffi_type_sint8)
+DEFINE_INT_TYPE        (int16_t,            int16_t,            ffi_type_sint16)
+DEFINE_INT_TYPE        (int32_t,            int32_t,            ffi_type_sint32)
+DEFINE_INT_TYPE        (uint8_t,            uint8_t,            ffi_type_uint8)
+DEFINE_INT_TYPE        (uint16_t,           uint16_t,           ffi_type_uint16)
+DEFINE_INT_TYPE        (uint32_t,           uint32_t,           ffi_type_uint32)
 DEFINE_INT_TYPE        (short,              short,              ffi_type_sint16)
 DEFINE_INT_TYPE        (unsigned_short,     unsigned short,     ffi_type_uint16)
 DEFINE_INT_TYPE        (int,                int,                ffi_type_sint32)
 DEFINE_INT_TYPE        (unsigned_int,       unsigned int,       ffi_type_uint32)
-DEFINE_WRAPPED_INT_TYPE(int64_t,            JSInt64,            ffi_type_sint64)
-DEFINE_WRAPPED_INT_TYPE(uint64_t,           JSUint64,           ffi_type_uint64)
+DEFINE_WRAPPED_INT_TYPE(int64_t,            int64_t,            ffi_type_sint64)
+DEFINE_WRAPPED_INT_TYPE(uint64_t,           uint64_t,           ffi_type_uint64)
 DEFINE_WRAPPED_INT_TYPE(long,               long,               CTYPES_FFI_LONG)
 DEFINE_WRAPPED_INT_TYPE(unsigned_long,      unsigned long,      CTYPES_FFI_ULONG)
 DEFINE_WRAPPED_INT_TYPE(long_long,          long long,          ffi_type_sint64)
 DEFINE_WRAPPED_INT_TYPE(unsigned_long_long, unsigned long long, ffi_type_uint64)
 DEFINE_WRAPPED_INT_TYPE(size_t,             size_t,             CTYPES_FFI_SIZE_T)
 DEFINE_WRAPPED_INT_TYPE(ssize_t,            CTYPES_SSIZE_T,     CTYPES_FFI_SSIZE_T)
 DEFINE_WRAPPED_INT_TYPE(intptr_t,           intptr_t,           CTYPES_FFI_INTPTR_T)
 DEFINE_WRAPPED_INT_TYPE(uintptr_t,          uintptr_t,          CTYPES_FFI_UINTPTR_T)
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -138,31 +138,31 @@ DefineGlobals(JSContext *cx, GlobalScope
                     return false;
             }
         }
 
         if (!JSScript::isValidOffset(outer->globalsOffset))
             continue;
 
         GlobalSlotArray *globalUses = outer->globals();
-        uint32 nGlobalUses = globalUses->length;
-        for (uint32 i = 0; i < nGlobalUses; i++) {
-            uint32 index = globalUses->vector[i].slot;
+        uint32_t nGlobalUses = globalUses->length;
+        for (uint32_t i = 0; i < nGlobalUses; i++) {
+            uint32_t index = globalUses->vector[i].slot;
             JS_ASSERT(index < globalScope.defs.length());
             globalUses->vector[i].slot = globalScope.defs[index].knownSlot;
         }
     }
 
     return true;
 }
 
 JSScript *
 frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerFrame,
                         JSPrincipals *principals, JSPrincipals *originPrincipals,
-                        uint32 tcflags,
+                        uint32_t tcflags,
                         const jschar *chars, size_t length,
                         const char *filename, uintN lineno, JSVersion version,
                         JSString *source /* = NULL */,
                         uintN staticLevel /* = 0 */)
 {
     TokenKind tt;
     ParseNode *pn;
     JSScript *script;
@@ -250,17 +250,17 @@ frontend::CompileScript(JSContext *cx, J
 #endif
         }
     }
 
     /*
      * Inline this->statements to emit as we go to save AST space. We must
      * generate our script-body blockid since we aren't calling Statements.
      */
-    uint32 bodyid;
+    uint32_t bodyid;
     if (!GenerateBlockId(&bce, bodyid))
         goto out;
     bce.bodyid = bodyid;
 
 #if JS_HAS_XML_SUPPORT
     pn = NULL;
     bool onlyXML;
     onlyXML = true;
--- a/js/src/frontend/BytecodeCompiler.h
+++ b/js/src/frontend/BytecodeCompiler.h
@@ -50,16 +50,16 @@ bool
 CompileFunctionBody(JSContext *cx, JSFunction *fun,
                     JSPrincipals *principals, JSPrincipals *originPrincipals,
                     Bindings *bindings, const jschar *chars, size_t length,
                     const char *filename, uintN lineno, JSVersion version);
 
 JSScript *
 CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerFrame,
               JSPrincipals *principals, JSPrincipals *originPrincipals,
-              uint32 tcflags, const jschar *chars, size_t length,
+              uint32_t tcflags, const jschar *chars, size_t length,
               const char *filename, uintN lineno, JSVersion version,
               JSString *source = NULL, uintN staticLevel = 0);
 
 } /* namespace frontend */
 } /* namespace js */
 
 #endif /* BytecodeCompiler_h__ */
--- a/js/src/frontend/BytecodeEmitter-inl.h
+++ b/js/src/frontend/BytecodeEmitter-inl.h
@@ -55,17 +55,17 @@ TreeContext::TreeContext(Parser *prs)
     innermostWith(NULL), bindings(prs->context), sharpSlotBase(-1)
 {
     prs->tc = this;
 }
 
 /*
  * For functions the tree context is constructed and destructed a second
  * time during code generation. To avoid a redundant stats update in such
- * cases, we store uint16(-1) in maxScopeDepth.
+ * cases, we store UINT16_MAX in maxScopeDepth.
  */
 inline
 TreeContext::~TreeContext()
 {
     parser->tc = this->parent;
 }
 
 } /* namespace js */
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -294,17 +294,17 @@ frontend::Emit3(JSContext *cx, BytecodeE
         next[2] = op2;
         bce->current->next = next + 3;
         UpdateDepth(cx, bce, offset);
     }
     return offset;
 }
 
 ptrdiff_t
-frontend::Emit5(JSContext *cx, BytecodeEmitter *bce, JSOp op, uint16 op1, uint16 op2)
+frontend::Emit5(JSContext *cx, BytecodeEmitter *bce, JSOp op, uint16_t op1, uint16_t op2)
 {
     ptrdiff_t offset = EmitCheck(cx, bce, 5);
 
     if (offset >= 0) {
         jsbytecode *next = bce->next();
         next[0] = (jsbytecode)op;
         next[1] = UINT16_HI(op1);
         next[2] = UINT16_LO(op1);
@@ -819,17 +819,17 @@ FreeJumpTargets(BytecodeEmitter *bce, Ju
 static JSBool
 OptimizeSpanDeps(JSContext *cx, BytecodeEmitter *bce)
 {
     jsbytecode *pc, *oldpc, *base, *limit, *next;
     SpanDep *sd, *sd2, *sdbase, *sdlimit, *sdtop, guard;
     ptrdiff_t offset, growth, delta, top, pivot, span, length, target;
     JSBool done;
     JSOp op;
-    uint32 type;
+    uint32_t type;
     jssrcnote *sn, *snlimit;
     JSSrcNoteSpec *spec;
     uintN i, n, noteIndex;
     TryNode *tryNode;
     DebugOnly<int> passes = 0;
 
     base = bce->base();
     sdbase = bce->spanDeps;
@@ -1342,17 +1342,17 @@ frontend::SetStaticLevel(TreeContext *tc
                              JSMSG_TOO_DEEP, js_function_str);
         return false;
     }
     tc->staticLevel = staticLevel;
     return true;
 }
 
 bool
-frontend::GenerateBlockId(TreeContext *tc, uint32& blockid)
+frontend::GenerateBlockId(TreeContext *tc, uint32_t &blockid)
 {
     if (tc->blockidGen == JS_BIT(20)) {
         JS_ReportErrorNumber(tc->parser->context, js_GetErrorMessage, NULL,
                              JSMSG_NEED_DIET, "program");
         return false;
     }
     blockid = tc->blockidGen++;
     return true;
@@ -1472,17 +1472,17 @@ CheckTypeSet(JSContext *cx, BytecodeEmit
 {
     if (js_CodeSpec[op].format & JOF_TYPESET) {
         if (bce->typesetCount < UINT16_MAX)
             bce->typesetCount++;
     }
 }
 
 /*
- * Macro to emit a bytecode followed by a uint16 immediate operand stored in
+ * Macro to emit a bytecode followed by a uint16_t immediate operand stored in
  * big-endian order, used for arg and var numbers as well as for atomIndexes.
  * NB: We use cx and bce from our caller's lexical environment, and return
  * false on error.
  */
 #define EMIT_UINT16_IMM_OP(op, i)                                             \
     JS_BEGIN_MACRO                                                            \
         if (Emit3(cx, bce, op, UINT16_HI(i), UINT16_LO(i)) < 0)               \
             return JS_FALSE;                                                  \
@@ -1991,17 +1991,17 @@ EmitEnterBlock(JSContext *cx, ParseNode 
         if (v.isUndefined()) {
             JS_ASSERT(slot + 1 <= limit);
             continue;
         }
 
         Definition *dn = (Definition *) v.toPrivate();
         JS_ASSERT(dn->isDefn());
         JS_ASSERT(uintN(dn->frameSlot() + depth) < JS_BIT(16));
-        dn->pn_cookie.set(dn->pn_cookie.level(), uint16(dn->frameSlot() + depth));
+        dn->pn_cookie.set(dn->pn_cookie.level(), uint16_t(dn->frameSlot() + depth));
 #ifdef DEBUG
         for (ParseNode *pnu = dn->dn_uses; pnu; pnu = pnu->pn_link) {
             JS_ASSERT(pnu->pn_lexdef == dn);
             JS_ASSERT(!(pnu->pn_dflags & PND_BOUND));
             JS_ASSERT(pnu->pn_cookie.isFree());
         }
 #endif
 
@@ -2324,17 +2324,17 @@ BindNameToSlot(JSContext *cx, BytecodeEm
             return JS_FALSE;
 
         pn->setOp(op);
         pn->pn_dflags |= PND_BOUND;
 
         return JS_TRUE;
     }
 
-    uint16 level = cookie.level();
+    uint16_t level = cookie.level();
     JS_ASSERT(bce->staticLevel >= level);
 
     const uintN skip = bce->staticLevel - level;
     if (skip != 0) {
         JS_ASSERT(bce->inFunction());
         JS_ASSERT_IF(cookie.slot() != UpvarCookie::CALLEE_SLOT, bce->roLexdeps->lookup(atom));
         JS_ASSERT(JOF_OPTYPE(op) == JOF_ATOM);
 
@@ -2503,29 +2503,29 @@ BindNameToSlot(JSContext *cx, BytecodeEm
     JS_ASSERT(!pn->isOp(op));
     pn->setOp(op);
     pn->pn_cookie.set(0, cookie.slot());
     pn->pn_dflags |= PND_BOUND;
     return JS_TRUE;
 }
 
 bool
-BytecodeEmitter::addGlobalUse(JSAtom *atom, uint32 slot, UpvarCookie *cookie)
+BytecodeEmitter::addGlobalUse(JSAtom *atom, uint32_t slot, UpvarCookie *cookie)
 {
     if (!globalMap.ensureMap(context()))
         return false;
 
     AtomIndexAddPtr p = globalMap->lookupForAdd(atom);
     if (p) {
         jsatomid index = p.value();
         cookie->set(0, index);
         return true;
     }
 
-    /* Don't bother encoding indexes >= uint16 */
+    /* Don't bother encoding indexes >= uint16_t */
     if (globalUses.length() >= UINT16_LIMIT) {
         cookie->makeFree();
         return true;
     }
 
     /* Find or add an existing atom table entry. */
     jsatomid allAtomIndex;
     if (!makeAtomIndex(atom, &allAtomIndex))
@@ -3167,29 +3167,29 @@ EmitElemIncDec(JSContext *cx, ParseNode 
 
     return true;
 }
 
 static JSBool
 EmitNumberOp(JSContext *cx, jsdouble dval, BytecodeEmitter *bce)
 {
     int32_t ival;
-    uint32 u;
+    uint32_t u;
     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)ival == ival)
-            return Emit2(cx, bce, JSOP_INT8, (jsbytecode)(int8)ival) >= 0;
-
-        u = (uint32)ival;
+        if ((jsint)(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)
                 return JS_FALSE;
             pc = bce->code(off);
             SET_UINT24(pc, u);
@@ -3275,17 +3275,17 @@ class TempPopScope {
 
 static JSBool
 EmitSwitch(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
     JSOp switchOp;
     JSBool ok, hasDefault, constPropagated;
     ptrdiff_t top, off, defaultOffset;
     ParseNode *pn2, *pn3, *pn4;
-    uint32 caseCount, tableLength;
+    uint32_t caseCount, tableLength;
     ParseNode **table;
     int32_t i, low, high;
     intN noteIndex;
     size_t switchSize, tableSize;
     jsbytecode *pc, *savepc;
 #if JS_HAS_BLOCK_SCOPE
     ObjectBox *box;
 #endif
@@ -3374,17 +3374,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
          (hasDefault = (pn2->pn_head->isKind(PNK_DEFAULT))))) {
         caseCount = 0;
         low = 0;
         high = -1;
     } else {
 #define INTMAP_LENGTH   256
         jsbitmap intmap_space[INTMAP_LENGTH];
         jsbitmap *intmap = NULL;
-        int32 intmap_bitlen = 0;
+        int32_t intmap_bitlen = 0;
 
         low  = JSVAL_INT_MAX;
         high = JSVAL_INT_MIN;
 
         for (pn3 = pn2->pn_head; pn3; pn3 = pn3->pn_next) {
             if (pn3->isKind(PNK_DEFAULT)) {
                 hasDefault = JS_TRUE;
                 caseCount--;    /* one of the "cases" was the default */
@@ -3503,17 +3503,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
         if (!ok)
             return JS_FALSE;
 
         /*
          * Compute table length and select lookup instead if overlarge or
          * more than half-sparse.
          */
         if (switchOp == JSOP_TABLESWITCH) {
-            tableLength = (uint32)(high - low + 1);
+            tableLength = (uint32_t)(high - low + 1);
             if (tableLength >= JS_BIT(16) || tableLength > 2 * caseCount)
                 switchOp = JSOP_LOOKUPSWITCH;
         } else if (switchOp == JSOP_LOOKUPSWITCH) {
             /*
              * Lookup switch supports only atom indexes below 64K limit.
              * Conservatively estimate the maximum possible index during
              * switch generation and use conditional switch if it exceeds
              * the limit.
@@ -3643,17 +3643,17 @@ EmitSwitch(JSContext *cx, BytecodeEmitte
                 if (!table)
                     return JS_FALSE;
                 memset(table, 0, tableSize);
                 for (pn3 = pn2->pn_head; pn3; pn3 = pn3->pn_next) {
                     if (pn3->isKind(PNK_DEFAULT))
                         continue;
                     i = pn3->pn_pval->toInt32();
                     i -= low;
-                    JS_ASSERT((uint32)i < tableLength);
+                    JS_ASSERT((uint32_t)i < tableLength);
                     table[i] = pn3;
                 }
             }
         } else {
             JS_ASSERT(switchOp == JSOP_LOOKUPSWITCH);
 
             /* Fill in the number of cases. */
             SET_INDEX(pc, caseCount);
@@ -4696,17 +4696,17 @@ EmitNewInit(JSContext *cx, BytecodeEmitt
     } else {
         JS_ASSERT(sharpnum < 0);
     }
 #endif
     return true;
 }
 
 static bool
-EmitEndInit(JSContext *cx, BytecodeEmitter *bce, uint32 count)
+EmitEndInit(JSContext *cx, BytecodeEmitter *bce, uint32_t count)
 {
 #if JS_HAS_SHARP_VARS
     /* Emit an op for sharp array cleanup and decompilation. */
     if (bce->hasSharps() && count != 0)
         EMIT_UINT16_IMM_OP(JSOP_SHARPINIT, bce->sharpSlotBase);
 #endif
     return Emit1(cx, bce, JSOP_ENDINIT) >= 0;
 }
@@ -5316,17 +5316,17 @@ EmitXMLTag(JSContext *cx, BytecodeEmitte
     ParseNode *pn2 = pn->pn_head;
     if (pn2->isKind(PNK_XMLCURLYEXPR) && Emit1(cx, bce, JSOP_STARTXMLEXPR) < 0)
         return false;
     if (!EmitTree(cx, bce, pn2))
         return false;
     if (Emit1(cx, bce, JSOP_ADD) < 0)
         return false;
 
-    uint32 i;
+    uint32_t i;
     for (pn2 = pn2->pn_next, i = 0; pn2; pn2 = pn2->pn_next, i++) {
         if (pn2->isKind(PNK_XMLCURLYEXPR) && Emit1(cx, bce, JSOP_STARTXMLEXPR) < 0)
             return false;
         if (!EmitTree(cx, bce, pn2))
             return false;
         if ((i & 1) && pn2->isKind(PNK_XMLCURLYEXPR)) {
             if (Emit1(cx, bce, JSOP_TOATTRVAL) < 0)
                 return false;
@@ -5517,17 +5517,17 @@ EmitForIn(JSContext *cx, BytecodeEmitter
     }
 
     /*
      * Emit a bytecode to convert top of stack value to the iterator
      * object depending on the loop variant (for-in, for-each-in, or
      * destructuring for-in).
      */
     JS_ASSERT(pn->isOp(JSOP_ITER));
-    if (Emit2(cx, bce, JSOP_ITER, (uint8) pn->pn_iflags) < 0)
+    if (Emit2(cx, bce, JSOP_ITER, (uint8_t) pn->pn_iflags) < 0)
         return false;
 
     /* Annotate so the decompiler can find the loop-closing jump. */
     intN noteIndex = NewSrcNote(cx, bce, SRC_FOR_IN);
     if (noteIndex < 0)
         return false;
 
     /*
@@ -6372,17 +6372,17 @@ EmitCallOrNew(JSContext *cx, BytecodeEmi
     for (ParseNode *pn3 = pn2->pn_next; pn3; pn3 = pn3->pn_next) {
         if (!EmitTree(cx, bce, pn3))
             return false;
     }
     bce->flags |= oldflags & TCF_IN_FOR_INIT;
     if (NewSrcNote2(cx, bce, SRC_PCBASE, bce->offset() - off) < 0)
         return false;
 
-    uint32 argc = pn->pn_count - 1;
+    uint32_t argc = pn->pn_count - 1;
     if (Emit3(cx, bce, pn->getOp(), ARGC_HI(argc), ARGC_LO(argc)) < 0)
         return false;
     CheckTypeSet(cx, bce, pn->getOp());
     if (pn->isOp(JSOP_EVAL)) {
         EMIT_UINT16_IMM_OP(JSOP_LINENO, pn->pn_pos.begin.lineno);
         if (EmitBlockChain(cx, bce) < 0)
             return false;
     }
@@ -6772,17 +6772,17 @@ EmitObject(JSContext *cx, BytecodeEmitte
          * The object survived and has a predictable shape.  Update the original bytecode,
          * as long as we can do so without using a big index prefix/suffix.
          */
         ObjectBox *objbox = bce->parser->newObjectBox(obj);
         if (!objbox)
             return false;
         uintN index = bce->objectList.index(objbox);
         if (FitsWithoutBigIndex(index))
-            EMIT_UINT16_IN_PLACE(offset, JSOP_NEWOBJECT, uint16(index));
+            EMIT_UINT16_IN_PLACE(offset, JSOP_NEWOBJECT, uint16_t(index));
     }
 
     return true;
 }
 
 static bool
 EmitArray(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, jsint sharpnum)
 {
@@ -6802,17 +6802,17 @@ EmitArray(JSContext *cx, BytecodeEmitter
 
         /*
          * Pass the new array's stack index to the PNK_ARRAYPUSH case via
          * bce->arrayCompDepth, then simply traverse the PNK_FOR node and
          * its kids under pn2 to generate this comprehension.
          */
         JS_ASSERT(bce->stackDepth > 0);
         uintN saveDepth = bce->arrayCompDepth;
-        bce->arrayCompDepth = (uint32) (bce->stackDepth - 1);
+        bce->arrayCompDepth = (uint32_t) (bce->stackDepth - 1);
         if (!EmitTree(cx, bce, pn->pn_head))
             return false;
         bce->arrayCompDepth = saveDepth;
 
         /* Emit the usual op needed for decompilation. */
         if (!EmitEndInit(cx, bce, 1))
             return false;
         return true;
@@ -7671,17 +7671,17 @@ SetSrcNoteOffset(JSContext *cx, Bytecode
 }
 
 #ifdef DEBUG_notme
 #define DEBUG_srcnotesize
 #endif
 
 #ifdef DEBUG_srcnotesize
 #define NBINS 10
-static uint32 hist[NBINS];
+static uint32_t hist[NBINS];
 
 static void
 DumpSrcNoteSizeHist()
 {
     static FILE *fp;
     int i, n;
 
     if (!fp) {
@@ -7763,31 +7763,31 @@ frontend::FinishTakingSrcNotes(JSContext
 
     return true;
 }
 
 static JSBool
 NewTryNote(JSContext *cx, BytecodeEmitter *bce, JSTryNoteKind kind, uintN stackDepth, size_t start,
            size_t end)
 {
-    JS_ASSERT((uintN)(uint16)stackDepth == stackDepth);
+    JS_ASSERT((uintN)(uint16_t)stackDepth == stackDepth);
     JS_ASSERT(start <= end);
-    JS_ASSERT((size_t)(uint32)start == start);
-    JS_ASSERT((size_t)(uint32)end == end);
+    JS_ASSERT((size_t)(uint32_t)start == start);
+    JS_ASSERT((size_t)(uint32_t)end == end);
 
     TryNode *tryNode = cx->tempLifoAlloc().new_<TryNode>();
     if (!tryNode) {
         js_ReportOutOfMemory(cx);
         return JS_FALSE;
     }
 
     tryNode->note.kind = kind;
-    tryNode->note.stackDepth = (uint16)stackDepth;
-    tryNode->note.start = (uint32)start;
-    tryNode->note.length = (uint32)(end - start);
+    tryNode->note.stackDepth = (uint16_t)stackDepth;
+    tryNode->note.start = (uint32_t)start;
+    tryNode->note.length = (uint32_t)(end - start);
     tryNode->prev = bce->lastTryNode;
     bce->lastTryNode = tryNode;
     bce->ntrynotes++;
     return JS_TRUE;
 }
 
 void
 frontend::FinishTakingTryNotes(BytecodeEmitter *bce, JSTryNoteArray *array)
@@ -7934,14 +7934,14 @@ js_GetSrcNoteOffset(jssrcnote *sn, uintN
     /* Find the offset numbered which (i.e., skip exactly which offsets). */
     JS_ASSERT(SN_TYPE(sn) != SRC_XDELTA);
     JS_ASSERT((intN) which < js_SrcNoteSpec[SN_TYPE(sn)].arity);
     for (sn++; which; sn++, which--) {
         if (*sn & SN_3BYTE_OFFSET_FLAG)
             sn += 2;
     }
     if (*sn & SN_3BYTE_OFFSET_FLAG) {
-        return (ptrdiff_t)(((uint32)(sn[0] & SN_3BYTE_OFFSET_MASK) << 16)
+        return (ptrdiff_t)(((uint32_t)(sn[0] & SN_3BYTE_OFFSET_MASK) << 16)
                            | (sn[1] << 8)
                            | sn[2]);
     }
     return (ptrdiff_t)*sn;
 }
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -81,17 +81,21 @@ enum StmtType {
     STMT_SUBROUTINE,            /* gosub-target subroutine body */
     STMT_DO_LOOP,               /* do/while loop statement */
     STMT_FOR_LOOP,              /* for loop statement */
     STMT_FOR_IN_LOOP,           /* for/in loop statement */
     STMT_WHILE_LOOP,            /* while loop statement */
     STMT_LIMIT
 };
 
-#define STMT_TYPE_IN_RANGE(t,b,e) ((uint)((t) - (b)) <= (uintN)((e) - (b)))
+inline bool
+STMT_TYPE_IN_RANGE(uint16_t type, StmtType begin, StmtType end)
+{
+    return begin <= type && type <= end;
+}
 
 /*
  * A comment on the encoding of the js::StmtType enum and type-testing macros:
  *
  * STMT_TYPE_MAYBE_SCOPE tells whether a statement type is always, or may
  * become, a lexical scope.  It therefore includes block and switch (the two
  * low-numbered "maybe" scope types) and excludes with (with has dynamic scope
  * pending the "reformed with" in ES4/JS2).  It includes all try-catch-finally
@@ -121,19 +125,19 @@ enum StmtType {
 
 #define STMT_MAYBE_SCOPE(stmt)  STMT_TYPE_MAYBE_SCOPE((stmt)->type)
 #define STMT_LINKS_SCOPE(stmt)  (STMT_TYPE_LINKS_SCOPE((stmt)->type) ||       \
                                  ((stmt)->flags & SIF_SCOPE))
 #define STMT_IS_TRYING(stmt)    STMT_TYPE_IS_TRYING((stmt)->type)
 #define STMT_IS_LOOP(stmt)      STMT_TYPE_IS_LOOP((stmt)->type)
 
 struct StmtInfo {
-    uint16          type;           /* statement type */
-    uint16          flags;          /* flags, see below */
-    uint32          blockid;        /* for simplified dominance computation */
+    uint16_t        type;           /* statement type */
+    uint16_t        flags;          /* flags, see below */
+    uint32_t        blockid;        /* for simplified dominance computation */
     ptrdiff_t       update;         /* loop update offset (top if none) */
     ptrdiff_t       breaks;         /* offset of last break in loop */
     ptrdiff_t       continues;      /* offset of last continue in loop */
     union {
         JSAtom      *label;         /* name of LABEL */
         ObjectBox   *blockBox;      /* block scope object */
     };
     StmtInfo        *down;          /* info for enclosing statement */
@@ -279,24 +283,24 @@ struct StmtInfo {
                                  TCF_FUN_MIGHT_ALIAS_LOCALS |                 \
                                  TCF_FUN_MUTATES_PARAMETER |                  \
                                  TCF_STRICT_MODE_CODE    |                    \
                                  TCF_FUN_EXTENSIBLE_SCOPE)
 
 struct BytecodeEmitter;
 
 struct TreeContext {                /* tree context for semantic checks */
-    uint32          flags;          /* statement state flags, see above */
-    uint32          bodyid;         /* block number of program/function body */
-    uint32          blockidGen;     /* preincremented block number generator */
-    uint32          parenDepth;     /* nesting depth of parens that might turn out
+    uint32_t        flags;          /* statement state flags, see above */
+    uint32_t        bodyid;         /* block number of program/function body */
+    uint32_t        blockidGen;     /* preincremented block number generator */
+    uint32_t        parenDepth;     /* nesting depth of parens that might turn out
                                        to be generator expressions */
-    uint32          yieldCount;     /* number of |yield| tokens encountered at
+    uint32_t        yieldCount;     /* number of |yield| tokens encountered at
                                        non-zero depth in current paren tree */
-    uint32          argumentsCount; /* number of |arguments| references encountered
+    uint32_t        argumentsCount; /* number of |arguments| references encountered
                                        at non-zero depth in current paren tree */
     StmtInfo        *topStmt;       /* top of statement info stack */
     StmtInfo        *topScopeStmt;  /* top lexical scope statement */
     ObjectBox       *blockChainBox; /* compile time block scope chain (NB: one
                                        deeper than the topScopeStmt/downScope
                                        chain when in head of let block/expr) */
     ParseNode       *blockNode;     /* parse node for a block with let declarations
                                        (block with its own lexical scope)  */
@@ -481,17 +485,17 @@ inline bool TreeContext::needStrictCheck
 }
 
 namespace frontend {
 
 bool
 SetStaticLevel(TreeContext *tc, uintN staticLevel);
 
 bool
-GenerateBlockId(TreeContext *tc, uint32& blockid);
+GenerateBlockId(TreeContext *tc, uint32_t &blockid);
 
 } /* namespace frontend */
 
 struct JumpTarget;
 
 /*
  * Span-dependent instructions are jumps whose span (from the jump bytecode to
  * the jump target) may require 2 or 4 bytes of immediate operand.
@@ -551,17 +555,17 @@ struct JumpTarget {
                                  : 0)
 
 struct TryNode {
     JSTryNote       note;
     TryNode       *prev;
 };
 
 struct CGObjectList {
-    uint32              length;     /* number of emitted so far objects */
+    uint32_t            length;     /* number of emitted so far objects */
     ObjectBox           *lastbox;   /* last emitted object */
 
     CGObjectList() : length(0), lastbox(NULL) {}
 
     uintN index(ObjectBox *objbox);
     void finish(JSObjectArray *array);
 };
 
@@ -578,20 +582,20 @@ struct GlobalScope {
     GlobalScope(JSContext *cx, JSObject *globalObj, BytecodeEmitter *bce)
       : globalObj(globalObj), bce(bce), defs(cx), names(cx)
     { }
 
     struct GlobalDef {
         JSAtom        *atom;        // If non-NULL, specifies the property name to add.
         FunctionBox   *funbox;      // If non-NULL, function value for the property.
                                     // This value is only set/used if atom is non-NULL.
-        uint32        knownSlot;    // If atom is NULL, this is the known shape slot.
+        uint32_t      knownSlot;    // If atom is NULL, this is the known shape slot.
 
         GlobalDef() { }
-        GlobalDef(uint32 knownSlot) : atom(NULL), knownSlot(knownSlot) { }
+        GlobalDef(uint32_t knownSlot) : atom(NULL), knownSlot(knownSlot) { }
         GlobalDef(JSAtom *atom, FunctionBox *box) : atom(atom), funbox(box) { }
     };
 
     JSObject        *globalObj;
     BytecodeEmitter *bce;
 
     /*
      * This is the table of global names encountered during parsing. Each
@@ -656,21 +660,21 @@ struct BytecodeEmitter : public TreeCont
     GlobalScope     *globalScope;   /* frontend::CompileScript global scope, or null */
 
     typedef Vector<GlobalSlotArray::Entry, 16> GlobalUseVector;
 
     GlobalUseVector globalUses;     /* per-script global uses */
     OwnedAtomIndexMapPtr globalMap; /* per-script map of global name to globalUses vector */
 
     /* Vectors of pn_cookie slot values. */
-    typedef Vector<uint32, 8> SlotVector;
+    typedef Vector<uint32_t, 8> SlotVector;
     SlotVector      closedArgs;
     SlotVector      closedVars;
 
-    uint16          typesetCount;   /* Number of JOF_TYPESET opcodes generated */
+    uint16_t        typesetCount;   /* Number of JOF_TYPESET opcodes generated */
 
     BytecodeEmitter(Parser *parser, uintN lineno);
     bool init(JSContext *cx, TreeContext::InitBehavior ib = USED_AS_CODE_GENERATOR);
 
     JSContext *context() {
         return parser->context;
     }
 
@@ -691,17 +695,17 @@ struct BytecodeEmitter : public TreeCont
      * added, to avoid aliasing properties that should be resolved. This makes
      * slot prediction based on the global object's free slot impossible. So,
      * we use the slot to index into bce->globalScope->defs, and perform a
      * fixup of the script at the very end of compilation.
      *
      * If the global use can be cached, |cookie| will be set to |slot|.
      * Otherwise, |cookie| is set to the free cookie value.
      */
-    bool addGlobalUse(JSAtom *atom, uint32 slot, UpvarCookie *cookie);
+    bool addGlobalUse(JSAtom *atom, uint32_t slot, UpvarCookie *cookie);
 
     bool hasUpvarIndices() const {
         return upvarIndices.hasMap() && !upvarIndices->empty();
     }
 
     bool hasSharps() const {
         bool rv = !!(flags & TCF_HAS_SHARPS);
         JS_ASSERT((sharpSlotBase >= 0) == rv);
@@ -791,17 +795,17 @@ Emit2(JSContext *cx, BytecodeEmitter *bc
  */
 ptrdiff_t
 Emit3(JSContext *cx, BytecodeEmitter *bce, JSOp op, jsbytecode op1, jsbytecode op2);
 
 /*
  * Emit five bytecodes, an opcode with two 16-bit immediates.
  */
 ptrdiff_t
-Emit5(JSContext *cx, BytecodeEmitter *bce, JSOp op, uint16 op1, uint16 op2);
+Emit5(JSContext *cx, BytecodeEmitter *bce, JSOp op, uint16_t op1, uint16_t op2);
 
 /*
  * Emit (1 + extra) bytecodes, for N bytes of op and its immediate operand.
  */
 ptrdiff_t
 EmitN(JSContext *cx, BytecodeEmitter *bce, JSOp op, size_t extra);
 
 /*
@@ -899,21 +903,21 @@ EmitTree(JSContext *cx, BytecodeEmitter 
  */
 JSBool
 EmitFunctionScript(JSContext *cx, BytecodeEmitter *bce, ParseNode *body);
 
 } /* namespace frontend */
 
 /*
  * Source notes generated along with bytecode for decompiling and debugging.
- * A source note is a uint8 with 5 bits of type and 3 of offset from the pc of
- * the previous note. If 3 bits of offset aren't enough, extended delta notes
- * (SRC_XDELTA) consisting of 2 set high order bits followed by 6 offset bits
- * are emitted before the next note. Some notes have operand offsets encoded
- * immediately after them, in note bytes or byte-triples.
+ * A source note is a uint8_t with 5 bits of type and 3 of offset from the pc
+ * of the previous note. If 3 bits of offset aren't enough, extended delta
+ * notes (SRC_XDELTA) consisting of 2 set high order bits followed by 6 offset
+ * bits are emitted before the next note. Some notes have operand offsets
+ * encoded immediately after them, in note bytes or byte-triples.
  *
  *                 Source Note               Extended Delta
  *              +7-6-5-4-3+2-1-0+           +7-6-5+4-3-2-1-0+
  *              |note-type|delta|           |1 1| ext-delta |
  *              +---------+-----+           +---+-----------+
  *
  * At most one "gettable" note (i.e., a note of type other than SRC_NEWLINE,
  * SRC_SETLINE, and SRC_XDELTA) applies to a given bytecode.
@@ -1107,19 +1111,19 @@ BytecodeEmitter::countFinalSourceNotes()
     }
     return cnt;
 }
 
 } /* namespace js */
 
 struct JSSrcNoteSpec {
     const char      *name;      /* name for disassembly/debugging output */
-    int8            arity;      /* number of offset operands */
-    uint8           offsetBias; /* bias of offset(s) from annotated pc */
-    int8            isSpanDep;  /* 1 or -1 if offsets could span extended ops,
+    int8_t          arity;      /* number of offset operands */
+    uint8_t         offsetBias; /* bias of offset(s) from annotated pc */
+    int8_t          isSpanDep;  /* 1 or -1 if offsets could span extended ops,
                                    0 otherwise; sign tells span direction */
 };
 
 extern JS_FRIEND_DATA(JSSrcNoteSpec)  js_SrcNoteSpec[];
 extern JS_FRIEND_API(uintN)         js_SrcNoteLength(jssrcnote *sn);
 
 /*
  * Get and set the offset operand identified by which (0 for the first, etc.).
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -138,17 +138,17 @@ FoldType(JSContext *cx, ParseNode *pn, P
  * one of them aliases pn, so you can't safely fetch pn2->pn_next, e.g., after
  * a successful call to this function.
  */
 static JSBool
 FoldBinaryNumeric(JSContext *cx, JSOp op, ParseNode *pn1, ParseNode *pn2,
                   ParseNode *pn, TreeContext *tc)
 {
     jsdouble d, d2;
-    int32 i, j;
+    int32_t i, j;
 
     JS_ASSERT(pn1->isKind(PNK_NUMBER) && pn2->isKind(PNK_NUMBER));
     d = pn1->pn_dval;
     d2 = pn2->pn_dval;
     switch (op) {
       case JSOP_LSH:
       case JSOP_RSH:
         i = js_DoubleToECMAInt32(d);
@@ -238,17 +238,17 @@ FoldXMLConstants(JSContext *cx, ParseNod
     /*
      * GC Rooting here is tricky: for most of the loop, |accum| is safe via
      * the newborn string root. However, when |pn2->getKind()| is PNK_XMLCDATA,
      * PNK_XMLCOMMENT, or PNK_XMLPI it is knocked out of the newborn root.
      * Therefore, we have to add additonal protection from GC nesting under
      * js_ConcatStrings.
      */
     ParseNode *pn2;
-    uint32 i, j;
+    uint32_t i, j;
     for (pn2 = pn1, i = j = 0; pn2; pn2 = pn2->pn_next, i++) {
         /* The parser already rejected end-tags with attributes. */
         JS_ASSERT(kind != PNK_XMLETAGO || i == 0);
         switch (pn2->getKind()) {
           case PNK_XMLATTR:
             if (!accum)
                 goto cantfold;
             /* FALL THROUGH */
@@ -430,17 +430,17 @@ js::FoldConstants(JSContext *cx, ParseNo
 {
     ParseNode *pn1 = NULL, *pn2 = NULL, *pn3 = NULL;
 
     JS_CHECK_RECURSION(cx, return false);
 
     switch (pn->getArity()) {
       case PN_FUNC:
       {
-        uint32 oldflags = tc->flags;
+        uint32_t oldflags = tc->flags;
         FunctionBox *oldlist = tc->functionList;
 
         tc->flags = pn->pn_funbox->tcflags;
         tc->functionList = pn->pn_funbox->kids;
         if (!FoldConstants(cx, pn->pn_body, tc))
             return false;
         pn->pn_funbox->kids = tc->functionList;
         tc->flags = oldflags;
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -479,17 +479,17 @@ enum ParseNodeArity {
 struct Definition;
 
 class LoopControlStatement;
 class BreakStatement;
 class ContinueStatement;
 
 struct ParseNode {
   private:
-    uint32              pn_type   : 16, /* PNK_* type */
+    uint32_t            pn_type   : 16, /* PNK_* type */
                         pn_op     : 8,  /* see JSOp enum and jsopcode.tbl */
                         pn_arity  : 5,  /* see ParseNodeArity enum */
                         pn_parens : 1,  /* this expr was enclosed in parens */
                         pn_used   : 1,  /* name node is on a use-chain */
                         pn_defn   : 1;  /* this node is a Definition */
 
   public:
     ParseNode(ParseNodeKind kind, JSOp op, ParseNodeArity arity)
@@ -554,28 +554,28 @@ struct ParseNode {
     bool isInParens() const                { return pn_parens; }
     void setInParens(bool enabled)         { pn_parens = enabled; }
     bool isUsed() const                    { return pn_used; }
     void setUsed(bool enabled)             { pn_used = enabled; }
     bool isDefn() const                    { return pn_defn; }
     void setDefn(bool enabled)             { pn_defn = enabled; }
 
     TokenPos            pn_pos;         /* two 16-bit pairs here, for 64 bits */
-    int32               pn_offset;      /* first generated bytecode offset */
+    int32_t             pn_offset;      /* first generated bytecode offset */
     ParseNode           *pn_next;       /* intrinsic link in parent PN_LIST */
     ParseNode           *pn_link;       /* def/use link (alignment freebie);
                                            also links FunctionBox::methods
                                            lists of would-be |this| methods */
 
     union {
         struct {                        /* list of next-linked nodes */
             ParseNode   *head;          /* first node in list */
             ParseNode   **tail;         /* ptr to ptr to last node in list */
-            uint32      count;          /* number of nodes in list */
-            uint32      xflags:12,      /* extra flags, see below */
+            uint32_t    count;          /* number of nodes in list */
+            uint32_t    xflags:12,      /* extra flags, see below */
                         blockid:20;     /* see name variant below */
         } list;
         struct {                        /* ternary: if, for(;;), ?: */
             ParseNode   *kid1;          /* condition, discriminant, etc. */
             ParseNode   *kid2;          /* then-part, case list, etc. */
             ParseNode   *kid3;          /* else-part, default case, etc. */
         } ternary;
         struct {                        /* two kids if binary */
@@ -600,17 +600,17 @@ struct ParseNode {
             union {
                 ParseNode    *expr;     /* function body, var initializer, or
                                            base object of PNK_DOT */
                 Definition   *lexdef;   /* lexical definition for this use */
             };
             UpvarCookie cookie;         /* upvar cookie with absolute frame
                                            level (not relative skip), possibly
                                            in current frame */
-            uint32      dflags:12,      /* definition/use flags, see below */
+            uint32_t    dflags:12,      /* definition/use flags, see below */
                         blockid:20;     /* block number, for subset dominance
                                            computation */
         } name;
         struct {                        /* lexical dependencies + sub-tree */
             AtomDefnMapPtr   defnMap;
             ParseNode        *tree;     /* sub-tree containing name uses */
         } nameset;
         struct {                        /* PN_NULLARY variant for E4X XML PI */
@@ -1307,20 +1307,20 @@ struct FunctionBox : public ObjectBox
     FunctionBox         *kids;
     FunctionBox         *parent;
     ParseNode           *methods;               /* would-be methods set on this;
                                                    these nodes are linked via
                                                    pn_link, since lambdas are
                                                    neither definitions nor uses
                                                    of a binding */
     Bindings            bindings;               /* bindings for this function */
-    uint32              queued:1,
+    uint32_t            queued:1,
                         inLoop:1,               /* in a loop in parent function */
                         level:JSFB_LEVEL_BITS;
-    uint32              tcflags;
+    uint32_t            tcflags;
 
     JSFunction *function() const { return (JSFunction *) object; }
 
     bool joinable() const;
 
     /*
      * True if this function is inside the scope of a with-statement, an E4X
      * filter-expression, or a function that uses direct eval.
@@ -1340,17 +1340,17 @@ struct FunctionBoxQueue {
     size_t              lengthMask;
 
     size_t count()  { return head - tail; }
     size_t length() { return lengthMask + 1; }
 
     FunctionBoxQueue()
       : vector(NULL), head(0), tail(0), lengthMask(0) { }
 
-    bool init(uint32 count) {
+    bool init(uint32_t count) {
         lengthMask = JS_BITMASK(JS_CEILING_LOG2W(count));
         vector = (FunctionBox **) OffTheBooks::malloc_(sizeof(FunctionBox) * length());
         return !!vector;
     }
 
     ~FunctionBoxQueue() { UnwantedForeground::free_(vector); }
 
     void push(FunctionBox *funbox) {
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -1243,17 +1243,17 @@ Parser::functionArguments(TreeContext &f
                 ParseNode *lhs = destructuringExpr(&data, tt);
                 if (!lhs)
                     return false;
 
                 /*
                  * Adjust fun->nargs to count the single anonymous positional
                  * parameter that is to be destructured.
                  */
-                uint16 slot;
+                uint16_t slot;
                 if (!funtc.bindings.addDestructuring(context, &slot))
                     return false;
 
                 /*
                  * Synthesize a destructuring assignment from the single
                  * anonymous positional parameter into the destructuring
                  * left-hand-side expression and accumulate it in list.
                  */
@@ -1304,17 +1304,17 @@ Parser::functionArguments(TreeContext &f
                  */
                 if (funtc.decls.lookupFirst(name)) {
                     duplicatedArg = name;
                     if (destructuringArg)
                         goto report_dup_and_destructuring;
                 }
 #endif
 
-                uint16 slot;
+                uint16_t slot;
                 if (!funtc.bindings.addArgument(context, name, &slot))
                     return false;
                 if (!DefineArg(funbox->node, name, slot, &funtc))
                     return false;
                 break;
               }
 
               default:
@@ -1933,17 +1933,17 @@ BindLet(JSContext *cx, BindData *data, J
     /*
      * Assign block-local index to pn->pn_cookie right away, encoding it as an
      * upvar cookie whose skip tells the current static level. The emitter will
      * adjust the node's slot based on its stack depth model -- and, for global
      * and eval code, js::frontend::CompileScript will adjust the slot
      * again to include script->nfixed.
      */
     pn->setOp(JSOP_GETLOCAL);
-    pn->pn_cookie.set(tc->staticLevel, uint16(n));
+    pn->pn_cookie.set(tc->staticLevel, uint16_t(n));
     pn->pn_dflags |= PND_LET | PND_BOUND;
 
     /*
      * Define the let binding's property before storing pn in the the binding's
      * slot indexed by n off the class-reserved slot base.
      */
     const Shape *shape = blockObj->defineBlockVariable(cx, ATOM_TO_JSID(atom), n);
     if (!shape)
@@ -4939,18 +4939,18 @@ class CompExprTransplanter {
  * parsing the body. As soon as the parser reaches the end of the body expression,
  * call endBody() to reset the context's state, and then immediately call:
  *
  * - checkValidBody() if this *did* turn out to be a generator expression
  * - maybeNoteGenerator() if this *did not* turn out to be a generator expression
  */
 class GenexpGuard {
     TreeContext     *tc;
-    uint32          startYieldCount;
-    uint32          startArgumentsCount;
+    uint32_t        startYieldCount;
+    uint32_t        startArgumentsCount;
 
   public:
     explicit GenexpGuard(TreeContext *tc)
       : tc(tc)
     {
         if (tc->parenDepth == 0) {
             tc->yieldCount = tc->argumentsCount = 0;
             tc->yieldNode = tc->argumentsNode = NULL;
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -68,17 +68,17 @@ struct Parser : private AutoGCRooter
     void                *tempFreeList[NUM_TEMP_FREELISTS];
     TokenStream         tokenStream;
     void                *tempPoolMark;  /* initial JSContext.tempLifoAlloc mark */
     JSPrincipals        *principals;    /* principals associated with source */
     JSPrincipals        *originPrincipals;   /* see jsapi.h 'originPrincipals' comment */
     StackFrame          *const callerFrame;  /* scripted caller frame for eval and dbgapi */
     JSObject            *const callerVarObj; /* callerFrame's varObj */
     ParseNodeAllocator  allocator;
-    uint32              functionCount;  /* number of functions in current unit */
+    uint32_t            functionCount;  /* number of functions in current unit */
     ObjectBox           *traceListHead; /* list of parsed object for GC tracing */
     TreeContext         *tc;            /* innermost tree context (stack-allocated) */
 
     /* Root atoms and objects allocated for the parsed tree. */
     AutoKeepAtoms       keepAtoms;
 
     /* Perform constant-folding; must be true when interfacing with the emitter. */
     bool                foldConstants;
--- a/js/src/frontend/SemanticAnalysis.cpp
+++ b/js/src/frontend/SemanticAnalysis.cpp
@@ -252,17 +252,17 @@ FindFunArgs(FunctionBox *funbox, int lev
                 allskipmin = skipmin;
         }
     } while ((funbox = funbox->siblings) != NULL);
 
     return allskipmin;
 }
 
 static bool
-MarkFunArgs(JSContext *cx, FunctionBox *funbox, uint32 functionCount)
+MarkFunArgs(JSContext *cx, FunctionBox *funbox, uint32_t functionCount)
 {
     FunctionBoxQueue queue;
     if (!queue.init(functionCount)) {
         js_ReportOutOfMemory(cx);
         return false;
     }
 
     FindFunArgs(funbox, -1, &queue);
@@ -326,32 +326,32 @@ MarkFunArgs(JSContext *cx, FunctionBox *
                         FindFunArgs(afunbox->kids, afunbox->level, &queue);
                 }
             }
         }
     }
     return true;
 }
 
-static uint32
-MinBlockId(ParseNode *fn, uint32 id)
+static uint32_t
+MinBlockId(ParseNode *fn, uint32_t id)
 {
     if (fn->pn_blockid < id)
         return false;
     if (fn->isDefn()) {
         for (ParseNode *pn = fn->dn_uses; pn; pn = pn->pn_link) {
             if (pn->pn_blockid < id)
                 return false;
         }
     }
     return true;
 }
 
 static inline bool
-CanFlattenUpvar(Definition *dn, FunctionBox *funbox, uint32 tcflags)
+CanFlattenUpvar(Definition *dn, FunctionBox *funbox, uint32_t tcflags)
 {
     /*
      * Consider the current function (the lambda, innermost below) using a var
      * x defined two static levels up:
      *
      *  function f() {
      *      // z = g();
      *      var x = 42;
@@ -482,17 +482,17 @@ CanFlattenUpvar(Definition *dn, Function
             return false;
         if (!MinBlockId(afunbox->node, dn->pn_blockid))
             return false;
     }
     return true;
 }
 
 static void
-FlagHeavyweights(Definition *dn, FunctionBox *funbox, uint32 *tcflags)
+FlagHeavyweights(Definition *dn, FunctionBox *funbox, uint32_t *tcflags)
 {
     uintN dnLevel = dn->frameLevel();
 
     while ((funbox = funbox->parent) != NULL) {
         /*
          * Notice that funbox->level is the static level of the definition or
          * expression of the function parsed into funbox, not the static level
          * of its body. Therefore we must add 1 to match dn's level to find the
@@ -505,17 +505,17 @@ FlagHeavyweights(Definition *dn, Functio
         funbox->tcflags |= TCF_FUN_ENTRAINS_SCOPES;
     }
 
     if (!funbox && (*tcflags & TCF_IN_FUNCTION))
         *tcflags |= TCF_FUN_HEAVYWEIGHT;
 }
 
 static void
-SetFunctionKinds(FunctionBox *funbox, uint32 *tcflags, bool isDirectEval)
+SetFunctionKinds(FunctionBox *funbox, uint32_t *tcflags, bool isDirectEval)
 {
     for (; funbox; funbox = funbox->siblings) {
         ParseNode *fn = funbox->node;
         ParseNode *pn = fn->pn_body;
 
         if (funbox->kids)
             SetFunctionKinds(funbox->kids, tcflags, isDirectEval);
 
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -272,20 +272,20 @@ TokenStream::updateLineInfoForEOL()
 JS_ALWAYS_INLINE void
 TokenStream::updateFlagsForEOL()
 {
     flags &= ~TSF_DIRTYLINE;
     flags |= TSF_EOL;
 }
 
 /* This gets the next char, normalizing all EOL sequences to '\n' as it goes. */
-int32
+int32_t
 TokenStream::getChar()
 {
-    int32 c;
+    int32_t c;
     if (JS_LIKELY(userbuf.hasRawChars())) {
         c = userbuf.getRawChar();
 
         /*
          * Normalize the jschar if it was a newline.  We need to detect any of
          * these four characters:  '\n' (0x000a), '\r' (0x000d),
          * LINE_SEPARATOR (0x2028), PARA_SEPARATOR (0x2029).  Testing for each
          * one in turn is slow, so we use a single probabilistic check, and if
@@ -324,36 +324,36 @@ TokenStream::getChar()
 
 /*
  * This gets the next char. It does nothing special with EOL sequences, not
  * even updating the line counters.  It can be used safely if (a) the
  * resulting char is guaranteed to be ungotten (by ungetCharIgnoreEOL()) if
  * it's an EOL, and (b) the line-related state (lineno, linebase) is not used
  * before it's ungotten.
  */
-int32
+int32_t
 TokenStream::getCharIgnoreEOL()
 {
     if (JS_LIKELY(userbuf.hasRawChars()))
         return userbuf.getRawChar();
 
     flags |= TSF_EOF;
     return EOF;
 }
 
 void
-TokenStream::ungetChar(int32 c)
+TokenStream::ungetChar(int32_t c)
 {
     if (c == EOF)
         return;
     JS_ASSERT(!userbuf.atStart());
     userbuf.ungetRawChar();
     if (c == '\n') {
 #ifdef DEBUG
-        int32 c2 = userbuf.peekRawChar();
+        int32_t c2 = userbuf.peekRawChar();
         JS_ASSERT(TokenBuf::isRawEOLChar(c2));
 #endif
 
         /* if it's a \r\n sequence, also unget the \r */
         if (!userbuf.atStart())
             userbuf.matchRawCharBackwards('\r');
 
         JS_ASSERT(prevLinebase);    /* we should never get more than one EOL char */
@@ -361,17 +361,17 @@ TokenStream::ungetChar(int32 c)
         prevLinebase = NULL;
         lineno--;
     } else {
         JS_ASSERT(userbuf.peekRawChar() == c);
     }
 }
 
 void
-TokenStream::ungetCharIgnoreEOL(int32 c)
+TokenStream::ungetCharIgnoreEOL(int32_t c)
 {
     if (c == EOF)
         return;
     JS_ASSERT(!userbuf.atStart());
     userbuf.ungetRawChar();
 }
 
 /*
@@ -379,17 +379,17 @@ TokenStream::ungetCharIgnoreEOL(int32 c)
  * EOF or a newline, and copy those characters into |cp| if so.  The characters
  * are not consumed: use skipChars(n) to do so after checking that the consumed
  * characters had appropriate values.
  */
 bool
 TokenStream::peekChars(intN n, jschar *cp)
 {
     intN i, j;
-    int32 c;
+    int32_t c;
 
     for (i = 0; i < n; i++) {
         c = getCharIgnoreEOL();
         if (c == EOF)
             break;
         if (c == '\n') {
             ungetCharIgnoreEOL(c);
             break;
@@ -1088,27 +1088,27 @@ TokenStream::peekUnicodeEscape(int *resu
               + JS7_UNHEX(cp[3])) << 4)
             + JS7_UNHEX(cp[4]);
         return true;
     }
     return false;
 }
 
 bool
-TokenStream::matchUnicodeEscapeIdStart(int32 *cp)
+TokenStream::matchUnicodeEscapeIdStart(int32_t *cp)
 {
     if (peekUnicodeEscape(cp) && IsIdentifierStart(*cp)) {
         skipChars(5);
         return true;
     }
     return false;
 }
 
 bool
-TokenStream::matchUnicodeEscapeIdent(int32 *cp)
+TokenStream::matchUnicodeEscapeIdent(int32_t *cp)
 {
     if (peekUnicodeEscape(cp) && IsIdentifierPart(*cp)) {
         skipChars(5);
         return true;
     }
     return false;
 }
 
@@ -1271,17 +1271,17 @@ IsTokenSane(Token *tp)
     }
     return true;
 }
 #endif
 
 bool
 TokenStream::putIdentInTokenbuf(const jschar *identStart)
 {
-    int32 c, qc;
+    int32_t c, qc;
     const jschar *tmp = userbuf.addressOfNextRawChar();
     userbuf.setAddressOfNextRawChar(identStart);
 
     tokenbuf.clear();
     for (;;) {
         c = getCharIgnoreEOL();
         if (!IsIdentifierPart(c)) {
             if (c != '\\' || !matchUnicodeEscapeIdent(&qc))
@@ -1366,17 +1366,17 @@ enum FirstCharKind {
  * String:  34, 39: '"', '\''
  * Dec:     49..57: '1'..'9'
  * Colon:   58: ':'
  * Plus:    43: '+'
  * HexOct:  48: '0'
  * Space:   9, 11, 12: '\t', '\v', '\f'
  * EOL:     10, 13: '\n', '\r'
  */
-static const uint8 firstCharKinds[] = {
+static const uint8_t firstCharKinds[] = {
 /*         0        1        2        3        4        5        6        7        8        9    */
 /*   0+ */ _______, _______, _______, _______, _______, _______, _______, _______, _______,   Space,
 /*  10+ */     EOL,   Space,   Space,     EOL, _______, _______, _______, _______, _______, _______,
 /*  20+ */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
 /*  30+ */ _______, _______,   Space, _______,  String, _______,   Ident, _______, _______,  String,
 /*  40+ */ OneChar, OneChar, _______,    Plus, OneChar, _______,     Dot, _______,  HexOct,     Dec,
 /*  50+ */     Dec,     Dec,     Dec,     Dec,     Dec,     Dec,     Dec,     Dec,   Colon, OneChar,
 /*  60+ */ _______,  Equals, _______, OneChar, _______,   Ident,   Ident,   Ident,   Ident,   Ident,
@@ -1603,33 +1603,33 @@ TokenStream::getTokenInternal()
                       case 'f': c = '\f'; break;
                       case 'n': c = '\n'; break;
                       case 'r': c = '\r'; break;
                       case 't': c = '\t'; break;
                       case 'v': c = '\v'; break;
 
                       default:
                         if ('0' <= c && c < '8') {
-                            int32 val = JS7_UNDEC(c);
+                            int32_t val = JS7_UNDEC(c);
 
                             c = peekChar();
                             /* Strict mode code allows only \0, then a non-digit. */
                             if (val != 0 || JS7_ISDEC(c)) {
                                 if (!ReportStrictModeError(cx, this, NULL, NULL,
                                                            JSMSG_DEPRECATED_OCTAL)) {
                                     goto error;
                                 }
                                 setOctalCharacterEscape();
                             }
                             if ('0' <= c && c < '8') {
                                 val = 8 * val + JS7_UNDEC(c);
                                 getChar();
                                 c = peekChar();
                                 if ('0' <= c && c < '8') {
-                                    int32 save = val;
+                                    int32_t save = val;
                                     val = 8 * val + JS7_UNDEC(c);
                                     if (val <= 0377)
                                         getChar();
                                     else
                                         val = save;
                                 }
                             }
 
@@ -2097,35 +2097,35 @@ TokenStream::getTokenInternal()
             tp->t_op = JSOP_NEG;
             tt = TOK_MINUS;
         }
         break;
 
 #if JS_HAS_SHARP_VARS
       case '#':
       {
-        uint32 n;
+        uint32_t n;
 
         c = getCharIgnoreEOL();
         if (!JS7_ISDEC(c)) {
             ungetCharIgnoreEOL(c);
             goto badchar;
         }
-        n = (uint32)JS7_UNDEC(c);
+        n = (uint32_t)JS7_UNDEC(c);
         for (;;) {
             c = getChar();
             if (!JS7_ISDEC(c))
                 break;
             n = 10 * n + JS7_UNDEC(c);
             if (n >= UINT16_LIMIT) {
                 ReportCompileErrorNumber(cx, this, NULL, JSREPORT_ERROR, JSMSG_SHARPVAR_TOO_BIG);
                 goto error;
             }
         }
-        tp->setSharpNumber(uint16(n));
+        tp->setSharpNumber(uint16_t(n));
         if (cx->hasStrictOption() && (c == '=' || c == '#')) {
             char buf[20];
             JS_snprintf(buf, sizeof buf, "#%u%c", n, c);
             if (!ReportCompileErrorNumber(cx, this, NULL, JSREPORT_WARNING | JSREPORT_STRICT,
                                           JSMSG_DEPRECATED_USAGE, buf)) {
                 goto error;
             }
         }
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -231,18 +231,18 @@ TokenKindIsDecl(TokenKind tt)
 #if JS_HAS_BLOCK_SCOPE
     return tt == TOK_VAR || tt == TOK_LET;
 #else
     return tt == TOK_VAR;
 #endif
 }
 
 struct TokenPtr {
-    uint32              index;          /* index of char in physical line */
-    uint32              lineno;         /* physical line number */
+    uint32_t            index;          /* index of char in physical line */
+    uint32_t            lineno;         /* physical line number */
 
     bool operator==(const TokenPtr& bptr) const {
         return index == bptr.index && lineno == bptr.lineno;
     }
 
     bool operator!=(const TokenPtr& bptr) const {
         return index != bptr.index || lineno != bptr.lineno;
     }
@@ -328,17 +328,17 @@ struct Token {
         } s;
 
       private:
         friend struct Token;
         struct {                        /* pair for <?target data?> XML PI */
             JSAtom       *data;         /* auxiliary atom table entry */
             PropertyName *target;       /* main atom table entry */
         } xmlpi;
-        uint16          sharpNumber;    /* sharp variable number: #1# or #1= */
+        uint16_t        sharpNumber;    /* sharp variable number: #1# or #1= */
         jsdouble        number;         /* floating point number */
         RegExpFlag      reflags;        /* regexp flags, use tokenbuf to access
                                            regexp chars */
     } u;
 
     /* Mutators */
 
     /*
@@ -363,17 +363,17 @@ struct Token {
         u.xmlpi.data = data;
     }
 
     void setRegExpFlags(js::RegExpFlag flags) {
         JS_ASSERT((flags & AllFlags) == flags);
         u.reflags = flags;
     }
 
-    void setSharpNumber(uint16 sharpNum) {
+    void setSharpNumber(uint16_t sharpNum) {
         u.sharpNumber = sharpNum;
     }
 
     void setNumber(jsdouble n) {
         u.number = n;
     }
 
     /* Type-safe accessors */
@@ -404,17 +404,17 @@ struct Token {
     }
 
     js::RegExpFlag regExpFlags() const {
         JS_ASSERT(type == TOK_REGEXP);
         JS_ASSERT((u.reflags & AllFlags) == u.reflags);
         return u.reflags;
     }
 
-    uint16 sharpNumber() const {
+    uint16_t sharpNumber() const {
         JS_ASSERT(type == TOK_DEFSHARP || type == TOK_USESHARP);
         return u.sharpNumber;
     }
 
     jsdouble number() const {
         JS_ASSERT(type == TOK_NUMBER);
         return u.number;
     }
@@ -762,62 +762,62 @@ class TokenStream
          * ptrWhenPoisoned exists.
          */
         void poison() {
             ptrWhenPoisoned = ptr;
             ptr = NULL;
         }
 #endif
 
-        static bool isRawEOLChar(int32 c) {
+        static bool isRawEOLChar(int32_t c) {
             return (c == '\n' || c == '\r' || c == LINE_SEPARATOR || c == PARA_SEPARATOR);
         }
 
         const jschar *findEOL();
 
       private:
         const jschar *base;             /* base of buffer */
         const jschar *limit;            /* limit for quick bounds check */
         const jschar *ptr;              /* next char to get */
         const jschar *ptrWhenPoisoned;  /* |ptr| when poison() was called */
     };
 
     TokenKind getTokenInternal();     /* doesn't check for pushback or error flag. */
 
-    int32 getChar();
-    int32 getCharIgnoreEOL();
-    void ungetChar(int32 c);
-    void ungetCharIgnoreEOL(int32 c);
+    int32_t getChar();
+    int32_t getCharIgnoreEOL();
+    void ungetChar(int32_t c);
+    void ungetCharIgnoreEOL(int32_t c);
     Token *newToken(ptrdiff_t adjust);
-    bool peekUnicodeEscape(int32 *c);
-    bool matchUnicodeEscapeIdStart(int32 *c);
-    bool matchUnicodeEscapeIdent(int32 *c);
+    bool peekUnicodeEscape(int32_t *c);
+    bool matchUnicodeEscapeIdStart(int32_t *c);
+    bool matchUnicodeEscapeIdent(int32_t *c);
     bool peekChars(intN n, jschar *cp);
     bool getAtLine();
     bool getAtSourceMappingURL();
 
     bool getXMLEntity();
     bool getXMLTextOrTag(TokenKind *ttp, Token **tpp);
     bool getXMLMarkup(TokenKind *ttp, Token **tpp);
 
-    bool matchChar(int32 expect) {
-        int32 c = getChar();
+    bool matchChar(int32_t expect) {
+        int32_t c = getChar();
         if (c == expect)
             return true;
         ungetChar(c);
         return false;
     }
 
-    void consumeKnownChar(int32 expect) {
-        mozilla::DebugOnly<int32> c = getChar();
+    void consumeKnownChar(int32_t expect) {
+        mozilla::DebugOnly<int32_t> c = getChar();
         JS_ASSERT(c == expect);
     }
 
-    int32 peekChar() {
-        int32 c = getChar();
+    int32_t peekChar() {
+        int32_t c = getChar();
         ungetChar(c);
         return c;
     }
 
     void skipChars(intN n) {
         while (--n >= 0)
             getChar();
     }
@@ -832,17 +832,17 @@ class TokenStream
     uintN               flags;          /* flags -- see above */
     const jschar        *linebase;      /* start of current line;  points into userbuf */
     const jschar        *prevLinebase;  /* start of previous line;  NULL if on the first line */
     TokenBuf            userbuf;        /* user input buffer */
     const char          *filename;      /* input filename or null */
     jschar              *sourceMap;     /* source map's filename or null */
     void                *listenerTSData;/* listener data for this TokenStream */
     CharBuffer          tokenbuf;       /* current token string buffer */
-    int8                oneCharTokens[128];  /* table of one-char tokens */
+    int8_t              oneCharTokens[128];  /* table of one-char tokens */
     JSPackedBool        maybeEOL[256];       /* probabilistic EOL lookup table */
     JSPackedBool        maybeStrSpecial[256];/* speeds up string scanning */
     JSVersion           version;        /* (i.e. to identify keywords) */
     bool                xml;            /* see JSOPTION_XML */
     JSContext           *const cx;
     JSPrincipals        *const originPrincipals;
 };
 
--- a/js/src/gc/Barrier-inl.h
+++ b/js/src/gc/Barrier-inl.h
@@ -186,17 +186,17 @@ HeapValue::set(JSCompartment *comp, cons
 #endif
 
     pre(comp);
     value = v;
     post(comp);
 }
 
 inline void
-HeapValue::boxNonDoubleFrom(JSValueType type, uint64 *out)
+HeapValue::boxNonDoubleFrom(JSValueType type, uint64_t *out)
 {
     pre();
     value.boxNonDoubleFrom(type, out);
     post();
 }
 
 inline
 HeapId::HeapId(jsid id)
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -326,26 +326,26 @@ class HeapValue
     bool isFalse() const { return value.isFalse(); }
     bool isInt32() const { return value.isInt32(); }
     bool isNull() const { return value.isNull(); }
 
     JSObject &toObject() const { return value.toObject(); }
     JSObject *toObjectOrNull() const { return value.toObjectOrNull(); }
     void *toGCThing() const { return value.toGCThing(); }
     double toDouble() const { return value.toDouble(); }
-    int32 toInt32() const { return value.toInt32(); }
+    int32_t toInt32() const { return value.toInt32(); }
     JSString *toString() const { return value.toString(); }
     bool toBoolean() const { return value.toBoolean(); }
     double toNumber() const { return value.toNumber(); }
 
     JSGCTraceKind gcKind() const { return value.gcKind(); }
 
-    inline void boxNonDoubleFrom(JSValueType type, uint64 *out);
+    inline void boxNonDoubleFrom(JSValueType type, uint64_t *out);
 
-    uint64 asRawBits() const { return value.asRawBits(); }
+    uint64_t asRawBits() const { return value.asRawBits(); }
 
 #ifdef DEBUG
     JSWhyMagic whyMagic() const { return value.whyMagic(); }
 #endif
 
     static inline void writeBarrierPre(const Value &v);
     static inline void writeBarrierPost(const Value &v, void *addr);
 
@@ -373,17 +373,17 @@ class HeapValueArray
 
   public:
     HeapValueArray(HeapValue *array) : array(array) {}
 
     operator const Value *() const { return Valueify(array); }
     operator HeapValue *() const { return array; }
 
     HeapValueArray operator +(int offset) const { return HeapValueArray(array + offset); }
-    HeapValueArray operator +(uint32 offset) const { return HeapValueArray(array + offset); }
+    HeapValueArray operator +(uint32_t offset) const { return HeapValueArray(array + offset); }
 };
 
 class HeapId
 {
     jsid value;
 
   public:
     explicit HeapId() : value(JSID_VOID) {}
--- a/js/src/gc/Statistics.h
+++ b/js/src/gc/Statistics.h
@@ -112,28 +112,28 @@ struct Statistics {
     void count(Stat s) {
         JS_ASSERT(s < STAT_LIMIT);
         counts[s]++;
     }
 
   private:
     JSRuntime *runtime;
 
-    uint64 startupTime;
+    uint64_t startupTime;
 
     FILE *fp;
     bool fullFormat;
 
     Reason triggerReason;
     JSCompartment *compartment;
 
-    uint64 phaseStarts[PHASE_LIMIT];
-    uint64 phaseEnds[PHASE_LIMIT];
-    uint64 phaseTimes[PHASE_LIMIT];
-    uint64 totals[PHASE_LIMIT];
+    uint64_t phaseStarts[PHASE_LIMIT];
+    uint64_t phaseEnds[PHASE_LIMIT];
+    uint64_t phaseTimes[PHASE_LIMIT];
+    uint64_t totals[PHASE_LIMIT];
     unsigned int counts[STAT_LIMIT];
 
     double t(Phase phase);
     double total(Phase phase);
     double beginDelay(Phase phase1, Phase phase2);
     double endDelay(Phase phase1, Phase phase2);
     void printStats();
     void statsToString(char *buffer, size_t size);
--- a/js/src/jit-test/tests/basic/truncateDouble.js
+++ b/js/src/jit-test/tests/basic/truncateDouble.js
@@ -1,10 +1,10 @@
 
-// check correctness of truncation of doubles slightly outside the int32 range.
+// check correctness of truncation of doubles slightly outside the int32_t range.
 
 function truncate(x) {
   return x | 0;
 }
 
 assertEq(truncate(0xffffffff), -1);
 assertEq(truncate(0xffffffff + 5000.5), 4999);
 assertEq(truncate(-0xffffffff - 5000.5), -4999);
--- a/js/src/jit-test/tests/jaeger/bug549393-1.js
+++ b/js/src/jit-test/tests/jaeger/bug549393-1.js
@@ -7,17 +7,17 @@ function start() {
   } while ( lastTime - startTime < MAX_TOTAL_TIME )
 }
 function MersenneTwister19937() {
   this.init_genrand = function() {
     for (mti = 1; mti < 4; mti++) {
       Array[mti] = 1
     }
   };
-  this.genrand_int32 = function() {
+  this.genrand_int32_t = function() {
     if (mti > 4) {
       mti = 0
     }
     return Array[mti++];
   }
 } (function() {
   fuzzMT = new MersenneTwister19937;
   fuzzMT.init_genrand()
--- a/js/src/jit-test/tests/jaeger/getelem-sanity-5.js
+++ b/js/src/jit-test/tests/jaeger/getelem-sanity-5.js
@@ -1,4 +1,4 @@
 var x = { 0: 5, 1: 5 };
 assertEq(x[0] + x[1], 10);
 
-/* int32 getelem on object. */
+/* int32_t getelem on object. */
--- a/js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js
+++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-1.js
@@ -1,7 +1,7 @@
 var arr = ['this', 'works', 'for', 'me'];
 assertEq('this', arr[0]);
 assertEq('works', arr[1]);
 assertEq('for', arr[2]);
 assertEq('me', arr[3]);
 
-/* Multiple int32 getelem for dense array. */
+/* Multiple int32_t getelem for dense array. */
--- a/js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js
+++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-2.js
@@ -4,9 +4,9 @@ for (var i = 0; i < arr.length; ++i) {
     switch (i) {
       case 0: assertEq('this', result); break;
       case 1: assertEq('works', result); break;
       case 2: assertEq('for', result); break;
       case 3: assertEq('me', result); break;
     }
 }
 
-/* int32 getelem for dense array. */
+/* int32_t getelem for dense array. */
--- a/js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js
+++ b/js/src/jit-test/tests/jaeger/getelem-sanity-int-3.js
@@ -11,9 +11,9 @@ for (var i = 0; i < 3; i++) {
     var result = a[attr];
     switch (i) {
       case 0: assertEq(result, 1); break;
       case 1: assertEq(result, 2); break;
       case 2: assertEq(result, 'value'); break;
     }
 }
 
-/* int32 and string getelem for non-dense array. */
+/* int32_t and string getelem for non-dense array. */
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -204,17 +204,17 @@ ScriptAnalysis::analyzeBytecode(JSContex
             escapedSlots[ArgSlot(arg)] = true;
         }
     }
 
     if (script->usesEval || script->compartment()->debugMode()) {
         for (unsigned i = 0; i < script->nfixed; i++)
             escapedSlots[LocalSlot(script, i)] = true;
     } else {
-        for (uint32 i = 0; i < script->nClosedVars; i++) {
+        for (uint32_t i = 0; i < script->nClosedVars; i++) {
             unsigned local = script->getClosedVar(i);
             JS_ASSERT(local < script->nfixed);
             escapedSlots[LocalSlot(script, local)] = true;
         }
     }
 
     /*
      * If the script is in debug mode, JS_SetFrameReturnValue can be called at
@@ -496,32 +496,32 @@ ScriptAnalysis::analyzeBytecode(JSContex
           case JSOP_GETLOCAL: {
             /*
              * Watch for uses of variables not known to be defined, and mark
              * them as having possible uses before definitions.  Ignore GETLOCAL
              * followed by a POP, these are generated for, e.g. 'var x;'
              */
             jsbytecode *next = pc + JSOP_GETLOCAL_LENGTH;
             if (JSOp(*next) != JSOP_POP || jumpTarget(next)) {
-                uint32 local = GET_SLOTNO(pc);
+                uint32_t local = GET_SLOTNO(pc);
                 if (local >= script->nfixed) {
                     localsAliasStack_ = true;
                     break;
                 }
             }
             break;
           }
 
           case JSOP_CALLLOCAL:
           case JSOP_INCLOCAL:
           case JSOP_DECLOCAL:
           case JSOP_LOCALINC:
           case JSOP_LOCALDEC:
           case JSOP_SETLOCAL: {
-            uint32 local = GET_SLOTNO(pc);
+            uint32_t local = GET_SLOTNO(pc);
             if (local >= script->nfixed) {
                 localsAliasStack_ = true;
                 break;
             }
             break;
           }
 
           case JSOP_SETARG:
@@ -548,17 +548,17 @@ ScriptAnalysis::analyzeBytecode(JSContex
           case JSOP_FUNAPPLY:
             isInlineable = false;
             break;
 
           default:
             break;
         }
 
-        uint32 type = JOF_TYPE(js_CodeSpec[op].format);
+        uint32_t type = JOF_TYPE(js_CodeSpec[op].format);
 
         /* Check basic jump opcodes, which may or may not have a fallthrough. */
         if (type == JOF_JUMP || type == JOF_JUMPX) {
             /* Some opcodes behave differently on their branching path. */
             unsigned newStackDepth = stackDepth;
 
             switch (op) {
               case JSOP_CASE:
@@ -641,17 +641,17 @@ ScriptAnalysis::analyzeLifetimes(JSConte
     if (!saved) {
         setOOM(cx);
         return;
     }
     unsigned savedCount = 0;
 
     LoopAnalysis *loop = NULL;
 
-    uint32 offset = script->length - 1;
+    uint32_t offset = script->length - 1;
     while (offset < script->length) {
         Bytecode *code = maybeCode(offset);
         if (!code) {
             offset--;
             continue;
         }
 
         if (loop && code->safePoint)
@@ -707,42 +707,42 @@ ScriptAnalysis::analyzeLifetimes(JSConte
         }
 
         switch (op) {
           case JSOP_GETARG:
           case JSOP_CALLARG:
           case JSOP_GETLOCAL:
           case JSOP_CALLLOCAL:
           case JSOP_THIS: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (!slotEscapes(slot))
                 addVariable(cx, lifetimes[slot], offset, saved, savedCount);
             break;
           }
 
           case JSOP_SETARG:
           case JSOP_SETLOCAL:
           case JSOP_SETLOCALPOP:
           case JSOP_DEFLOCALFUN:
           case JSOP_DEFLOCALFUN_FC: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (!slotEscapes(slot))
                 killVariable(cx, lifetimes[slot], offset, saved, savedCount);
             break;
           }
 
           case JSOP_INCARG:
           case JSOP_DECARG:
           case JSOP_ARGINC:
           case JSOP_ARGDEC:
           case JSOP_INCLOCAL:
           case JSOP_DECLOCAL:
           case JSOP_LOCALINC:
           case JSOP_LOCALDEC: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (!slotEscapes(slot)) {
                 killVariable(cx, lifetimes[slot], offset, saved, savedCount);
                 addVariable(cx, lifetimes[slot], offset, saved, savedCount);
             }
             break;
           }
 
           case JSOP_LOOKUPSWITCH:
@@ -782,24 +782,24 @@ ScriptAnalysis::analyzeLifetimes(JSConte
           case JSOP_FUNCALL:
             if (loop)
                 loop->hasCallsLoops = true;
             break;
 
           default:;
         }
 
-        uint32 type = JOF_TYPE(js_CodeSpec[op].format);
+        uint32_t type = JOF_TYPE(js_CodeSpec[op].format);
         if (type == JOF_JUMP || type == JOF_JUMPX) {
             /*
              * Forward jumps need to pull in all variables which are live at
              * their target offset --- the variables live before the jump are
              * the union of those live at the fallthrough and at the target.
              */
-            uint32 targetOffset = FollowBranch(cx, script, offset);
+            uint32_t targetOffset = FollowBranch(cx, script, offset);
 
             /*
              * Watch for 'continue' statements in the loop body, which are
              * jumps to the entry offset separate from the initial jump.
              */
             if (loop && loop->entry == targetOffset && loop->entry > loop->lastBlock)
                 loop->lastBlock = loop->entry;
 
@@ -837,17 +837,17 @@ ScriptAnalysis::analyzeLifetimes(JSConte
                 loop->head = targetOffset;
                 loop->backedge = offset;
                 loop->lastBlock = loop->head;
 
                 /*
                  * Find the entry jump, which will be a GOTO for 'for' or
                  * 'while' loops or a fallthrough for 'do while' loops.
                  */
-                uint32 entry = targetOffset;
+                uint32_t entry = targetOffset;
                 if (entry) {
                     do {
                         entry--;
                     } while (!maybeCode(entry));
 
                     jsbytecode *entrypc = script->code + entry;
 
                     if (JSOp(*entrypc) == JSOP_GOTO || JSOp(*entrypc) == JSOP_GOTOX)
@@ -1014,17 +1014,17 @@ ScriptAnalysis::extendVariable(JSContext
      * the next iteration then a new lifetime would be made here. At #1 we
      * mark x live again, make a segment between the head of the loop and #1,
      * and then extend x with loop tail lifetimes from #1 to #2, and from #3
      * to the back edge.
      */
 
     Lifetime *segment = var.lifetime;
     while (segment && segment->start < end) {
-        uint32 savedEnd = segment->savedEnd;
+        uint32_t savedEnd = segment->savedEnd;
         if (!segment->next || segment->next->start >= end) {
             /*
              * savedEnd is only set for variables killed in the middle of the
              * loop. Make a tail segment connecting the last use with the
              * back edge.
              */
             if (segment->end >= end) {
                 /* Variable known to be live after the loop finishes. */
@@ -1127,36 +1127,36 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
     struct FreeSSAValues {
         JSContext *cx;
         SSAValue *values;
         FreeSSAValues(JSContext *cx, SSAValue *values) : cx(cx), values(values) {}
         ~FreeSSAValues() { cx->free_(values); }
     } free(cx, values);
 
     SSAValue *stack = values + numSlots;
-    uint32 stackDepth = 0;
+    uint32_t stackDepth = 0;
 
-    for (uint32 slot = ArgSlot(0); slot < numSlots; slot++) {
+    for (uint32_t slot = ArgSlot(0); slot < numSlots; slot++) {
         if (trackSlot(slot))
             values[slot].initInitial(slot);
     }
 
     /*
      * All target offsets for forward jumps we in the middle of. We lazily add
      * pending entries at these targets for the original value of variables
      * modified before the branch rejoins.
      */
-    Vector<uint32> branchTargets(cx);
+    Vector<uint32_t> branchTargets(cx);
 
-    uint32 offset = 0;
+    uint32_t offset = 0;
     while (offset < script->length) {
         jsbytecode *pc = script->code + offset;
         JSOp op = (JSOp)*pc;
 
-        uint32 successorOffset = offset + GetBytecodeLength(pc);
+        uint32_t successorOffset = offset + GetBytecodeLength(pc);
 
         Bytecode *code = maybeCode(pc);
         if (!code) {
             offset = successorOffset;
             continue;
         }
 
         if (code->stackDepth > stackDepth)
@@ -1192,17 +1192,17 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
 
             /*
              * Make phi nodes and update state for slots which are already in
              * pending from previous branches to the loop head, and which are
              * modified in the body of the loop.
              */
             for (unsigned i = 0; i < pending->length(); i++) {
                 SlotValue &v = (*pending)[i];
-                if (v.slot < numSlots && liveness(v.slot).firstWrite(code->loop) != uint32(-1)) {
+                if (v.slot < numSlots && liveness(v.slot).firstWrite(code->loop) != UINT32_MAX) {
                     if (v.value.kind() != SSAValue::PHI || v.value.phiOffset() < offset) {
                         SSAValue ov = v.value;
                         if (!makePhi(cx, v.slot, offset, &ov))
                             return;
                         insertPhi(cx, ov, v.value);
                         v.value = ov;
                     }
                 }
@@ -1214,20 +1214,20 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
 
             /*
              * Make phi nodes for all other slots which might be modified
              * during the loop. This ensures that in the loop body we have
              * already updated state to reflect possible changes that happen
              * before the back edge, and don't need to go back and fix things
              * up when we *do* get to the back edge. This could be made lazier.
              */
-            for (uint32 slot = ArgSlot(0); slot < numSlots + stackDepth; slot++) {
+            for (uint32_t slot = ArgSlot(0); slot < numSlots + stackDepth; slot++) {
                 if (slot >= numSlots || !trackSlot(slot))
                     continue;
-                if (liveness(slot).firstWrite(code->loop) == uint32(-1))
+                if (liveness(slot).firstWrite(code->loop) == UINT32_MAX)
                     continue;
                 if (values[slot].kind() == SSAValue::PHI && values[slot].phiOffset() == offset) {
                     /* There is already a pending entry for this slot. */
                     continue;
                 }
                 SSAValue ov;
                 if (!makePhi(cx, slot, offset, &ov))
                     return;
@@ -1281,17 +1281,17 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
                 code->poppedValues[i] = v;
                 v.clear();
             }
             if (xuses > nuses) {
                 /*
                  * For SETLOCAL, INCLOCAL, etc. opcodes, add an extra popped
                  * value holding the value of the local before the op.
                  */
-                uint32 slot = GetBytecodeSlot(script, pc);
+                uint32_t slot = GetBytecodeSlot(script, pc);
                 if (trackSlot(slot))
                     code->poppedValues[nuses] = values[slot];
                 else
                     code->poppedValues[nuses].clear();
             }
 
             if (xuses) {
                 SSAUseChain *useChains = tla.newArray<SSAUseChain>(xuses);
@@ -1340,40 +1340,40 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
           case JSOP_INCARG:
           case JSOP_DECARG:
           case JSOP_ARGINC:
           case JSOP_ARGDEC:
           case JSOP_INCLOCAL:
           case JSOP_DECLOCAL:
           case JSOP_LOCALINC:
           case JSOP_LOCALDEC: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (trackSlot(slot)) {
                 mergeBranchTarget(cx, values[slot], slot, branchTargets);
                 values[slot].initWritten(slot, offset);
             }
             break;
           }
 
           case JSOP_GETARG:
           case JSOP_GETLOCAL: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (trackSlot(slot)) {
                 /*
                  * Propagate the current value of the local to the pushed value,
                  * and remember it with an extended use on the opcode.
                  */
                 stack[stackDepth - 1] = code->poppedValues[0] = values[slot];
             }
             break;
           }
 
           case JSOP_CALLARG:
           case JSOP_CALLLOCAL: {
-            uint32 slot = GetBytecodeSlot(script, pc);
+            uint32_t slot = GetBytecodeSlot(script, pc);
             if (trackSlot(slot))
                 stack[stackDepth - 2] = code->poppedValues[0] = values[slot];
             break;
           }
 
           /* Short circuit ops which push back one of their operands. */
 
           case JSOP_MOREITER:
@@ -1473,17 +1473,17 @@ ScriptAnalysis::analyzeSSA(JSContext *cx
                 }
             }
             break;
           }
 
           default:;
         }
 
-        uint32 type = JOF_TYPE(js_CodeSpec[op].format);
+        uint32_t type = JOF_TYPE(js_CodeSpec[op].format);
         if (type == JOF_JUMP || type == JOF_JUMPX) {
             unsigned targetOffset = FollowBranch(cx, script, offset);
             checkBranchTarget(cx, targetOffset, branchTargets, values, stackDepth);
 
             /*
              * If this is a back edge, we're done with the loop and can freeze
              * the phi values at the head now.
              */
@@ -1505,17 +1505,17 @@ PhiNodeCapacity(unsigned length)
         return 4;
 
     unsigned log2;
     JS_FLOOR_LOG2(log2, length - 1);
     return 1 << (log2 + 1);
 }
 
 bool
-ScriptAnalysis::makePhi(JSContext *cx, uint32 slot, uint32 offset, SSAValue *pv)
+ScriptAnalysis::makePhi(JSContext *cx, uint32_t slot, uint32_t offset, SSAValue *pv)
 {
     SSAPhiNode *node = cx->typeLifoAlloc().new_<SSAPhiNode>();
     SSAValue *options = cx->typeLifoAlloc().newArray<SSAValue>(PhiNodeCapacity(0));
     if (!node || !options) {
         setOOM(cx);
         return false;
     }
     node->slot = slot;
@@ -1571,17 +1571,17 @@ ScriptAnalysis::insertPhi(JSContext *cx,
     }
 
     PodCopy(newOptions, node->options, node->length);
     node->options = newOptions;
     node->options[node->length++] = v;
 }
 
 inline void
-ScriptAnalysis::mergeValue(JSContext *cx, uint32 offset, const SSAValue &v, SlotValue *pv)
+ScriptAnalysis::mergeValue(JSContext *cx, uint32_t offset, const SSAValue &v, SlotValue *pv)
 {
     /* Make sure that v is accounted for in the pending value or phi value at pv. */
     JS_ASSERT(v.kind() != SSAValue::EMPTY && pv->value.kind() != SSAValue::EMPTY);
 
     if (v.equals(pv->value))
         return;
 
     if (pv->value.kind() != SSAValue::PHI || pv->value.phiOffset() < offset) {
@@ -1593,34 +1593,34 @@ ScriptAnalysis::mergeValue(JSContext *cx
         return;
     }
 
     JS_ASSERT(pv->value.phiOffset() == offset);
     insertPhi(cx, pv->value, v);
 }
 
 void
-ScriptAnalysis::checkPendingValue(JSContext *cx, const SSAValue &v, uint32 slot,
+ScriptAnalysis::checkPendingValue(JSContext *cx, const SSAValue &v, uint32_t slot,
                                   Vector<SlotValue> *pending)
 {
     JS_ASSERT(v.kind() != SSAValue::EMPTY);
 
     for (unsigned i = 0; i < pending->length(); i++) {
         if ((*pending)[i].slot == slot)
             return;
     }
 
     if (!pending->append(SlotValue(slot, v)))
         setOOM(cx);
 }
 
 void
-ScriptAnalysis::checkBranchTarget(JSContext *cx, uint32 targetOffset,
-                                  Vector<uint32> &branchTargets,
-                                  SSAValue *values, uint32 stackDepth)
+ScriptAnalysis::checkBranchTarget(JSContext *cx, uint32_t targetOffset,
+                                  Vector<uint32_t> &branchTargets,
+                                  SSAValue *values, uint32_t stackDepth)
 {
     unsigned targetDepth = getCode(targetOffset).stackDepth;
     JS_ASSERT(targetDepth <= stackDepth);
 
     /*
      * If there is already an active branch to target, make sure its pending
      * values reflect any changes made since the first branch. Otherwise, add a
      * new pending branch and determine its pending values lazily.
@@ -1641,24 +1641,24 @@ ScriptAnalysis::checkBranchTarget(JSCont
 
     /*
      * Make sure there is a pending entry for each value on the stack.
      * The number of stack entries at join points is usually zero, and
      * we don't want to look at the active branches while popping and
      * pushing values in each opcode.
      */
     for (unsigned i = 0; i < targetDepth; i++) {
-        uint32 slot = StackSlot(script, i);
+        uint32_t slot = StackSlot(script, i);
         checkPendingValue(cx, values[slot], slot, pending);
     }
 }
 
 void
-ScriptAnalysis::mergeBranchTarget(JSContext *cx, const SSAValue &value, uint32 slot,
-                                  const Vector<uint32> &branchTargets)
+ScriptAnalysis::mergeBranchTarget(JSContext *cx, const SSAValue &value, uint32_t slot,
+                                  const Vector<uint32_t> &branchTargets)
 {
     if (slot >= numSlots) {
         /*
          * There is no need to lazily check that there are pending values at
          * branch targets for slots on the stack, these are added to pending
          * eagerly.
          */
         return;
@@ -1672,30 +1672,30 @@ ScriptAnalysis::mergeBranchTarget(JSCont
      */
     for (unsigned i = 0; i < branchTargets.length(); i++) {
         Vector<SlotValue> *pending = getCode(branchTargets[i]).pendingValues;
         checkPendingValue(cx, value, slot, pending);
     }
 }
 
 void
-ScriptAnalysis::removeBranchTarget(Vector<uint32> &branchTargets, uint32 offset)
+ScriptAnalysis::removeBranchTarget(Vector<uint32_t> &branchTargets, uint32_t offset)
 {
     for (unsigned i = 0; i < branchTargets.length(); i++) {
         if (branchTargets[i] == offset) {
             branchTargets[i] = branchTargets.back();
             branchTargets.popBack();
             return;
         }
     }
     JS_ASSERT(OOM());
 }
 
 void
-ScriptAnalysis::freezeNewValues(JSContext *cx, uint32 offset)
+ScriptAnalysis::freezeNewValues(JSContext *cx, uint32_t offset)
 {
     Bytecode &code = getCode(offset);
 
     Vector<SlotValue> *pending = code.pendingValues;
     code.pendingValues = NULL;
 
     unsigned count = pending->length();
     if (count == 0) {
@@ -1726,54 +1726,54 @@ CrossScriptSSA::foldValue(const CrossSSA
     JSScript *parentScript = NULL;
     ScriptAnalysis *parentAnalysis = NULL;
     if (frame.parent != INVALID_FRAME) {
         parentScript = getFrame(frame.parent).script;
         parentAnalysis = parentScript->analysis();
     }
 
     if (v.kind() == SSAValue::VAR && v.varInitial() && parentScript) {
-        uint32 slot = v.varSlot();
+        uint32_t slot = v.varSlot();
         if (slot >= ArgSlot(0) && slot < LocalSlot(frame.script, 0)) {
-            uint32 argc = GET_ARGC(frame.parentpc);
+            uint32_t argc = GET_ARGC(frame.parentpc);
             SSAValue argv = parentAnalysis->poppedValue(frame.parentpc, argc - 1 - (slot - ArgSlot(0)));
             return foldValue(CrossSSAValue(frame.parent, argv));
         }
     }
 
     if (v.kind() == SSAValue::PUSHED) {
         jsbytecode *pc = frame.script->code + v.pushedOffset();
 
         switch (JSOp(*pc)) {
           case JSOP_THIS:
             if (parentScript) {
-                uint32 argc = GET_ARGC(frame.parentpc);
+                uint32_t argc = GET_ARGC(frame.parentpc);
                 SSAValue thisv = parentAnalysis->poppedValue(frame.parentpc, argc);
                 return foldValue(CrossSSAValue(frame.parent, thisv));
             }
             break;
 
           case JSOP_CALL: {
             /*
              * If there is a single inline callee with a single return site,
              * propagate back to that.
              */
             JSScript *callee = NULL;
-            uint32 calleeFrame = INVALID_FRAME;
+            uint32_t calleeFrame = INVALID_FRAME;
             for (unsigned i = 0; i < numFrames(); i++) {
                 if (iterFrame(i).parent == cv.frame && iterFrame(i).parentpc == pc) {
                     if (callee)
                         return cv;  /* Multiple callees */
                     callee = iterFrame(i).script;
                     calleeFrame = iterFrame(i).index;
                 }
             }
             if (callee && callee->analysis()->numReturnSites() == 1) {
                 ScriptAnalysis *analysis = callee->analysis();
-                uint32 offset = 0;
+                uint32_t offset = 0;
                 while (offset < callee->length) {
                     jsbytecode *pc = callee->code + offset;
                     if (analysis->maybeCode(pc) && JSOp(*pc) == JSOP_RETURN)
                         return foldValue(CrossSSAValue(calleeFrame, analysis->poppedValue(pc, 0)));
                     offset += GetBytecodeLength(pc);
                 }
             }
             break;
--- a/js/src/jsanalyze.h
+++ b/js/src/jsanalyze.h
@@ -138,17 +138,17 @@ class Bytecode
      * Dynamically observed state about the execution of this opcode. These are
      * hints about the script for use during compilation.
      */
     bool arrayWriteHole: 1;  /* SETELEM which has written to an array hole. */
     bool getStringElement:1; /* GETELEM which has accessed string properties. */
     bool accessGetter: 1;    /* Property read on a shape with a getter hook. */
 
     /* Stack depth before this opcode. */
-    uint32 stackDepth;
+    uint32_t stackDepth;
 
   private:
 
     union {
         /* If this is a JOF_TYPESET opcode, index into the observed types for the op. */
         types::TypeSet *observedTypes;
 
         /* If this is a loop head (TRACE or NOTRACE), information about the loop. */
@@ -289,17 +289,17 @@ ExtendedUse(jsbytecode *pc)
       default:
         return false;
     }
 }
 
 static inline ptrdiff_t
 GetJumpOffset(jsbytecode *pc, jsbytecode *pc2)
 {
-    uint32 type = JOF_OPTYPE(*pc);
+    uint32_t type = JOF_OPTYPE(*pc);
     if (JOF_TYPE_IS_EXTENDED_JUMP(type))
         return GET_JUMPX_OFFSET(pc2);
     return GET_JUMP_OFFSET(pc2);
 }
 
 static inline JSOp
 ReverseCompareOp(JSOp op)
 {
@@ -333,37 +333,37 @@ FollowBranch(JSContext *cx, JSScript *sc
         JSOp nop = JSOp(*target);
         if (nop == JSOP_GOTO || nop == JSOP_GOTOX)
             return targetOffset + GetJumpOffset(target, target);
     }
     return targetOffset;
 }
 
 /* Common representation of slots throughout analyses and the compiler. */
-static inline uint32 CalleeSlot() {
+static inline uint32_t CalleeSlot() {
     return 0;
 }
-static inline uint32 ThisSlot() {
+static inline uint32_t ThisSlot() {
     return 1;
 }
-static inline uint32 ArgSlot(uint32 arg) {
+static inline uint32_t ArgSlot(uint32_t arg) {
     return 2 + arg;
 }
-static inline uint32 LocalSlot(JSScript *script, uint32 local) {
+static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
     return 2 + (script->function() ? script->function()->nargs : 0) + local;
 }
-static inline uint32 TotalSlots(JSScript *script) {
+static inline uint32_t TotalSlots(JSScript *script) {
     return LocalSlot(script, 0) + script->nfixed;
 }
 
-static inline uint32 StackSlot(JSScript *script, uint32 index) {
+static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
     return TotalSlots(script) + index;
 }
 
-static inline uint32 GetBytecodeSlot(JSScript *script, jsbytecode *pc)
+static inline uint32_t GetBytecodeSlot(JSScript *script, jsbytecode *pc)
 {
     switch (JSOp(*pc)) {
 
       case JSOP_GETARG:
       case JSOP_CALLARG:
       case JSOP_SETARG:
       case JSOP_INCARG:
       case JSOP_DECARG:
@@ -387,17 +387,17 @@ static inline uint32 GetBytecodeSlot(JSS
         return ThisSlot();
 
       default:
         JS_NOT_REACHED("Bad slot opcode");
         return 0;
     }
 }
 
-static inline int32
+static inline int32_t
 GetBytecodeInteger(jsbytecode *pc)
 {
     switch (JSOp(*pc)) {
       case JSOP_ZERO:   return 0;
       case JSOP_ONE:    return 1;
       case JSOP_UINT16: return GET_UINT16(pc);
       case JSOP_UINT24: return GET_UINT24(pc);
       case JSOP_INT8:   return GET_INT8(pc);
@@ -416,24 +416,24 @@ GetBytecodeInteger(jsbytecode *pc)
  * its type/payload can be discarded without needing to be synced.
  */
 struct Lifetime
 {
     /*
      * Start and end offsets of this lifetime. The variable is live at the
      * beginning of every bytecode in this (inclusive) range.
      */
-    uint32 start;
-    uint32 end;
+    uint32_t start;
+    uint32_t end;
 
     /*
      * In a loop body, endpoint to extend this lifetime with if the variable is
      * live in the next iteration.
      */
-    uint32 savedEnd;
+    uint32_t savedEnd;
 
     /*
      * This is an artificial segment extending the lifetime of this variable
      * when it is live at the head of the loop. It will not be used until the
      * next iteration.
      */
     bool loopTail;
 
@@ -441,48 +441,48 @@ struct Lifetime
      * The start of this lifetime is a bytecode writing the variable. Each
      * write to a variable is associated with a lifetime.
      */
     bool write;
 
     /* Next lifetime. The variable is dead from this->end to next->start. */
     Lifetime *next;
 
-    Lifetime(uint32 offset, uint32 savedEnd, Lifetime *next)
+    Lifetime(uint32_t offset, uint32_t savedEnd, Lifetime *next)
         : start(offset), end(offset), savedEnd(savedEnd),
           loopTail(false), write(false), next(next)
     {}
 };
 
 /* Basic information for a loop. */
 class LoopAnalysis
 {
   public:
     /* Any loop this one is nested in. */
     LoopAnalysis *parent;
 
     /* Offset of the head of the loop. */
-    uint32 head;
+    uint32_t head;
 
     /*
      * Offset of the unique jump going to the head of the loop. The code
      * between the head and the backedge forms the loop body.
      */
-    uint32 backedge;
+    uint32_t backedge;
 
     /* Target offset of the initial jump or fallthrough into the loop. */
-    uint32 entry;
+    uint32_t entry;
 
     /*
      * Start of the last basic block in the loop, excluding the initial jump to
      * entry. All code between lastBlock and the backedge runs in every
      * iteration, and if entry >= lastBlock all code between entry and the
      * backedge runs when the loop is initially entered.
      */
-    uint32 lastBlock;
+    uint32_t lastBlock;
 
     /*
      * This loop contains safe points in its body which the interpreter might
      * join at directly.
      */
     bool hasSafePoints;
 
     /* This loop has calls or inner loops. */
@@ -494,48 +494,48 @@ struct LifetimeVariable
 {
     /* If the variable is currently live, the lifetime segment. */
     Lifetime *lifetime;
 
     /* If the variable is currently dead, the next live segment. */
     Lifetime *saved;
 
     /* Jump preceding the basic block which killed this variable. */
-    uint32 savedEnd : 31;
+    uint32_t savedEnd : 31;
 
     /* If the variable needs to be kept alive until lifetime->start. */
     bool ensured : 1;
 
     /* Whether this variable is live at offset. */
-    Lifetime * live(uint32 offset) const {
+    Lifetime * live(uint32_t offset) const {
         if (lifetime && lifetime->end >= offset)
             return lifetime;
         Lifetime *segment = lifetime ? lifetime : saved;
         while (segment && segment->start <= offset) {
             if (segment->end >= offset)
                 return segment;
             segment = segment->next;
         }
         return NULL;
     }
 
     /*
      * Get the offset of the first write to the variable in an inclusive range,
-     * -1 if the variable is not written in the range.
+     * UINT32_MAX if the variable is not written in the range.
      */
-    uint32 firstWrite(uint32 start, uint32 end) const {
+    uint32_t firstWrite(uint32_t start, uint32_t end) const {
         Lifetime *segment = lifetime ? lifetime : saved;
         while (segment && segment->start <= end) {
             if (segment->start >= start && segment->write)
                 return segment->start;
             segment = segment->next;
         }
-        return uint32(-1);
+        return UINT32_MAX;
     }
-    uint32 firstWrite(LoopAnalysis *loop) const {
+    uint32_t firstWrite(LoopAnalysis *loop) const {
         return firstWrite(loop->head, loop->backedge);
     }
 
     /* Return true if the variable cannot decrease during the body of a loop. */
     bool nonDecreasing(JSScript *script, LoopAnalysis *loop) const {
         Lifetime *segment = lifetime ? lifetime : saved;
         while (segment && segment->start <= loop->backedge) {
             if (segment->start >= loop->head && segment->write) {
@@ -551,25 +551,25 @@ struct LifetimeVariable
             }
             segment = segment->next;
         }
         return true;
     }
 
     /*
      * If the variable is only written once in the body of a loop, offset of
-     * that write. -1 otherwise.
+     * that write. UINT32_MAX otherwise.
      */
-    uint32 onlyWrite(LoopAnalysis *loop) const {
-        uint32 offset = uint32(-1);
+    uint32_t onlyWrite(LoopAnalysis *loop) const {
+        uint32_t offset = UINT32_MAX;
         Lifetime *segment = lifetime ? lifetime : saved;
         while (segment && segment->start <= loop->backedge) {
             if (segment->start >= loop->head && segment->write) {
-                if (offset != uint32(-1))
-                    return uint32(-1);
+                if (offset != UINT32_MAX)
+                    return UINT32_MAX;
                 offset = segment->start;
             }
             segment = segment->next;
         }
         return offset;
     }
 
 #ifdef DEBUG
@@ -605,52 +605,52 @@ class SSAValue
     }
 
     bool equals(const SSAValue &o) const {
         return !memcmp(this, &o, sizeof(SSAValue));
     }
 
     /* Accessors for values pushed by a bytecode within this script. */
 
-    uint32 pushedOffset() const {
+    uint32_t pushedOffset() const {
         JS_ASSERT(kind() == PUSHED);
         return u.pushed.offset;
     }
 
-    uint32 pushedIndex() const {
+    uint32_t pushedIndex() const {
         JS_ASSERT(kind() == PUSHED);
         return u.pushed.index;
     }
 
     /* Accessors for initial and written values of arguments and (undefined) locals. */
 
     bool varInitial() const {
         JS_ASSERT(kind() == VAR);
         return u.var.initial;
     }
 
-    uint32 varSlot() const {
+    uint32_t varSlot() const {
         JS_ASSERT(kind() == VAR);
         return u.var.slot;
     }
 
-    uint32 varOffset() const {
+    uint32_t varOffset() const {
         JS_ASSERT(!varInitial());
         return u.var.offset;
     }
 
     /* Accessors for phi nodes. */
 
-    uint32 phiSlot() const;
-    uint32 phiLength() const;
-    const SSAValue &phiValue(uint32 i) const;
+    uint32_t phiSlot() const;
+    uint32_t phiLength() const;
+    const SSAValue &phiValue(uint32_t i) const;
     types::TypeSet *phiTypes() const;
 
     /* Offset at which this phi node was created. */
-    uint32 phiOffset() const {
+    uint32_t phiOffset() const {
         JS_ASSERT(kind() == PHI);
         return u.phi.offset;
     }
 
     SSAPhiNode *phiNode() const {
         JS_ASSERT(kind() == PHI);
         return u.phi.node;
     }
@@ -661,160 +661,160 @@ class SSAValue
     void print() const;
 #endif
 
     void clear() {
         PodZero(this);
         JS_ASSERT(kind() == EMPTY);
     }
 
-    void initPushed(uint32 offset, uint32 index) {
+    void initPushed(uint32_t offset, uint32_t index) {
         clear();
         u.pushed.kind = PUSHED;
         u.pushed.offset = offset;
         u.pushed.index = index;
     }
 
-    static SSAValue PushedValue(uint32 offset, uint32 index) {
+    static SSAValue PushedValue(uint32_t offset, uint32_t index) {
         SSAValue v;
         v.initPushed(offset, index);
         return v;
     }
 
-    void initInitial(uint32 slot) {
+    void initInitial(uint32_t slot) {
         clear();
         u.var.kind = VAR;
         u.var.initial = true;
         u.var.slot = slot;
     }
 
-    void initWritten(uint32 slot, uint32 offset) {
+    void initWritten(uint32_t slot, uint32_t offset) {
         clear();
         u.var.kind = VAR;
         u.var.initial = false;
         u.var.slot = slot;
         u.var.offset = offset;
     }
 
-    static SSAValue WrittenVar(uint32 slot, uint32 offset) {
+    static SSAValue WrittenVar(uint32_t slot, uint32_t offset) {
         SSAValue v;
         v.initWritten(slot, offset);
         return v;
     }
 
-    void initPhi(uint32 offset, SSAPhiNode *node) {
+    void initPhi(uint32_t offset, SSAPhiNode *node) {
         clear();
         u.phi.kind = PHI;
         u.phi.offset = offset;
         u.phi.node = node;
     }
 
-    static SSAValue PhiValue(uint32 offset, SSAPhiNode *node) {
+    static SSAValue PhiValue(uint32_t offset, SSAPhiNode *node) {
         SSAValue v;
         v.initPhi(offset, node);
         return v;
     }
 
   private:
     union {
         struct {
             Kind kind : 2;
-            uint32 offset : 30;
-            uint32 index;
+            uint32_t offset : 30;
+            uint32_t index;
         } pushed;
         struct {
             Kind kind : 2;
             bool initial : 1;
-            uint32 slot : 29;
-            uint32 offset;
+            uint32_t slot : 29;
+            uint32_t offset;
         } var;
         struct {
             Kind kind : 2;
-            uint32 offset : 30;
+            uint32_t offset : 30;
             SSAPhiNode *node;
         } phi;
     } u;
 };
 
 /*
  * Mutable component of a phi node, with the possible values of the phi
  * and the possible types of the node as determined by type inference.
  * When phi nodes are copied around, any updates to the original will
  * be seen by all copies made.
  */
 struct SSAPhiNode
 {
     types::TypeSet types;
-    uint32 slot;
-    uint32 length;
+    uint32_t slot;
+    uint32_t length;
     SSAValue *options;
     SSAUseChain *uses;
     SSAPhiNode() { PodZero(this); }
 };
 
-inline uint32
+inline uint32_t
 SSAValue::phiSlot() const
 {
     return u.phi.node->slot;
 }
 
-inline uint32
+inline uint32_t
 SSAValue::phiLength() const
 {
     JS_ASSERT(kind() == PHI);
     return u.phi.node->length;
 }
 
 inline const SSAValue &
-SSAValue::phiValue(uint32 i) const
+SSAValue::phiValue(uint32_t i) const
 {
     JS_ASSERT(kind() == PHI && i < phiLength());
     return u.phi.node->options[i];
 }
 
 inline types::TypeSet *
 SSAValue::phiTypes() const
 {
     JS_ASSERT(kind() == PHI);
     return &u.phi.node->types;
 }
 
 class SSAUseChain
 {
   public:
     bool popped : 1;
-    uint32 offset : 31;
+    uint32_t offset : 31;
     /* FIXME: Assert that only the proper arm of this union is accessed. */
     union {
-        uint32 which;
+        uint32_t which;
         SSAPhiNode *phi;
     } u;
     SSAUseChain *next;
 
     SSAUseChain() { PodZero(this); }
 };
 
 class SlotValue
 {
   public:
-    uint32 slot;
+    uint32_t slot;
     SSAValue value;
-    SlotValue(uint32 slot, const SSAValue &value) : slot(slot), value(value) {}
+    SlotValue(uint32_t slot, const SSAValue &value) : slot(slot), value(value) {}
 };
 
 /* Analysis information about a script. */
 class ScriptAnalysis
 {
     friend class Bytecode;
 
     JSScript *script;
 
     Bytecode **codeArray;
 
-    uint32 numSlots;
+    uint32_t numSlots;
 
     bool outOfMemory;
     bool hadFailure;
 
     JSPackedBool *escapedSlots;
 
     /* Which analyses have been performed. */
     bool ranBytecode_;
@@ -835,17 +835,17 @@ class ScriptAnalysis
     bool hasFunctionCalls_:1;
     bool modifiesArguments_:1;
     bool extendsScope_:1;
     bool addsScopeObjects_:1;
     bool localsAliasStack_:1;
     bool isInlineable:1;
     bool canTrackVars:1;
 
-    uint32 numReturnSites_;
+    uint32_t numReturnSites_;
 
     /* --------- Lifetime analysis --------- */
 
     LifetimeVariable *lifetimes;
 
   public:
 
     ScriptAnalysis(JSScript *script) { 
@@ -866,27 +866,27 @@ class ScriptAnalysis
     void analyzeLifetimes(JSContext *cx);
     void analyzeTypes(JSContext *cx);
 
     /* Analyze the effect of invoking 'new' on script. */
     void analyzeTypesNew(JSContext *cx);
 
     bool OOM() { return outOfMemory; }
     bool failed() { return hadFailure; }
-    bool inlineable(uint32 argc) { return isInlineable && argc == script->function()->nargs; }
+    bool inlineable(uint32_t argc) { return isInlineable && argc == script->function()->nargs; }
 
     /* Whether there are POPV/SETRVAL bytecodes which can write to the frame's rval. */
     bool usesReturnValue() const { return usesReturnValue_; }
 
     /* Whether there are NAME bytecodes which can access the frame's scope chain. */
     bool usesScopeChain() const { return usesScopeChain_; }
 
     bool usesThisValue() const { return usesThisValue_; }
     bool hasFunctionCalls() const { return hasFunctionCalls_; }
-    uint32 numReturnSites() const { return numReturnSites_; }
+    uint32_t numReturnSites() const { return numReturnSites_; }
 
     /*
      * True if all named formal arguments are not modified. If the arguments
      * object cannot escape, the arguments are never modified within the script.
      */
     bool modifiesArguments() { return modifiesArguments_; }
 
     /*
@@ -901,30 +901,30 @@ class ScriptAnalysis
     /*
      * True if there are any LOCAL opcodes aliasing values on the stack (above
      * script->nfixed).
      */
     bool localsAliasStack() { return localsAliasStack_; }
 
     /* Accessors for bytecode information. */
 
-    Bytecode& getCode(uint32 offset) {
+    Bytecode& getCode(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         JS_ASSERT(codeArray[offset]);
         return *codeArray[offset];
     }
     Bytecode& getCode(const jsbytecode *pc) { return getCode(pc - script->code); }
 
-    Bytecode* maybeCode(uint32 offset) {
+    Bytecode* maybeCode(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         return codeArray[offset];
     }
     Bytecode* maybeCode(const jsbytecode *pc) { return maybeCode(pc - script->code); }
 
-    bool jumpTarget(uint32 offset) {
+    bool jumpTarget(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         return codeArray[offset] && codeArray[offset]->jumpTarget;
     }
     bool jumpTarget(const jsbytecode *pc) { return jumpTarget(pc - script->code); }
 
     bool popGuaranteed(jsbytecode *pc) {
         jsbytecode *next = pc + GetBytecodeLength(pc);
         return JSOp(*next) == JSOP_POP && !jumpTarget(next);
@@ -935,73 +935,73 @@ class ScriptAnalysis
         return (cs->format & JOF_POST) && !popGuaranteed(pc);
     }
 
     types::TypeSet *bytecodeTypes(const jsbytecode *pc) {
         JS_ASSERT(js_CodeSpec[*pc].format & JOF_TYPESET);
         return getCode(pc).observedTypes;
     }
 
-    const SSAValue &poppedValue(uint32 offset, uint32 which) {
+    const SSAValue &poppedValue(uint32_t offset, uint32_t which) {
         JS_ASSERT(offset < script->length);
         JS_ASSERT(which < GetUseCount(script, offset) +
                   (ExtendedUse(script->code + offset) ? 1 : 0));
         return getCode(offset).poppedValues[which];
     }
-    const SSAValue &poppedValue(const jsbytecode *pc, uint32 which) {
+    const SSAValue &poppedValue(const jsbytecode *pc, uint32_t which) {
         return poppedValue(pc - script->code, which);
     }
 
-    const SlotValue *newValues(uint32 offset) {
+    const SlotValue *newValues(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         return getCode(offset).newValues;
     }
     const SlotValue *newValues(const jsbytecode *pc) { return newValues(pc - script->code); }
 
-    types::TypeSet *pushedTypes(uint32 offset, uint32 which = 0) {
+    types::TypeSet *pushedTypes(uint32_t offset, uint32_t which = 0) {
         JS_ASSERT(offset < script->length);
         JS_ASSERT(which < GetDefCount(script, offset) +
                   (ExtendedDef(script->code + offset) ? 1 : 0));
         types::TypeSet *array = getCode(offset).pushedTypes;
         JS_ASSERT(array);
         return array + which;
     }
-    types::TypeSet *pushedTypes(const jsbytecode *pc, uint32 which) {
+    types::TypeSet *pushedTypes(const jsbytecode *pc, uint32_t which) {
         return pushedTypes(pc - script->code, which);
     }
 
     bool hasPushedTypes(const jsbytecode *pc) { return getCode(pc).pushedTypes != NULL; }
 
-    types::TypeBarrier *typeBarriers(JSContext *cx, uint32 offset) {
+    types::TypeBarrier *typeBarriers(JSContext *cx, uint32_t offset) {
         if (getCode(offset).typeBarriers)
             pruneTypeBarriers(cx, offset);
         return getCode(offset).typeBarriers;
     }
     types::TypeBarrier *typeBarriers(JSContext *cx, const jsbytecode *pc) {
         return typeBarriers(cx, pc - script->code);
     }
     void addTypeBarrier(JSContext *cx, const jsbytecode *pc,
                         types::TypeSet *target, types::Type type);
     void addSingletonTypeBarrier(JSContext *cx, const jsbytecode *pc,
                                  types::TypeSet *target, JSObject *singleton, jsid singletonId);
 
     /* Remove obsolete type barriers at the given offset. */
-    void pruneTypeBarriers(JSContext *cx, uint32 offset);
+    void pruneTypeBarriers(JSContext *cx, uint32_t offset);
 
     /*
      * Remove still-active type barriers at the given offset. If 'all' is set,
      * then all barriers are removed, otherwise only those deemed excessive
      * are removed.
      */
-    void breakTypeBarriers(JSContext *cx, uint32 offset, bool all);
+    void breakTypeBarriers(JSContext *cx, uint32_t offset, bool all);
 
     /* Break all type barriers used in computing v. */
     void breakTypeBarriersSSA(JSContext *cx, const SSAValue &v);
 
-    inline void addPushedType(JSContext *cx, uint32 offset, uint32 which, types::Type type);
+    inline void addPushedType(JSContext *cx, uint32_t offset, uint32_t which, types::Type type);
 
     types::TypeSet *getValueTypes(const SSAValue &v) {
         switch (v.kind()) {
           case SSAValue::PUSHED:
             return pushedTypes(v.pushedOffset(), v.pushedIndex());
           case SSAValue::VAR:
             JS_ASSERT(!slotEscapes(v.varSlot()));
             if (v.varInitial()) {
@@ -1019,20 +1019,20 @@ class ScriptAnalysis
             return &v.phiNode()->types;
           default:
             /* Cannot compute types for empty SSA values. */
             JS_NOT_REACHED("Bad SSA value");
             return NULL;
         }
     }
 
-    types::TypeSet *poppedTypes(uint32 offset, uint32 which) {
+    types::TypeSet *poppedTypes(uint32_t offset, uint32_t which) {
         return getValueTypes(poppedValue(offset, which));
     }
-    types::TypeSet *poppedTypes(const jsbytecode *pc, uint32 which) {
+    types::TypeSet *poppedTypes(const jsbytecode *pc, uint32_t which) {
         return getValueTypes(poppedValue(pc, which));
     }
 
     /* Whether an arithmetic operation is operating on integers, with an integer result. */
     bool integerOperation(JSContext *cx, jsbytecode *pc);
 
     bool trackUseChain(const SSAValue &v) {
         JS_ASSERT_IF(v.kind() == SSAValue::VAR, trackSlot(v.varSlot()));
@@ -1048,25 +1048,25 @@ class ScriptAnalysis
         JS_ASSERT(trackUseChain(v));
         if (v.kind() == SSAValue::PUSHED)
             return getCode(v.pushedOffset()).pushedUses[v.pushedIndex()];
         if (v.kind() == SSAValue::VAR)
             return getCode(v.varOffset()).pushedUses[GetDefCount(script, v.varOffset())];
         return v.phiNode()->uses;
     }
 
-    mjit::RegisterAllocation *&getAllocation(uint32 offset) {
+    mjit::RegisterAllocation *&getAllocation(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         return getCode(offset).allocation;
     }
     mjit::RegisterAllocation *&getAllocation(const jsbytecode *pc) {
         return getAllocation(pc - script->code);
     }
 
-    LoopAnalysis *getLoop(uint32 offset) {
+    LoopAnalysis *getLoop(uint32_t offset) {
         JS_ASSERT(offset < script->length);
         return getCode(offset).loop;
     }
     LoopAnalysis *getLoop(const jsbytecode *pc) { return getLoop(pc - script->code); }
 
     /* For a JSOP_CALL* op, get the pc of the corresponding JSOP_CALL/NEW/etc. */
     jsbytecode *getCallPC(jsbytecode *pc)
     {
@@ -1080,49 +1080,49 @@ class ScriptAnalysis
 
     /*
      * Escaping slots include all slots that can be accessed in ways other than
      * through the corresponding LOCAL/ARG opcode. This includes all closed
      * slots in the script, all slots in scripts which use eval or are in debug
      * mode, and slots which are aliased by NAME or similar opcodes in the
      * containing script (which does not imply the variable is closed).
      */
-    bool slotEscapes(uint32 slot) {
+    bool slotEscapes(uint32_t slot) {
         JS_ASSERT(script->compartment()->activeAnalysis);
         if (slot >= numSlots)
             return true;
         return escapedSlots[slot];
     }
 
     /*
      * Whether we distinguish different writes of this variable while doing
      * SSA analysis. Escaping locals can be written in other scripts, and the
      * presence of NAME opcodes, switch or try blocks keeps us from tracking
      * variable values at each point.
      */
-    bool trackSlot(uint32 slot) { return !slotEscapes(slot) && canTrackVars; }
+    bool trackSlot(uint32_t slot) { return !slotEscapes(slot) && canTrackVars; }
 
-    const LifetimeVariable & liveness(uint32 slot) {
+    const LifetimeVariable & liveness(uint32_t slot) {
         JS_ASSERT(script->compartment()->activeAnalysis);
         JS_ASSERT(!slotEscapes(slot));
         return lifetimes[slot];
     }
 
     /*
      * If a NAME or similar opcode is definitely accessing a particular slot
      * of a script this one is nested in, get that script/slot.
      */
     struct NameAccess {
         JSScript *script;
         types::TypeScriptNesting *nesting;
-        uint32 slot;
+        uint32_t slot;
 
         /* Decompose the slot above. */
         bool arg;
-        uint32 index;
+        uint32_t index;
     };
     NameAccess resolveNameAccess(JSContext *cx, jsid id, bool addDependency = false);
 
     void printSSA(JSContext *cx);
     void printTypes(JSContext *cx);
 
     void clearAllocations();
 
@@ -1144,27 +1144,27 @@ class ScriptAnalysis
     inline void addVariable(JSContext *cx, LifetimeVariable &var, unsigned offset,
                             LifetimeVariable **&saved, unsigned &savedCount);
     inline void killVariable(JSContext *cx, LifetimeVariable &var, unsigned offset,
                              LifetimeVariable **&saved, unsigned &savedCount);
     inline void extendVariable(JSContext *cx, LifetimeVariable &var, unsigned start, unsigned end);
     inline void ensureVariable(LifetimeVariable &var, unsigned until);
 
     /* SSA helpers */
-    bool makePhi(JSContext *cx, uint32 slot, uint32 offset, SSAValue *pv);
+    bool makePhi(JSContext *cx, uint32_t slot, uint32_t offset, SSAValue *pv);
     void insertPhi(JSContext *cx, SSAValue &phi, const SSAValue &v);
-    void mergeValue(JSContext *cx, uint32 offset, const SSAValue &v, SlotValue *pv);
-    void checkPendingValue(JSContext *cx, const SSAValue &v, uint32 slot,
+    void mergeValue(JSContext *cx, uint32_t offset, const SSAValue &v, SlotValue *pv);
+    void checkPendingValue(JSContext *cx, const SSAValue &v, uint32_t slot,
                            Vector<SlotValue> *pending);
-    void checkBranchTarget(JSContext *cx, uint32 targetOffset, Vector<uint32> &branchTargets,
-                           SSAValue *values, uint32 stackDepth);
-    void mergeBranchTarget(JSContext *cx, const SSAValue &value, uint32 slot,
-                           const Vector<uint32> &branchTargets);
-    void removeBranchTarget(Vector<uint32> &branchTargets, uint32 offset);
-    void freezeNewValues(JSContext *cx, uint32 offset);
+    void checkBranchTarget(JSContext *cx, uint32_t targetOffset, Vector<uint32_t> &branchTargets,
+                           SSAValue *values, uint32_t stackDepth);
+    void mergeBranchTarget(JSContext *cx, const SSAValue &value, uint32_t slot,
+                           const Vector<uint32_t> &branchTargets);
+    void removeBranchTarget(Vector<uint32_t> &branchTargets, uint32_t offset);
+    void freezeNewValues(JSContext *cx, uint32_t offset);
 
     struct TypeInferenceState {
         Vector<SSAPhiNode *> phiNodes;
         bool hasGetSet;
         bool hasHole;
         types::TypeSet *forTypes;
         TypeInferenceState(JSContext *cx)
             : phiNodes(cx), hasGetSet(false), hasHole(false), forTypes(NULL)
@@ -1229,63 +1229,63 @@ struct CrossSSAValue
  * Analysis for managing SSA values from multiple call stack frames. These are
  * created by the backend compiler when inlining functions, and allow for
  * values to be tracked as they flow into or out of the inlined frames.
  */
 class CrossScriptSSA
 {
   public:
 
-    static const uint32 OUTER_FRAME = uint32(-1);
-    static const unsigned INVALID_FRAME = uint32(-2);
+    static const uint32_t OUTER_FRAME = UINT32_MAX;
+    static const unsigned INVALID_FRAME = uint32_t(-2);
 
     struct Frame {
-        uint32 index;
+        uint32_t index;
         JSScript *script;
-        uint32 depth;  /* Distance from outer frame to this frame, in sizeof(Value) */
-        uint32 parent;
+        uint32_t depth;  /* Distance from outer frame to this frame, in sizeof(Value) */
+        uint32_t parent;
         jsbytecode *parentpc;
 
-        Frame(uint32 index, JSScript *script, uint32 depth, uint32 parent, jsbytecode *parentpc)
+        Frame(uint32_t index, JSScript *script, uint32_t depth, uint32_t parent, jsbytecode *parentpc)
             : index(index), script(script), depth(depth), parent(parent), parentpc(parentpc)
         {}
     };
 
-    const Frame &getFrame(uint32 index) {
+    const Frame &getFrame(uint32_t index) {
         if (index == OUTER_FRAME)
             return outerFrame;
         return inlineFrames[index];
     }
 
     unsigned numFrames() { return 1 + inlineFrames.length(); }
     const Frame &iterFrame(unsigned i) {
         if (i == 0)
             return outerFrame;
         return inlineFrames[i - 1];
     }
 
     JSScript *outerScript() { return outerFrame.script; }
 
     /* Total length of scripts preceding a frame. */
-    size_t frameLength(uint32 index) {
+    size_t frameLength(uint32_t index) {
         if (index == OUTER_FRAME)
             return 0;
         size_t res = outerFrame.script->length;
         for (unsigned i = 0; i < index; i++)
             res += inlineFrames[i].script->length;
         return res;
     }
 
     types::TypeSet *getValueTypes(const CrossSSAValue &cv) {
         return getFrame(cv.frame).script->analysis()->getValueTypes(cv.v);
     }
 
-    bool addInlineFrame(JSScript *script, uint32 depth, uint32 parent, jsbytecode *parentpc)
+    bool addInlineFrame(JSScript *script, uint32_t depth, uint32_t parent, jsbytecode *parentpc)
     {
-        uint32 index = inlineFrames.length();
+        uint32_t index = inlineFrames.length();
         return inlineFrames.append(Frame(index, script, depth, parent, parentpc));
     }
 
     CrossScriptSSA(JSContext *cx, JSScript *outer)
         : cx(cx), outerFrame(OUTER_FRAME, outer, 0, INVALID_FRAME, NULL), inlineFrames(cx)
     {}
 
     CrossSSAValue foldValue(const CrossSSAValue &cv);
--- a/js/src/jsapi-tests/testDebugger.cpp
+++ b/js/src/jsapi-tests/testDebugger.cpp
@@ -118,18 +118,18 @@ ThrowHook(JSContext *cx, JSScript *, jsb
     jsval _;
     JS_EvaluateScript(cx, global, text, strlen(text), "", 0, &_);
 
     return JSTRAP_CONTINUE;
 }
 
 BEGIN_TEST(testDebugger_throwHook)
 {
-    uint32 newopts = JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS;
-    uint32 oldopts = JS_SetOptions(cx, newopts);
+    uint32_t newopts = JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS;
+    uint32_t oldopts = JS_SetOptions(cx, newopts);
 
     JSDebugHooks hooks = { 0 };
     hooks.throwHook = ThrowHook;
     JSDebugHooks *old = JS_SetContextDebugHooks(cx, &hooks);
     EXEC("function foo() { throw 3 };\n"
          "for (var i = 0; i < 10; ++i) { \n"
          "  var x = <tag></tag>;\n"
          "  try {\n"
@@ -254,17 +254,17 @@ bool testIndirectEval(JSObject *scope, J
 }
 END_TEST(testDebugger_newScriptHook)
 
 BEGIN_TEST(testDebugger_singleStepThrow)
     {
         CHECK(JS_SetDebugModeForCompartment(cx, cx->compartment, true));
         CHECK(JS_SetInterrupt(rt, onStep, NULL));
 
-        uint32 opts = JS_GetOptions(cx);
+        uint32_t opts = JS_GetOptions(cx);
         opts |= JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS;
         JS_SetOptions(cx, opts);
 
         CHECK(JS_DefineFunction(cx, global, "setStepMode", setStepMode, 0, 0));
         EXEC("var e;\n"
              "setStepMode();\n"
              "function f() { throw 0; }\n"
              "try { f(); }\n"
--- a/js/src/jsapi-tests/testIndexToString.cpp
+++ b/js/src/jsapi-tests/testIndexToString.cpp
@@ -15,17 +15,17 @@ using namespace mozilla;
 
 template<size_t N> JSFlatString *
 NewString(JSContext *cx, const jschar (&chars)[N])
 {
     return js_NewStringCopyN(cx, chars, N);
 }
 
 static const struct TestPair {
-    uint32 num;
+    uint32_t num;
     const char *expected;
 } tests[] = {
     { 0, "0" },
     { 1, "1" },
     { 2, "2" },
     { 9, "9" },
     { 10, "10" },
     { 15, "15" },
@@ -49,17 +49,17 @@ static const struct TestPair {
     { 2147483649u, "2147483649" },
     { 4294967294u, "4294967294" },
     { 4294967295u, "4294967295" },
 };
 
 BEGIN_TEST(testIndexToString)
 {
     for (size_t i = 0, sz = ArrayLength(tests); i < sz; i++) {
-        uint32 u = tests[i].num;
+        uint32_t u = tests[i].num;
         JSString *str = js::IndexToString(cx, u);
         CHECK(str);
 
         if (!js::StaticStrings::hasUint(u))
             CHECK(cx->compartment->dtoaCache.lookup(10, u) == str);
 
         JSBool match = JS_FALSE;
         CHECK(JS_StringEqualsAscii(cx, str, tests[i].expected, &match));
@@ -68,32 +68,32 @@ BEGIN_TEST(testIndexToString)
 
     return true;
 }
 END_TEST(testIndexToString)
 
 BEGIN_TEST(testStringIsIndex)
 {
     for (size_t i = 0, sz = ArrayLength(tests); i < sz; i++) {
-        uint32 u = tests[i].num;
+        uint32_t u = tests[i].num;
         JSFlatString *str = js::IndexToString(cx, u);
         CHECK(str);
 
-        uint32 n;
+        uint32_t n;
         CHECK(str->isIndex(&n));
         CHECK(u == n);
     }
 
     return true;
 }
 END_TEST(testStringIsIndex)
 
 BEGIN_TEST(testStringToPropertyName)
 {
-    uint32 index;
+    uint32_t index;
 
     static const jschar hiChars[] = { 'h', 'i' };
     JSFlatString *hiStr = NewString(cx, hiChars);
     CHECK(hiStr);
     CHECK(!hiStr->isIndex(&index));
     CHECK(hiStr->toPropertyName(cx) != NULL);
 
     static const jschar maxChars[] = { '4', '2', '9', '4', '9', '6', '7', '2', '9', '5' };
--- a/js/src/jsapi-tests/testXDR.cpp
+++ b/js/src/jsapi-tests/testXDR.cpp
@@ -18,17 +18,17 @@ BEGIN_TEST(testXDR_bug506491)
     // compile
     JSScript *script = JS_CompileScript(cx, global, s, strlen(s), __FILE__, __LINE__);
     CHECK(script);
 
     // freeze
     JSXDRState *w = JS_XDRNewMem(cx, JSXDR_ENCODE);
     CHECK(w);
     CHECK(JS_XDRScript(w, &script));
-    uint32 nbytes;
+    uint32_t nbytes;
     void *p = JS_XDRMemGetData(w, &nbytes);
     CHECK(p);
     void *frozen = JS_malloc(cx, nbytes);
     CHECK(frozen);
     memcpy(frozen, p, nbytes);
     JS_XDRDestroy(w);
 
     // thaw
@@ -58,17 +58,17 @@ BEGIN_TEST(testXDR_bug516827)
     // compile an empty script
     JSScript *script = JS_CompileScript(cx, global, "", 0, __FILE__, __LINE__);
     CHECK(script);
 
     // freeze
     JSXDRState *w = JS_XDRNewMem(cx, JSXDR_ENCODE);
     CHECK(w);
     CHECK(JS_XDRScript(w, &script));
-    uint32 nbytes;
+    uint32_t nbytes;
     void *p = JS_XDRMemGetData(w, &nbytes);
     CHECK(p);
     void *frozen = JS_malloc(cx, nbytes);
     CHECK(frozen);
     memcpy(frozen, p, nbytes);
     JS_XDRDestroy(w);
 
     // thaw
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -176,17 +176,17 @@ const jsval JSVAL_ONE   = IMPL_TO_JSVAL(
 const jsval JSVAL_FALSE = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_BOOLEAN,   JS_FALSE));
 const jsval JSVAL_TRUE  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_BOOLEAN,   JS_TRUE));
 const jsval JSVAL_VOID  = IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0));
 
 /* Make sure that jschar is two bytes unsigned integer */
 JS_STATIC_ASSERT((jschar)-1 > 0);
 JS_STATIC_ASSERT(sizeof(jschar) == 2);
 
-JS_PUBLIC_API(int64)
+JS_PUBLIC_API(int64_t)
 JS_Now()
 {
     return PRMJ_Now();
 }
 
 JS_PUBLIC_API(jsval)
 JS_GetNaNValue(JSContext *cx)
 {
@@ -285,29 +285,29 @@ JS_ConvertArgumentsVA(JSContext *cx, uin
             }
             break;
         }
         switch (c) {
           case 'b':
             *va_arg(ap, JSBool *) = js_ValueToBoolean(*sp);
             break;
           case 'c':
-            if (!JS_ValueToUint16(cx, *sp, va_arg(ap, uint16 *)))
+            if (!JS_ValueToUint16(cx, *sp, va_arg(ap, uint16_t *)))
                 return JS_FALSE;
             break;
           case 'i':
-            if (!JS_ValueToECMAInt32(cx, *sp, va_arg(ap, int32 *)))
+            if (!JS_ValueToECMAInt32(cx, *sp, va_arg(ap, int32_t *)))
                 return JS_FALSE;
             break;
           case 'u':
-            if (!JS_ValueToECMAUint32(cx, *sp, va_arg(ap, uint32 *)))
+            if (!JS_ValueToECMAUint32(cx, *sp, va_arg(ap, uint32_t *)))
                 return JS_FALSE;
             break;
           case 'j':
-            if (!JS_ValueToInt32(cx, *sp, va_arg(ap, int32 *)))
+            if (!JS_ValueToInt32(cx, *sp, va_arg(ap, int32_t *)))
                 return JS_FALSE;
             break;
           case 'd':
             if (!JS_ValueToNumber(cx, *sp, va_arg(ap, jsdouble *)))
                 return JS_FALSE;
             break;
           case 'I':
             if (!JS_ValueToNumber(cx, *sp, &d))
@@ -508,60 +508,60 @@ JS_ValueToNumber(JSContext *cx, jsval v,
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DoubleIsInt32(jsdouble d, jsint *ip)
 {
     return JSDOUBLE_IS_INT32(d, (int32_t *)ip);
 }
 
-JS_PUBLIC_API(int32)
+JS_PUBLIC_API(int32_t)
 JS_DoubleToInt32(jsdouble d)
 {
     return js_DoubleToECMAInt32(d);
 }
 
-JS_PUBLIC_API(uint32)
+JS_PUBLIC_API(uint32_t)
 JS_DoubleToUint32(jsdouble d)
 {
     return js_DoubleToECMAUint32(d);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ValueToECMAInt32(JSContext *cx, jsval v, int32 *ip)
+JS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
     AutoValueRooter tvr(cx, v);
     return ToInt32(cx, tvr.value(), (int32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32 *ip)
+JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
     AutoValueRooter tvr(cx, v);
     return ToUint32(cx, tvr.value(), (uint32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ValueToInt32(JSContext *cx, jsval v, int32 *ip)
+JS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
     AutoValueRooter tvr(cx, v);
     return NonstandardToInt32(cx, tvr.value(), (int32_t *)ip);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ValueToUint16(JSContext *cx, jsval v, uint16 *ip)
+JS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, v);
 
     AutoValueRooter tvr(cx, v);
     return ValueToUint16(cx, tvr.value(), (uint16_t *)ip);
 }
 
@@ -730,17 +730,17 @@ JSRuntime::JSRuntime()
     JS_INIT_CLIST(&contextList);
     JS_INIT_CLIST(&debuggerList);
 
     PodZero(&globalDebugHooks);
     PodZero(&atomState);
 }
 
 bool
-JSRuntime::init(uint32 maxbytes)
+JSRuntime::init(uint32_t maxbytes)
 {
 #ifdef JS_THREADSAFE
     ownerThread_ = js_CurrentThreadId();
 #endif
 
 #ifdef JS_METHODJIT_SPEW
     JMCheckLogging();
 #endif
@@ -840,17 +840,17 @@ JSRuntime::clearOwnerThread()
 JS_FRIEND_API(bool)
 JSRuntime::onOwnerThread() const
 {
     return ownerThread_ == js_CurrentThreadId();
 }
 #endif
 
 JS_PUBLIC_API(JSRuntime *)
-JS_NewRuntime(uint32 maxbytes)
+JS_NewRuntime(uint32_t maxbytes)
 {
     if (!js_NewRuntimeWasCalled) {
 #ifdef DEBUG
         /*
          * This code asserts that the numbers associated with the error names
          * in jsmsg.def are monotonically increasing.  It uses values for the
          * error names enumerated in jscntxt.c.  It's not a compile-time check
          * but it's better than nothing.
@@ -1212,17 +1212,17 @@ JS_StringToVersion(const char *string)
     int i;
 
     for (i = 0; v2smap[i].string; i++)
         if (strcmp(v2smap[i].string, string) == 0)
             return v2smap[i].version;
     return JSVERSION_UNKNOWN;
 }
 
-JS_PUBLIC_API(uint32)
+JS_PUBLIC_API(uint32_t)
 JS_GetOptions(JSContext *cx)
 {
     /*
      * Can't check option/version synchronization here.
      * We may have been synchronized with a script version that was formerly on
      * the stack, but has now been popped.
      */
     return cx->allOptions();
@@ -1236,25 +1236,25 @@ SetOptionsCommon(JSContext *cx, uintN op
     uintN newropts = options & JSRUNOPTION_MASK;
     uintN newcopts = options & JSCOMPILEOPTION_MASK;
     cx->setRunOptions(newropts);
     cx->setCompileOptions(newcopts);
     cx->updateJITEnabled();
     return oldopts;
 }
 
-JS_PUBLIC_API(uint32)
-JS_SetOptions(JSContext *cx, uint32 options)
+JS_PUBLIC_API(uint32_t)
+JS_SetOptions(JSContext *cx, uint32_t options)
 {
     AutoLockGC lock(cx->runtime);
     return SetOptionsCommon(cx, options);
 }
 
-JS_PUBLIC_API(uint32)
-JS_ToggleOptions(JSContext *cx, uint32 options)
+JS_PUBLIC_API(uint32_t)
+JS_ToggleOptions(JSContext *cx, uint32_t options)
 {
     AutoLockGC lock(cx->runtime);
     uintN oldopts = cx->allOptions();
     uintN newopts = oldopts ^ options;
     return SetOptionsCommon(cx, newopts);
 }
 
 JS_PUBLIC_API(const char *)
@@ -2259,17 +2259,17 @@ JS_DumpNamedRoots(JSRuntime *rt,
                   void (*dump)(const char *name, void *rp, JSGCRootType type, void *data),
                   void *data)
 {
     js_DumpNamedRoots(rt, dump, data);
 }
 
 #endif /* DEBUG */
 
-JS_PUBLIC_API(uint32)
+JS_PUBLIC_API(uint32_t)
 JS_MapGCRoots(JSRuntime *rt, JSGCRootMapFun map, void *data)
 {
     return js_MapGCRoots(rt, map, data);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_LockGCThing(JSContext *cx, void *thing)
 {
@@ -2775,17 +2775,17 @@ JS_PUBLIC_API(JSBool)
 JS_IsAboutToBeFinalized(JSContext *cx, void *thing)
 {
     JS_ASSERT(thing);
     JS_ASSERT(!cx->runtime->gcIncrementalTracer);
     return IsAboutToBeFinalized(cx, (gc::Cell *)thing);
 }
 
 JS_PUBLIC_API(void)
-JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32 value)
+JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value)
 {
     switch (key) {
       case JSGC_MAX_BYTES:
         rt->gcMaxBytes = value;
         break;
       case JSGC_MAX_MALLOC_BYTES:
         rt->setGCMaxMallocBytes(value);
         break;
@@ -2796,47 +2796,47 @@ JS_SetGCParameter(JSRuntime *rt, JSGCPar
         JS_ASSERT(key == JSGC_MODE);
         rt->gcMode = JSGCMode(value);
         JS_ASSERT(rt->gcMode == JSGC_MODE_GLOBAL ||
                   rt->gcMode == JSGC_MODE_COMPARTMENT);
         return;
     }
 }
 
-JS_PUBLIC_API(uint32)
+JS_PUBLIC_API(uint32_t)
 JS_GetGCParameter(JSRuntime *rt, JSGCParamKey key)
 {
     switch (key) {
       case JSGC_MAX_BYTES:
         return rt->gcMaxBytes;
       case JSGC_MAX_MALLOC_BYTES:
         return rt->gcMaxMallocBytes;
       case JSGC_STACKPOOL_LIFESPAN:
         return rt->gcEmptyArenaPoolLifespan;
       case JSGC_BYTES:
         return rt->gcBytes;
       case JSGC_MODE:
-        return uint32(rt->gcMode);
+        return uint32_t(rt->gcMode);
       case JSGC_UNUSED_CHUNKS:
-        return uint32(rt->gcChunkPool.getEmptyCount());
+        return uint32_t(rt->gcChunkPool.getEmptyCount());
       case JSGC_TOTAL_CHUNKS:
-        return uint32(rt->gcChunkSet.count() + rt->gcChunkPool.getEmptyCount());
+        return uint32_t(rt->gcChunkSet.count() + rt->gcChunkPool.getEmptyCount());
       default:
         JS_ASSERT(key == JSGC_NUMBER);
         return rt->gcNumber;
     }
 }
 
 JS_PUBLIC_API(void)
-JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32 value)
+JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value)
 {
     JS_ASSERT(key == JSGC_MAX_CODE_CACHE_BYTES);
 }
 
-JS_PUBLIC_API(uint32)
+JS_PUBLIC_API(uint32_t)
 JS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key)
 {
     JS_ASSERT(key == JSGC_MAX_CODE_CACHE_BYTES);
     return 0;
 }
 
 JS_PUBLIC_API(void)
 JS_FlushCaches(JSContext *cx)
@@ -3271,17 +3271,17 @@ JS_DeepFreezeObject(JSContext *cx, JSObj
     /* Assume that non-extensible objects are already deep-frozen, to avoid divergence. */
     if (!obj->isExtensible())
         return true;
 
     if (!obj->freeze(cx))
         return false;
 
     /* Walk slots in obj and if any value is a non-null object, seal it. */
-    for (uint32 i = 0, n = obj->slotSpan(); i < n; ++i) {
+    for (uint32_t i = 0, n = obj->slotSpan(); i < n; ++i) {
         const Value &v = obj->getSlot(i);
         if (v.isPrimitive())
             continue;
         if (!JS_DeepFreezeObject(cx, &v.toObject()))
             return false;
     }
 
     return true;
@@ -3371,17 +3371,17 @@ JS_LookupPropertyById(JSContext *cx, JSO
 {
     JSObject *obj2;
     JSProperty *prop;
     return LookupPropertyById(cx, obj, id, JSRESOLVE_QUALIFIED, &obj2, &prop) &&
            LookupResult(cx, obj, obj2, id, prop, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_LookupElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
+JS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return JS_LookupPropertyById(cx, obj, id, vp);
 }
 
@@ -3429,17 +3429,17 @@ JS_HasPropertyById(JSContext *cx, JSObje
     JSProperty *prop;
     JSBool ok = LookupPropertyById(cx, obj, id, JSRESOLVE_QUALIFIED | JSRESOLVE_DETECTING,
                                    &obj2, &prop);
     *foundp = (prop != NULL);
     return ok;
 }
 
 JS_PUBLIC_API(JSBool)
-JS_HasElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *foundp)
+JS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return JS_HasPropertyById(cx, obj, id, foundp);
 }
 
@@ -3475,17 +3475,17 @@ JS_AlreadyHasOwnPropertyById(JSContext *
         return JS_TRUE;
     }
 
     *foundp = obj->nativeContains(cx, id);
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
-JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *foundp)
+JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return JS_AlreadyHasOwnPropertyById(cx, obj, id, foundp);
 }
 
@@ -3538,17 +3538,17 @@ DefinePropertyById(JSContext *cx, JSObje
 JS_PUBLIC_API(JSBool)
 JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
                       JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_DefineElement(JSContext *cx, JSObject *obj, uint32 index, jsval value,
+JS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,
                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return DefinePropertyById(cx, obj, id, value, getter, setter, attrs, 0, 0);
 }
@@ -3596,17 +3596,17 @@ DefineProperty(JSContext *cx, JSObject *
 JS_PUBLIC_API(JSBool)
 JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
                   PropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     return DefineProperty(cx, obj, name, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8 tinyid,
+JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8_t tinyid,
                             jsval value, PropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     return DefineProperty(cx, obj, name, value, getter, setter, attrs, Shape::HAS_SHORTID, tinyid);
 }
 
 static JSBool
 DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
                  const Value &value, PropertyOp getter, StrictPropertyOp setter, uintN attrs,
@@ -3621,17 +3621,17 @@ JS_PUBLIC_API(JSBool)
 JS_DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
                     jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     return DefineUCProperty(cx, obj, name, namelen, value, getter, setter, attrs, 0, 0);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
-                              int8 tinyid, jsval value,
+                              int8_t tinyid, jsval value,
                               JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
 {
     return DefineUCProperty(cx, obj, name, namelen, value, getter, setter, attrs,
                             Shape::HAS_SHORTID, tinyid);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp)
@@ -3872,32 +3872,32 @@ JS_ForwardGetPropertyTo(JSContext *cx, J
 
 JS_PUBLIC_API(JSBool)
 JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsval *vp)
 {
     return GetPropertyDefault(cx, obj, id, def, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
+JS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp)
 {
     return JS_ForwardGetElementTo(cx, obj, index, obj, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp)
+JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
     return obj->getElement(cx, onBehalfOf, index, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp, JSBool* present)
+JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf, jsval *vp, JSBool* present)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
     bool isPresent;
     if (!obj->getElementIfPresent(cx, onBehalfOf, index, vp, &isPresent))
         return false;
     *present = isPresent;
@@ -3949,17 +3949,17 @@ JS_SetPropertyById(JSContext *cx, JSObje
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_ASSIGNING);
     return obj->setGeneric(cx, id, vp, false);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
+JS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_ASSIGNING);
     return obj->setElement(cx, index, vp, false);
 }
 
 JS_PUBLIC_API(JSBool)
@@ -3981,17 +3981,17 @@ JS_DeletePropertyById2(JSContext *cx, JS
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, id);
     JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
     return obj->deleteGeneric(cx, id, rval, false);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32 index, jsval *rval)
+JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval)
 {
     CHECK_REQUEST(cx);
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
     return JS_DeletePropertyById2(cx, obj, id, rval);
 }
 
@@ -4012,17 +4012,17 @@ JS_DeleteUCProperty2(JSContext *cx, JSOb
 JS_PUBLIC_API(JSBool)
 JS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id)
 {
     jsval junk;
     return JS_DeletePropertyById2(cx, obj, id, &junk);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_DeleteElement(JSContext *cx, JSObject *obj, uint32 index)
+JS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index)
 {
     jsval junk;
     return JS_DeleteElement2(cx, obj, index, &junk);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name)
 {
@@ -4067,17 +4067,17 @@ JS_Enumerate(JSContext *cx, JSObject *ob
 
 /*
  * XXX reverse iterator for properties, unreverse and meld with jsinterp.c's
  *     prop_iterator_class somehow...
  * + preserve the obj->enumerate API while optimizing the native object case
  * + native case here uses a Shape *, but that iterates in reverse!
  * + so we make non-native match, by reverse-iterating after JS_Enumerating
  */
-const uint32 JSSLOT_ITER_INDEX = 0;
+const uint32_t JSSLOT_ITER_INDEX = 0;
 
 static void
 prop_iter_finalize(JSContext *cx, JSObject *obj)
 {
     void *pdata = obj->getPrivate();
     if (!pdata)
         return;
 
@@ -4204,25 +4204,25 @@ JS_NextProperty(JSContext *cx, JSObject 
             *idp = ida->vector[--i];
             iterobj->setSlot(JSSLOT_ITER_INDEX, Int32Value(i));
         }
     }
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
-JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
+JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj);
     return js_GetReservedSlot(cx, obj, index, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v)
+JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32_t index, jsval v)
 {
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, v);
     return js_SetReservedSlot(cx, obj, index, v);
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_NewArrayObject(JSContext *cx, jsint length, jsval *vector)
@@ -4403,17 +4403,17 @@ JS_CloneFunctionObject(JSContext *cx, JS
      * they were activations, respecting the skip field in each upvar's cookie
      * but looking up the property by name instead of frame slot.
      */
     JSObject *clone = js_AllocFlatClosure(cx, fun, parent);
     if (!clone)
         return NULL;
 
     JSUpvarArray *uva = fun->script()->upvars();
-    uint32 i = uva->length;
+    uint32_t i = uva->length;
     JS_ASSERT(i != 0);
 
     for (Shape::Range r(fun->script()->bindings.lastUpvar()); i-- != 0; r.popFront()) {
         JSObject *obj = parent;
         int skip = uva->vector[i].level();
         while (--skip > 0) {
             if (!obj) {
                 JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
@@ -4445,17 +4445,17 @@ JS_GetFunctionId(JSFunction *fun)
 }
 
 JS_PUBLIC_API(uintN)
 JS_GetFunctionFlags(JSFunction *fun)
 {
     return fun->flags;
 }
 
-JS_PUBLIC_API(uint16)
+JS_PUBLIC_API(uint16_t)
 JS_GetFunctionArity(JSFunction *fun)
 {
     return fun->nargs;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ObjectIsFunction(JSContext *cx, JSObject *obj)
 {
@@ -4607,34 +4607,34 @@ struct AutoLastFrameCheck {
         }
     }
 
   private:
     JSContext       *cx;
     JS_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
-inline static uint32
+inline static uint32_t
 JS_OPTIONS_TO_TCFLAGS(JSContext *cx)
 {
     return (cx->hasRunOption(JSOPTION_COMPILE_N_GO) ? TCF_COMPILE_N_GO : 0) |
            (cx->hasRunOption(JSOPTION_NO_SCRIPT_RVAL) ? TCF_NO_SCRIPT_RVAL : 0);
 }
 
 static JSScript *
 CompileUCScriptForPrincipalsCommon(JSContext *cx, JSObject *obj, JSPrincipals *principals,
                                    const jschar *chars, size_t length,
                                    const char *filename, uintN lineno, JSVersion version)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, principals);
     AutoLastFrameCheck lfc(cx);
 
-    uint32 tcflags = JS_OPTIONS_TO_TCFLAGS(cx) | TCF_NEED_SCRIPT_GLOBAL;
+    uint32_t tcflags = JS_OPTIONS_TO_TCFLAGS(cx) | TCF_NEED_SCRIPT_GLOBAL;
     return frontend::CompileScript(cx, obj, NULL, principals, NULL, tcflags,
                                    chars, length, filename, lineno, version);
 }
 
 extern JS_PUBLIC_API(JSScript *)
 JS_CompileUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,
                                        JSPrincipals *principals,
                                        const jschar *chars, size_t length,
@@ -4801,17 +4801,17 @@ CompileFileHelper(JSContext *cx, JSObjec
         // The |i < len| is necessary for files that lie about their length,
         // e.g. /dev/zero and /dev/random.  See bug 669434.
         while (i < len && (c = fast_getc(fp)) != EOF)
             buf[i++] = (jschar) (unsigned char) c;
     }
 
     JS_ASSERT(i <= len);
     len = i;
-    uint32 tcflags = JS_OPTIONS_TO_TCFLAGS(cx) | TCF_NEED_SCRIPT_GLOBAL;
+    uint32_t tcflags = JS_OPTIONS_TO_TCFLAGS(cx) | TCF_NEED_SCRIPT_GLOBAL;
     script = frontend::CompileScript(cx, obj, NULL, principals, NULL, tcflags,
                                      buf, len, filename, 1, cx->findVersion());
     cx->free_(buf);
     return script;
 }
 
 JS_PUBLIC_API(JSScript *)
 JS_CompileFile(JSContext *cx, JSObject *obj, const char *filename)
@@ -4893,17 +4893,17 @@ CompileUCFunctionForPrincipalsCommon(JSC
     } else {
         funAtom = js_Atomize(cx, name, strlen(name));
         if (!funAtom)
             return NULL;
     }
 
     Bindings bindings(cx);
     for (uintN i = 0; i < nargs; i++) {
-        uint16 dummy;
+        uint16_t dummy;
         JSAtom *argAtom = js_Atomize(cx, argnames[i], strlen(argnames[i]));
         if (!argAtom || !bindings.addArgument(cx, argAtom, &dummy))
             return NULL;
     }
 
     JSFunction *fun = js_NewFunction(cx, NULL, NULL, 0, JSFUN_INTERPRETED, obj, funAtom);
     if (!fun)
         return NULL;
@@ -5061,17 +5061,17 @@ bool
 EvaluateUCScriptForPrincipalsCommon(JSContext *cx, JSObject *obj,
                                     JSPrincipals *principals, JSPrincipals *originPrincipals,
                                     const jschar *chars, uintN length,
                                     const char *filename, uintN lineno,
                                     jsval *rval, JSVersion compileVersion)
 {
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->atomsCompartment);
 
-    uint32 flags = TCF_COMPILE_N_GO | TCF_NEED_SCRIPT_GLOBAL;
+    uint32_t flags = TCF_COMPILE_N_GO | TCF_NEED_SCRIPT_GLOBAL;
     if (!rval)
         flags |= TCF_NO_SCRIPT_RVAL;
 
     CHECK_REQUEST(cx);
     AutoLastFrameCheck lfc(cx);
     JSScript *script = frontend::CompileScript(cx, obj, NULL, principals, originPrincipals,
                                                flags, chars, length, filename, lineno,
                                                compileVersion);
@@ -5483,17 +5483,17 @@ JS_FlattenString(JSContext *cx, JSString
 
 extern JS_PUBLIC_API(const jschar *)
 JS_GetFlatStringChars(JSFlatString *str)
 {
     return str->chars();
 }
 
 JS_PUBLIC_API(JSBool)
-JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32 *result)
+JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result)
 {
     CHECK_REQUEST(cx);
 
     return CompareStrings(cx, str1, str2, result);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match)
@@ -5658,34 +5658,34 @@ JS_Stringify(JSContext *cx, jsval *vp, J
     if (sb.empty()) {
         JSAtom *nullAtom = cx->runtime->atomState.nullAtom;
         return callback(nullAtom->chars(), nullAtom->length(), data);
     }
     return callback(sb.begin(), sb.length(), data);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ParseJSON(JSContext *cx, const jschar *chars, uint32 len, jsval *vp)
+JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, jsval *vp)
 {
     CHECK_REQUEST(cx);
 
     return ParseJSONWithReviver(cx, chars, len, NullValue(), vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp)
+JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver, jsval *vp)
 {
     CHECK_REQUEST(cx);
 
     return ParseJSONWithReviver(cx, chars, len, reviver, vp);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ReadStructuredClone(JSContext *cx, const uint64 *buf, size_t nbytes,
-                       uint32 version, jsval *vp,
+JS_ReadStructuredClone(JSContext *cx, const uint64_t *buf, size_t nbytes,
+                       uint32_t version, jsval *vp,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure)
 {
     CHECK_REQUEST(cx);
 
     if (version > JS_STRUCTURED_CLONE_VERSION) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_CLONE_VERSION);
         return false;
@@ -5693,17 +5693,17 @@ JS_ReadStructuredClone(JSContext *cx, co
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
         cx->runtime->structuredCloneCallbacks;
     return ReadStructuredClone(cx, buf, nbytes, vp, callbacks, closure);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_WriteStructuredClone(JSContext *cx, jsval v, uint64 **bufp, size_t *nbytesp,
+JS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **bufp, size_t *nbytesp,
                         const JSStructuredCloneCallbacks *optionalCallbacks,
                         void *closure)
 {
     CHECK_REQUEST(cx);
 
     const JSStructuredCloneCallbacks *callbacks =
         optionalCallbacks ?
         optionalCallbacks :
@@ -5734,41 +5734,41 @@ JSAutoStructuredCloneBuffer::clear()
         Foreground::free_(data_);
         data_ = NULL;
         nbytes_ = 0;
         version_ = 0;
     }
 }
 
 void
-JSAutoStructuredCloneBuffer::adopt(JSUint64 *data, size_t nbytes, JSUint32 version)
+JSAutoStructuredCloneBuffer::adopt(uint64_t *data, size_t nbytes, uint32_t version)
 {
     clear();
     data_ = data;
     nbytes_ = nbytes;
     version_ = version;
 }
 
 bool
-JSAutoStructuredCloneBuffer::copy(const JSUint64 *srcData, size_t nbytes, JSUint32 version)
-{
-    JSUint64 *newData = static_cast<JSUint64 *>(OffTheBooks::malloc_(nbytes));
+JSAutoStructuredCloneBuffer::copy(const uint64_t *srcData, size_t nbytes, uint32_t version)
+{
+    uint64_t *newData = static_cast<uint64_t *>(OffTheBooks::malloc_(nbytes));
     if (!newData)
         return false;
 
     memcpy(newData, srcData, nbytes);
 
     clear();
     data_ = newData;
     nbytes_ = nbytes;
     version_ = version;
     return true;
 }
 void
-JSAutoStructuredCloneBuffer::steal(JSUint64 **datap, size_t *nbytesp, JSUint32 *versionp)
+JSAutoStructuredCloneBuffer::steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp)
 {
     *datap = data_;
     *nbytesp = nbytes_;
     if (versionp)
         *versionp = version_;
 
     data_ = NULL;
     nbytes_ = 0;
@@ -5800,19 +5800,19 @@ JSAutoStructuredCloneBuffer::write(JSCon
         version_ = JS_STRUCTURED_CLONE_VERSION;
     }
     return ok;
 }
 
 void
 JSAutoStructuredCloneBuffer::swap(JSAutoStructuredCloneBuffer &other)
 {
-    JSUint64 *data = other.data_;
+    uint64_t *data = other.data_;
     size_t nbytes = other.nbytes_;
-    JSUint32 version = other.version_;
+    uint32_t version = other.version_;
 
     other.data_ = this->data_;
     other.nbytes_ = this->nbytes_;
     other.version_ = this->version_;
 
     this->data_ = data;
     this->nbytes_ = nbytes;
     this->version_ = version;
@@ -5820,29 +5820,29 @@ JSAutoStructuredCloneBuffer::swap(JSAuto
 
 JS_PUBLIC_API(void)
 JS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks)
 {
     rt->structuredCloneCallbacks = callbacks;
 }
 
 JS_PUBLIC_API(JSBool)
-JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32 *p1, uint32 *p2)
+JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2)
 {
     return r->input().readPair((uint32_t *) p1, (uint32_t *) p2);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len)
 {
     return r->input().readBytes(p, len);
 }
 
 JS_PUBLIC_API(JSBool)
-JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32 tag, uint32 data)
+JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data)
 {
     return w->output().writePair(tag, data);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len)
 {
     return w->output().writeBytes(p, len);
@@ -6342,27 +6342,27 @@ JS_ClearContextThread(JSContext *cx)
     return reinterpret_cast<jsword>(t->id);
 #else
     return 0;
 #endif
 }
 
 #ifdef JS_GC_ZEAL
 JS_PUBLIC_API(void)
-JS_SetGCZeal(JSContext *cx, uint8 zeal, uint32 frequency, JSBool compartment)
+JS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency, JSBool compartment)
 {
     bool schedule = zeal >= js::gc::ZealAllocThreshold && zeal < js::gc::ZealVerifierThreshold;
     cx->runtime->gcZeal_ = zeal;
     cx->runtime->gcZealFrequency = frequency;
     cx->runtime->gcNextScheduled = schedule ? frequency : 0;
     cx->runtime->gcDebugCompartmentGC = !!compartment;
 }
 
 JS_PUBLIC_API(void)
-JS_ScheduleGC(JSContext *cx, uint32 count, JSBool compartment)
+JS_ScheduleGC(JSContext *cx, uint32_t count, JSBool compartment)
 {
     cx->runtime->gcNextScheduled = count;
     cx->runtime->gcDebugCompartmentGC = !!compartment;
 }
 #endif
 
 JS_FRIEND_API(void *)
 js_GetCompartmentPrivate(JSCompartment *compartment)
@@ -6383,17 +6383,17 @@ JS_ModifyReference(void **ref, void *new
     // XPConnect uses the lower bits of its JSObject refs for evil purposes,
     // so we need to fix this.
     void *thing = *ref;
     *ref = newval;
     thing = (void *)((uintptr_t)thing & ~7);
     if (!thing)
         return;
     JS_ASSERT(!static_cast<gc::Cell *>(thing)->compartment()->rt->gcRunning);
-    uint32 kind = GetGCThingTraceKind(thing);
+    uint32_t kind = GetGCThingTraceKind(thing);
     if (kind == JSTRACE_OBJECT)
         JSObject::writeBarrierPre((JSObject *) thing);
     else if (kind == JSTRACE_STRING)
         JSString::writeBarrierPre((JSString *) thing);
     else
         JS_NOT_REACHED("invalid trace kind");
 }
 
@@ -6455,17 +6455,17 @@ JS_GetIncrementalGCTracer(JSRuntime *rt)
 BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
 {
     return TRUE;
 }
 
 #endif
 
 JS_PUBLIC_API(JSBool)
-JS_IndexToId(JSContext *cx, uint32 index, jsid *id)
+JS_IndexToId(JSContext *cx, uint32_t index, jsid *id)
 {
     return IndexToId(cx, index, id);
 }
 
 JS_PUBLIC_API(JSBool)
 JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier)
 {
     assertSameCompartment(cx, str);
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -38,27 +38,30 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jsapi_h___
 #define jsapi_h___
 /*
  * JavaScript API.
  */
+
+#include "js/LegacyIntTypes.h"
+
 #include <stddef.h>
 #include <stdio.h>
 #include "js-config.h"
 #include "jspubtd.h"
 #include "jsval.h"
 
 #include "js/Utility.h"
 
 /************************************************************************/
 
-/* JS::Value can store a full int32. */
+/* 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)
 
 /************************************************************************/
 
 #ifdef __cplusplus
 namespace JS {
@@ -250,22 +253,22 @@ class Value
     }
 
     JS_ALWAYS_INLINE
     void setUndefined() {
         data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;
     }
 
     JS_ALWAYS_INLINE
-    void setInt32(int32 i) {
+    void setInt32(int32_t i) {
         data = INT32_TO_JSVAL_IMPL(i);
     }
 
     JS_ALWAYS_INLINE
-    int32 &getInt32Ref() {
+    int32_t &getInt32Ref() {
         JS_ASSERT(isInt32());
         return data.s.payload.i32;
     }
 
     JS_ALWAYS_INLINE
     void setDouble(double d) {
         data = DOUBLE_TO_JSVAL_IMPL(d);
     }
@@ -312,29 +315,29 @@ class Value
     }
 
     JS_ALWAYS_INLINE
     JSObject *getMagicObjectOrNullPayload() const {
         return MAGIC_JSVAL_TO_OBJECT_OR_NULL_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    bool setNumber(uint32 ui) {
+    bool setNumber(uint32_t ui) {
         if (ui > JSVAL_INT_MAX) {
             setDouble((double)ui);
             return false;
         } else {
-            setInt32((int32)ui);
+            setInt32((int32_t)ui);
             return true;
         }
     }
 
     JS_ALWAYS_INLINE
     bool setNumber(double d) {
-        int32 i;
+        int32_t i;
         if (JSDOUBLE_IS_INT32(d, &i)) {
             setInt32(i);
             return true;
         } else {
             setDouble(d);
             return false;
         }
     }
@@ -352,17 +355,17 @@ class Value
         if (arg)
             setObject(*arg);
         else
             setUndefined();
     }
 
     JS_ALWAYS_INLINE
     void swap(Value &rhs) {
-        uint64 tmp = rhs.data.asBits;
+        uint64_t tmp = rhs.data.asBits;
         rhs.data.asBits = data.asBits;
         data.asBits = tmp;
     }
 
     /*** Value type queries ***/
 
     JS_ALWAYS_INLINE
     bool isUndefined() const {
@@ -380,17 +383,17 @@ class Value
     }
 
     JS_ALWAYS_INLINE
     bool isInt32() const {
         return JSVAL_IS_INT32_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    bool isInt32(int32 i32) const {
+    bool isInt32(int32_t i32) const {
         return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);
     }
 
     JS_ALWAYS_INLINE
     bool isDouble() const {
         return JSVAL_IS_DOUBLE_IMPL(data);
     }
 
@@ -491,17 +494,17 @@ class Value
         return data.asBits != rhs.data.asBits;
     }
 
     friend inline bool SameType(const Value &lhs, const Value &rhs);
 
     /*** Extract the value's typed payload ***/
 
     JS_ALWAYS_INLINE
-    int32 toInt32() const {
+    int32_t toInt32() const {
         JS_ASSERT(isInt32());
         return JSVAL_TO_INT32_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
     double toDouble() const {
         JS_ASSERT(isDouble());
         return data.asDouble;
@@ -539,28 +542,28 @@ class Value
 
     JS_ALWAYS_INLINE
     bool toBoolean() const {
         JS_ASSERT(isBoolean());
         return JSVAL_TO_BOOLEAN_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    uint32 payloadAsRawUint32() const {
+    uint32_t payloadAsRawUint32() const {
         JS_ASSERT(!isDouble());
         return data.s.payload.u32;
     }
 
     JS_ALWAYS_INLINE
-    uint64 asRawBits() const {
+    uint64_t asRawBits() const {
         return data.asBits;
     }
 
     JS_ALWAYS_INLINE
-    void setRawBits(uint64 bits) {
+    void setRawBits(uint64_t bits) {
         data.asBits = bits;
     }
 
     /*
      * In the extract/box/unbox functions below, "NonDouble" means this
      * functions must not be called on a value that is a double. This allows
      * these operations to be implemented more efficiently, since doubles
      * generally already require special handling by the caller.
@@ -571,22 +574,22 @@ class Value
     }
 
     JS_ALWAYS_INLINE
     JSValueTag extractNonDoubleTag() const {
         return JSVAL_EXTRACT_NON_DOUBLE_TAG_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    void unboxNonDoubleTo(uint64 *out) const {
+    void unboxNonDoubleTo(uint64_t *out) const {
         UNBOX_NON_DOUBLE_JSVAL(data, out);
     }
 
     JS_ALWAYS_INLINE
-    void boxNonDoubleFrom(JSValueType type, uint64 *out) {
+    void boxNonDoubleFrom(JSValueType type, uint64_t *out) {
         data = BOX_NON_DOUBLE_JSVAL(type, out);
     }
 
     /*
      * The trace-jit specializes JSVAL_TYPE_OBJECT into JSVAL_TYPE_FUNOBJ and
      * JSVAL_TYPE_NONFUNOBJ. Since these two operations just return the type of
      * a value, the caller must handle JSVAL_TYPE_OBJECT separately.
      */
@@ -618,28 +621,28 @@ class Value
 
     JS_ALWAYS_INLINE
     void *toPrivate() const {
         JS_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));
         return JSVAL_TO_PRIVATE_PTR_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    void setPrivateUint32(uint32 ui) {
+    void setPrivateUint32(uint32_t ui) {
         data = PRIVATE_UINT32_TO_JSVAL_IMPL(ui);
     }
 
     JS_ALWAYS_INLINE
-    uint32 toPrivateUint32() const {
+    uint32_t toPrivateUint32() const {
         JS_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));
         return JSVAL_TO_PRIVATE_UINT32_IMPL(data);
     }
 
     JS_ALWAYS_INLINE
-    uint32 &getPrivateUint32Ref() {
+    uint32_t &getPrivateUint32Ref() {
         JS_ASSERT(isDouble());
         return data.s.payload.u32;
     }
 
     /*
      * An unmarked value is just a void* cast as a Value. Thus, the Value is
      * not safe for GC and must not be marked. This API avoids raw casts
      * and the ensuing strict-aliasing warnings.
@@ -700,17 +703,17 @@ static JS_ALWAYS_INLINE Value
 UndefinedValue()
 {
     Value v;
     v.setUndefined();
     return v;
 }
 
 static JS_ALWAYS_INLINE Value
-Int32Value(int32 i32)
+Int32Value(int32_t i32)
 {
     Value v;
     v.setInt32(i32);
     return v;
 }
 
 static JS_ALWAYS_INLINE Value
 DoubleValue(double dbl)
@@ -772,17 +775,17 @@ static JS_ALWAYS_INLINE Value
 PrivateValue(void *ptr)
 {
     Value v;
     v.setPrivate(ptr);
     return v;
 }
 
 static JS_ALWAYS_INLINE Value
-PrivateUint32Value(uint32 ui)
+PrivateUint32Value(uint32_t ui)
 {
     Value v;
     v.setPrivateUint32(ui);
     return v;
 }
 
 JS_ALWAYS_INLINE bool
 SameType(const Value &lhs, const Value &rhs)
@@ -803,17 +806,17 @@ SameType(const Value &lhs, const Value &
  * return value. But |volatile C| cannot thus be converted to |C|, so just
  * doing |sink = hold| as in the non-specialized version would fail to compile.
  * Do the assignment on asBits instead, since I don't think we want to give
  * jsval_layout an assignment operator returning |volatile jsval_layout|.
  */
 template<>
 inline Anchor<Value>::~Anchor()
 {
-    volatile uint64 bits;
+    volatile uint64_t bits;
     bits = hold.asRawBits();
 }
 
 #endif
 
 }  /* namespace JS */
 
 /************************************************************************/
@@ -1144,20 +1147,20 @@ typedef enum JSExnType {
         JSEXN_LIMIT
 } JSExnType;
 
 typedef struct JSErrorFormatString {
     /* The error format string (UTF-8 if js_CStringsAreUTF8). */
     const char *format;
 
     /* The number of arguments to expand in the formatted error message. */
-    uint16 argCount;
+    uint16_t argCount;
 
     /* One of the JSExnType constants above. */
-    int16 exnType;
+    int16_t exnType;
 } JSErrorFormatString;
 
 typedef const JSErrorFormatString *
 (* JSErrorCallback)(void *userRef, const char *locale,
                     const uintN errorNumber);
 
 #ifdef va_start
 #define JS_ARGUMENT_FORMATTER_DEFINED 1
@@ -1235,23 +1238,23 @@ typedef enum {
 
 typedef JSBool
 (* JSCompartmentCallback)(JSContext *cx, JSCompartment *compartment, uintN compartmentOp);
 
 /*
  * Read structured data from the reader r. This hook is used to read a value
  * previously serialized by a call to the WriteStructuredCloneOp hook.
  *
- * tag and data are the pair of uint32 values from the header. The callback may
- * use the JS_Read* APIs to read any other relevant parts of the object from
- * the reader r. closure is any value passed to the JS_ReadStructuredClone
+ * tag and data are the pair of uint32_t values from the header. The callback
+ * may use the JS_Read* APIs to read any other relevant parts of the object
+ * from the reader r. closure is any value passed to the JS_ReadStructuredClone
  * function. Return the new object on success, NULL on error/exception.
  */
 typedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,
-                                           uint32 tag, uint32 data, void *closure);
+                                           uint32_t tag, uint32_t data, void *closure);
 
 /*
  * Structured data serialization hook. The engine can write primitive values,
  * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other
  * type of object requires application support. This callback must first use
  * the JS_WriteUint32Pair API to write an object header, passing a value
  * greater than JS_SCTAG_USER to the tag parameter. Then it can use the
  * JS_Write* APIs to write any other relevant parts of the value v to the
@@ -1262,17 +1265,17 @@ typedef JSObject *(*ReadStructuredCloneO
 typedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,
                                          JSObject *obj, void *closure);
 
 /*
  * This is called when JS_WriteStructuredClone finds that the object to be
  * written is recursive. To follow HTML5, the application must throw a
  * DATA_CLONE_ERR DOMException. errorid is always JS_SCERR_RECURSION.
  */
-typedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32 errorid);
+typedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);
 
 /************************************************************************/
 
 JS_BEGIN_EXTERN_C
 
 /*
  * Silence warning about returning JS::Value (aka jsval) from functions with C
  * linkage. For C JSAPI clients, jsval will be jsval_layout, which should be
@@ -1318,17 +1321,17 @@ JSVAL_IS_INT(jsval v)
 static JS_ALWAYS_INLINE jsint
 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 i)
+INT_TO_JSVAL(int32_t i)
 {
     return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));
 }
 
 static JS_ALWAYS_INLINE JSBool
 JSVAL_IS_DOUBLE(jsval v)
 {
     return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));
@@ -1355,20 +1358,20 @@ DOUBLE_TO_JSVAL(jsdouble d)
         l.asBits = 0x7FF8000000000000LL;
     } else {
         l.asDouble = d;
     }
     return IMPL_TO_JSVAL(l);
 }
 
 static JS_ALWAYS_INLINE jsval
-UINT_TO_JSVAL(uint32 i)
+UINT_TO_JSVAL(uint32_t i)
 {
     if (i <= JSVAL_INT_MAX)
-        return INT_TO_JSVAL((int32)i);
+        return INT_TO_JSVAL((int32_t)i);
     return DOUBLE_TO_JSVAL((jsdouble)i);
 }
 
 static JS_ALWAYS_INLINE JSBool
 JSVAL_IS_NUMBER(jsval v)
 {
     return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));
 }
@@ -1534,39 +1537,39 @@ INTERNED_STRING_TO_JSID(JSContext *cx, J
 }
 
 static JS_ALWAYS_INLINE JSBool
 JSID_IS_INT(jsid id)
 {
     return !!(JSID_BITS(id) & JSID_TYPE_INT);
 }
 
-static JS_ALWAYS_INLINE int32
+static JS_ALWAYS_INLINE int32_t
 JSID_TO_INT(jsid id)
 {
     JS_ASSERT(JSID_IS_INT(id));
-    return ((int32)JSID_BITS(id)) >> 1;
+    return ((int32_t)JSID_BITS(id)) >> 1;
 }
 
 /*
  * Note: when changing these values, verify that their use in
  * js_CheckForStringIndex is still valid.
  */
 #define JSID_INT_MIN  (-(1 << 30))
 #define JSID_INT_MAX  ((1 << 30) - 1)
 
 static JS_ALWAYS_INLINE JSBool
-INT_FITS_IN_JSID(int32 i)
+INT_FITS_IN_JSID(int32_t i)
 {
     return ((jsuint)(i) - (jsuint)JSID_INT_MIN <=
             (jsuint)(JSID_INT_MAX - JSID_INT_MIN));
 }
 
 static JS_ALWAYS_INLINE jsid
-INT_TO_JSID(int32 i)
+INT_TO_JSID(int32_t i)
 {
     jsid id;
     JS_ASSERT(INT_FITS_IN_JSID(i));
     JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);
     return id;
 }
 
 static JS_ALWAYS_INLINE JSBool
@@ -1732,21 +1735,18 @@ JSVAL_IS_UNIVERSAL(jsval v)
  * suppressed.
  *
  * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce
  * to invoke its JSInitCallback.
  */
 extern JS_PUBLIC_API(JSBool)
 JS_CallOnce(JSCallOnceType *once, JSInitCallback func);
 
-/*
- * Microseconds since the epoch, midnight, January 1, 1970 UTC.  See the
- * comment in jstypes.h regarding safe int64 usage.
- */
-extern JS_PUBLIC_API(int64)
+/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */
+extern JS_PUBLIC_API(int64_t)
 JS_Now(void);
 
 /* Don't want to export data, so provide accessors for non-inline jsvals. */
 extern JS_PUBLIC_API(jsval)
 JS_GetNaNValue(JSContext *cx);
 
 extern JS_PUBLIC_API(jsval)
 JS_GetNegativeInfinityValue(JSContext *cx);
@@ -1760,20 +1760,20 @@ JS_GetEmptyStringValue(JSContext *cx);
 extern JS_PUBLIC_API(JSString *)
 JS_GetEmptyString(JSRuntime *rt);
 
 /*
  * Format is a string of the following characters (spaces are insignificant),
  * specifying the tabulated type conversions:
  *
  *   b      JSBool          Boolean
- *   c      uint16/jschar   ECMA uint16, Unicode char
- *   i      int32           ECMA int32
- *   u      uint32          ECMA uint32
- *   j      int32           Rounded int32 (coordinate)
+ *   c      uint16_t/jschar ECMA uint16_t, Unicode char
+ *   i      int32_t         ECMA int32_t
+ *   u      uint32_t        ECMA uint32_t
+ *   j      int32_t         Rounded int32_t (coordinate)
  *   d      jsdouble        IEEE double
  *   I      jsdouble        Integral IEEE double
  *   S      JSString *      Unicode string, accessed by a JSString pointer
  *   W      jschar *        Unicode character vector, 0-terminated (W for wide)
  *   o      JSObject *      Object reference
  *   f      JSFunction *    Function private
  *   v      jsval           Argument value (no conversion)
  *   *      N/A             Skip this argument (no vararg)
@@ -1871,49 +1871,49 @@ extern JS_PUBLIC_API(JSString *)
 JS_ValueToSource(JSContext *cx, jsval v);
 
 extern JS_PUBLIC_API(JSBool)
 JS_ValueToNumber(JSContext *cx, jsval v, jsdouble *dp);
 
 extern JS_PUBLIC_API(JSBool)
 JS_DoubleIsInt32(jsdouble d, jsint *ip);
 
-extern JS_PUBLIC_API(int32)
+extern JS_PUBLIC_API(int32_t)
 JS_DoubleToInt32(jsdouble d);
 
-extern JS_PUBLIC_API(uint32)
+extern JS_PUBLIC_API(uint32_t)
 JS_DoubleToUint32(jsdouble d);
 
 /*
- * Convert a value to a number, then to an int32, according to the ECMA rules
+ * Convert a value to a number, then to an int32_t, according to the ECMA rules
  * for ToInt32.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_ValueToECMAInt32(JSContext *cx, jsval v, int32 *ip);
+JS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);
 
 /*
- * Convert a value to a number, then to a uint32, according to the ECMA rules
+ * Convert a value to a number, then to a uint32_t, according to the ECMA rules
  * for ToUint32.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32 *ip);
+JS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);
 
 /*
- * Convert a value to a number, then to an int32 if it fits by rounding to
+ * Convert a value to a number, then to an int32_t if it fits by rounding to
  * nearest; but failing with an error report if the double is out of range
  * or unordered.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_ValueToInt32(JSContext *cx, jsval v, int32 *ip);
+JS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);
 
 /*
  * ECMA ToUint16, for mapping a jsval to a Unicode point.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_ValueToUint16(JSContext *cx, jsval v, uint16 *ip);
+JS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);
 
 extern JS_PUBLIC_API(JSBool)
 JS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);
 
 extern JS_PUBLIC_API(JSType)
 JS_TypeOfValue(JSContext *cx, jsval v);
 
 extern JS_PUBLIC_API(const char *)
@@ -1946,17 +1946,17 @@ JS_IsBuiltinFunctionConstructor(JSFuncti
  * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference
  */
 #define JS_NewRuntime       JS_Init
 #define JS_DestroyRuntime   JS_Finish
 #define JS_LockRuntime      JS_Lock
 #define JS_UnlockRuntime    JS_Unlock
 
 extern JS_PUBLIC_API(JSRuntime *)
-JS_NewRuntime(uint32 maxbytes);
+JS_NewRuntime(uint32_t maxbytes);
 
 /* Deprecated. */
 #define JS_CommenceRuntimeShutDown(rt) ((void) 0)
 
 extern JS_PUBLIC_API(void)
 JS_DestroyRuntime(JSRuntime *rt);
 
 extern JS_PUBLIC_API(void)
@@ -2196,24 +2196,24 @@ JS_StringToVersion(const char *string);
 #define JSOPTION_SOFTEN         JS_BIT(19)      /* Disable JIT hardening. */
 
 /* Options which reflect compile-time properties of scripts. */
 #define JSCOMPILEOPTION_MASK    (JSOPTION_XML)
 
 #define JSRUNOPTION_MASK        (JS_BITMASK(20) & ~JSCOMPILEOPTION_MASK)
 #define JSALLOPTION_MASK        (JSCOMPILEOPTION_MASK | JSRUNOPTION_MASK)
 
-extern JS_PUBLIC_API(uint32)
+extern JS_PUBLIC_API(uint32_t)
 JS_GetOptions(JSContext *cx);
 
-extern JS_PUBLIC_API(uint32)
-JS_SetOptions(JSContext *cx, uint32 options);
-
-extern JS_PUBLIC_API(uint32)
-JS_ToggleOptions(JSContext *cx, uint32 options);
+extern JS_PUBLIC_API(uint32_t)
+JS_SetOptions(JSContext *cx, uint32_t options);
+
+extern JS_PUBLIC_API(uint32_t)
+JS_ToggleOptions(JSContext *cx, uint32_t options);
 
 extern JS_PUBLIC_API(const char *)
 JS_GetImplementationVersion(void);
 
 extern JS_PUBLIC_API(JSCompartmentCallback)
 JS_SetCompartmentCallback(JSRuntime *rt, JSCompartmentCallback callback);
 
 extern JS_PUBLIC_API(JSWrapObjectCallback)
@@ -2267,17 +2267,17 @@ class JS_PUBLIC_API(JSAutoEnterCompartme
     /*
      * This is a poor man's Maybe<AutoCompartment>, because we don't have
      * access to the AutoCompartment definition here.  We statically assert in
      * jsapi.cpp that we have the right size here.
      *
      * In practice, 32-bit Windows and Android get 16-word |bytes|, while
      * other platforms get 13-word |bytes|.
      */
-    void* bytes[sizeof(void*) == 4 && MOZ_ALIGNOF(JSUint64) == 8 ? 16 : 13];
+    void* bytes[sizeof(void*) == 4 && MOZ_ALIGNOF(uint64_t) == 8 ? 16 : 13];
 
     /*
      * This object may be in one of three states.  If enter() or
      * enterAndIgnoreErrors() hasn't been called, it's in STATE_UNENTERED.
      * Otherwise, if we were asked to enter into the current compartment, our
      * state is STATE_SAME_COMPARTMENT.  If we actually created an
      * AutoCompartment and entered another compartment, our state is
      * STATE_OTHER_COMPARTMENT.
@@ -2632,17 +2632,17 @@ JS_DumpNamedRoots(JSRuntime *rt,
  */
 #define JS_MAP_GCROOT_NEXT      0       /* continue mapping entries */
 #define JS_MAP_GCROOT_STOP      1       /* stop mapping entries */
 #define JS_MAP_GCROOT_REMOVE    2       /* remove and free the current entry */
 
 typedef intN
 (* JSGCRootMapFun)(void *rp, JSGCRootType type, const char *name, void *data);
 
-extern JS_PUBLIC_API(uint32)
+extern JS_PUBLIC_API(uint32_t)
 JS_MapGCRoots(JSRuntime *rt, JSGCRootMapFun map, void *data);
 
 extern JS_PUBLIC_API(JSBool)
 JS_LockGCThing(JSContext *cx, void *thing);
 
 extern JS_PUBLIC_API(JSBool)
 JS_LockGCThingRT(JSRuntime *rt, void *thing);
 
@@ -3016,25 +3016,25 @@ typedef enum JSGCMode {
     /* Perform only global GCs. */
     JSGC_MODE_GLOBAL = 0,
 
     /* Perform per-compartment GCs until too much garbage has accumulated. */
     JSGC_MODE_COMPARTMENT = 1
 } JSGCMode;
 
 extern JS_PUBLIC_API(void)
-JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32 value);
-
-extern JS_PUBLIC_API(uint32)
+JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);
+
+extern JS_PUBLIC_API(uint32_t)
 JS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);
 
 extern JS_PUBLIC_API(void)
-JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32 value);
-
-extern JS_PUBLIC_API(uint32)
+JS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);
+
+extern JS_PUBLIC_API(uint32_t)
 JS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);
 
 /*
  * Flush the code cache for the current thread. The operation might be
  * delayed if the cache cannot be flushed currently because native
  * code is currently executing.
  */
 
@@ -3123,17 +3123,17 @@ JS_SetNativeStackQuota(JSContext *cx, si
 
 /*
  * Classes, objects, and properties.
  */
 typedef void (*JSClassInternal)();
 
 struct JSClass {
     const char          *name;
-    uint32              flags;
+    uint32_t            flags;
 
     /* Mandatory non-null function pointer members. */
     JSPropertyOp        addProperty;
     JSPropertyOp        delProperty;
     JSPropertyOp        getProperty;
     JSStrictPropertyOp  setProperty;
     JSEnumerateOp       enumerate;
     JSResolveOp         resolve;
@@ -3279,38 +3279,38 @@ extern JS_PUBLIC_API(JSBool)
 JS_ConvertStub(JSContext *cx, JSObject *obj, JSType type, jsval *vp);
 
 extern JS_PUBLIC_API(void)
 JS_FinalizeStub(JSContext *cx, JSObject *obj);
 
 struct JSConstDoubleSpec {
     jsdouble        dval;
     const char      *name;
-    uint8           flags;
-    uint8           spare[3];
+    uint8_t         flags;
+    uint8_t         spare[3];
 };
 
 /*
  * To define an array element rather than a named property member, cast the
  * element's index to (const char *) and initialize name with it, and set the
  * JSPROP_INDEX bit in flags.
  */
 struct JSPropertySpec {
     const char            *name;
-    int8                  tinyid;
-    uint8                 flags;
+    int8_t                tinyid;
+    uint8_t               flags;
     JSPropertyOp          getter;
     JSStrictPropertyOp    setter;
 };
 
 struct JSFunctionSpec {
     const char      *name;
     JSNative        call;
-    uint16          nargs;
-    uint16          flags;
+    uint16_t        nargs;
+    uint16_t        flags;
 };
 
 /*
  * Terminating sentinel initializer to put at the end of a JSFunctionSpec array
  * that's passed to JS_DefineFunctions or JS_InitClass.
  */
 #define JS_FS_END JS_FS(NULL,NULL,0,0)
 
@@ -3487,17 +3487,17 @@ JS_GetPropertyAttrsGetterAndSetterById(J
  * JS_FALSE and nothing will be altered.
  */
 extern JS_PUBLIC_API(JSBool)
 JS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,
                          uintN attrs, JSBool *foundp);
 
 extern JS_PUBLIC_API(JSBool)
 JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,
-                            int8 tinyid, jsval value,
+                            int8_t tinyid, jsval value,
                             JSPropertyOp getter, JSStrictPropertyOp setter,
                             uintN attrs);
 
 extern JS_PUBLIC_API(JSBool)
 JS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,
                          JSBool *foundp);
 
 extern JS_PUBLIC_API(JSBool)
@@ -3626,17 +3626,17 @@ extern JS_PUBLIC_API(JSBool)
 JS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,
                            const jschar *name, size_t namelen,
                            uintN attrs, JSBool *foundp);
 
 
 extern JS_PUBLIC_API(JSBool)
 JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,
                               const jschar *name, size_t namelen,
-                              int8 tinyid, jsval value,
+                              int8_t tinyid, jsval value,
                               JSPropertyOp getter, JSStrictPropertyOp setter,
                               uintN attrs);
 
 extern JS_PUBLIC_API(JSBool)
 JS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,
                            size_t namelen, JSBool *foundp);
 
 extern JS_PUBLIC_API(JSBool)
@@ -3672,51 +3672,52 @@ JS_IsArrayObject(JSContext *cx, JSObject
 
 extern JS_PUBLIC_API(JSBool)
 JS_GetArrayLength(JSContext *cx, JSObject *obj, jsuint *lengthp);
 
 extern JS_PUBLIC_API(JSBool)
 JS_SetArrayLength(JSContext *cx, JSObject *obj, jsuint length);
 
 extern JS_PUBLIC_API(JSBool)
-JS_DefineElement(JSContext *cx, JSObject *obj, uint32 index, jsval value,
+JS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,
                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
 
 extern JS_PUBLIC_API(JSBool)
-JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *foundp);
+JS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_HasElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *foundp);
+JS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_LookupElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
+JS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
+JS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp);
+JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,
+                       jsval *vp);
 
 /*
  * Get the property with name given by |index|, if it has one.  If
  * not, |*present| will be set to false and the value of |vp| must not
  * be relied on.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf,
+JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,
                        jsval *vp, JSBool* present);
 
 extern JS_PUBLIC_API(JSBool)
-JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
+JS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_DeleteElement(JSContext *cx, JSObject *obj, uint32 index);
+JS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);
 
 extern JS_PUBLIC_API(JSBool)
-JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32 index, jsval *rval);
+JS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);
 
 extern JS_PUBLIC_API(void)
 JS_ClearScope(JSContext *cx, JSObject *obj);
 
 extern JS_PUBLIC_API(JSIdArray *)
 JS_Enumerate(JSContext *cx, JSObject *obj);
 
 /*
@@ -3735,20 +3736,20 @@ JS_NewPropertyIterator(JSContext *cx, JS
 extern JS_PUBLIC_API(JSBool)
 JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);
 
 extern JS_PUBLIC_API(JSBool)
 JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
                jsval *vp, uintN *attrsp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
+JS_GetReservedSlot(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);
 
 extern JS_PUBLIC_API(JSBool)
-JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v);
+JS_SetReservedSlot(JSContext *cx, JSObject *obj, uint32_t index, jsval v);
 
 /************************************************************************/
 
 /*
  * Security protocol.
  */
 struct JSPrincipals {
     char *codebase;
@@ -3850,17 +3851,17 @@ JS_GetFunctionId(JSFunction *fun);
  * Return JSFUN_* flags for fun.
  */
 extern JS_PUBLIC_API(uintN)
 JS_GetFunctionFlags(JSFunction *fun);
 
 /*
  * Return the arity (length) of fun.
  */
-extern JS_PUBLIC_API(uint16)
+extern JS_PUBLIC_API(uint16_t)
 JS_GetFunctionArity(JSFunction *fun);
 
 /*
  * Infallible predicate to test whether obj is a function object (faster than
  * comparing obj's class name to "Function", but equivalent unless someone has
  * overwritten the "Function" identifier with a different constructor and then
  * created instances using that constructor that might be passed in as obj).
  */
@@ -4257,17 +4258,17 @@ JS_NewUCStringCopyZ(JSContext *cx, const
 
 extern JS_PUBLIC_API(JSString *)
 JS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);
 
 extern JS_PUBLIC_API(JSString *)
 JS_InternUCString(JSContext *cx, const jschar *s);
 
 extern JS_PUBLIC_API(JSBool)
-JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32 *result);
+JS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);
 
 extern JS_PUBLIC_API(JSBool)
 JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);
 
 extern JS_PUBLIC_API(size_t)
 JS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);
 
 extern JS_PUBLIC_API(JSBool)
@@ -4556,100 +4557,101 @@ class JSAutoByteString {
 };
 
 #endif
 
 /************************************************************************/
 /*
  * JSON functions
  */
-typedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32 len, void *data);
+typedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);
 
 /*
  * JSON.stringify as specified by ES5.
  */
 JS_PUBLIC_API(JSBool)
 JS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,
              JSONWriteCallback callback, void *data);
 
 /*
  * JSON.parse as specified by ES5.
  */
 JS_PUBLIC_API(JSBool)
-JS_ParseJSON(JSContext *cx, const jschar *chars, uint32 len, jsval *vp);
+JS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, jsval *vp);
 
 JS_PUBLIC_API(JSBool)
-JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp);
+JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,
+                        jsval *vp);
 
 /************************************************************************/
 
 /* API for the HTML5 internal structured cloning algorithm. */
 
 /* The maximum supported structured-clone serialization format version. */
 #define JS_STRUCTURED_CLONE_VERSION 1
 
 struct JSStructuredCloneCallbacks {
     ReadStructuredCloneOp read;
     WriteStructuredCloneOp write;
     StructuredCloneErrorOp reportError;
 };
 
 JS_PUBLIC_API(JSBool)
-JS_ReadStructuredClone(JSContext *cx, const uint64 *data, size_t nbytes,
-                       uint32 version, jsval *vp,
+JS_ReadStructuredClone(JSContext *cx, const uint64_t *data, size_t nbytes,
+                       uint32_t version, jsval *vp,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure);
 
 /* Note: On success, the caller is responsible for calling js::Foreground::free(*datap). */
 JS_PUBLIC_API(JSBool)
-JS_WriteStructuredClone(JSContext *cx, jsval v, uint64 **datap, size_t *nbytesp,
+JS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,
                         const JSStructuredCloneCallbacks *optionalCallbacks,
                         void *closure);
 
 JS_PUBLIC_API(JSBool)
 JS_StructuredClone(JSContext *cx, jsval v, jsval *vp,
                    const JSStructuredCloneCallbacks *optionalCallbacks,
                    void *closure);
 
 #ifdef __cplusplus
 JS_END_EXTERN_C
 
 /* RAII sugar for JS_WriteStructuredClone. */
 class JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {
-    JSUint64 *data_;
+    uint64_t *data_;
     size_t nbytes_;
-    JSUint32 version_;
+    uint32_t version_;
 
   public:
     JSAutoStructuredCloneBuffer()
         : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}
 
     ~JSAutoStructuredCloneBuffer() { clear(); }
 
-    JSUint64 *data() const { return data_; }
+    uint64_t *data() const { return data_; }
     size_t nbytes() const { return nbytes_; }
 
     void clear();
 
     /* Copy some memory. It will be automatically freed by the destructor. */
-    bool copy(const JSUint64 *data, size_t nbytes, JSUint32 version=JS_STRUCTURED_CLONE_VERSION);
+    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);
 
     /*
      * Adopt some memory. It will be automatically freed by the destructor.
      * data must have been allocated by the JS engine (e.g., extracted via
      * JSAutoStructuredCloneBuffer::steal).
      */
-    void adopt(JSUint64 *data, size_t nbytes, JSUint32 version=JS_STRUCTURED_CLONE_VERSION);
+    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);
 
     /*
      * Remove the buffer so that it will not be automatically freed.
      * After this, the caller is responsible for feeding the memory back to
      * JSAutoStructuredCloneBuffer::adopt.
      */
-    void steal(JSUint64 **datap, size_t *nbytesp, JSUint32 *versionp=NULL);
+    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);
 
     bool read(JSContext *cx, jsval *vp,
               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,
               void *closure=NULL) const;
 
     bool write(JSContext *cx, jsval v,
                const JSStructuredCloneCallbacks *optionalCallbacks=NULL,
                void *closure=NULL);
@@ -4666,32 +4668,32 @@ class JS_PUBLIC_API(JSAutoStructuredClon
 };
 
 JS_BEGIN_EXTERN_C
 #endif
 
 /* API for implementing custom serialization behavior (for ImageData, File, etc.) */
 
 /* The range of tag values the application may use for its own custom object types. */
-#define JS_SCTAG_USER_MIN  ((uint32) 0xFFFF8000)
-#define JS_SCTAG_USER_MAX  ((uint32) 0xFFFFFFFF)
+#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)
+#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)
 
 #define JS_SCERR_RECURSION 0
 
 JS_PUBLIC_API(void)
 JS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);
 
 JS_PUBLIC_API(JSBool)
-JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32 *p1, uint32 *p2);
+JS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);
 
 JS_PUBLIC_API(JSBool)
 JS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);
 
 JS_PUBLIC_API(JSBool)
-JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32 tag, uint32 data);
+JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);
 
 JS_PUBLIC_API(JSBool)
 JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);
 
 /************************************************************************/
 
 /*
  * Locale specific string conversion and error message callbacks.
@@ -5051,27 +5053,27 @@ JS_NewObjectForConstructor(JSContext *cx
 #ifdef DEBUG
 #define JS_GC_ZEAL 1
 #endif
 
 #ifdef JS_GC_ZEAL
 #define JS_DEFAULT_ZEAL_FREQ 100
 
 extern JS_PUBLIC_API(void)
-JS_SetGCZeal(JSContext *cx, uint8 zeal, uint32 frequency, JSBool compartment);
+JS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency, JSBool compartment);
 
 extern JS_PUBLIC_API(void)
-JS_ScheduleGC(JSContext *cx, uint32 count, JSBool compartment);
+JS_ScheduleGC(JSContext *cx, uint32_t count, JSBool compartment);
 #endif
 
 /*
- * Convert a uint32 index into a jsid.
+ * Convert a uint32_t index into a jsid.
  */
 extern JS_PUBLIC_API(JSBool)
-JS_IndexToId(JSContext *cx, uint32 index, jsid *id);
+JS_IndexToId(JSContext *cx, uint32_t index, jsid *id);
 
 /*
  *  Test if the given string is a valid ECMAScript identifier
  */
 extern JS_PUBLIC_API(JSBool)
 JS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);
 
 JS_END_EXTERN_C
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -163,17 +163,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 */
+        *lengthp = jsuint(jsint(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 {
@@ -196,24 +196,24 @@ namespace js {
  * that calling a standard conversion routine might allow strings such as
  * "08" or "4.0" as array indices, which they are not.
  *
  */
 JS_FRIEND_API(bool)
 StringIsArrayIndex(JSLinearString *str, jsuint *indexp)
 {
     const jschar *s = str->chars();
-    uint32 length = str->length();
+    uint32_t length = str->length();
     const jschar *end = s + length;
 
     if (length == 0 || length > (sizeof("4294967294") - 1) || !JS7_ISDEC(*s))
         return false;
 
-    uint32 c = 0, previous = 0;
-    uint32 index = JS7_UNDEC(*s++);
+    uint32_t c = 0, previous = 0;
+    uint32_t index = JS7_UNDEC(*s++);
 
     /* Don't allow leading zeros. */
     if (index == 0 && s != end)
         return false;
 
     for (; s < end; s++) {
         if (!JS7_ISDEC(*s))
             return false;
@@ -334,17 +334,17 @@ bool
 JSObject::arrayGetOwnDataElement(JSContext *cx, size_t i, Value *vp)
 {
     JS_ASSERT(isArray());
 
     if (isDenseArray()) {
         if (i >= getArrayLength())
             vp->setMagic(JS_ARRAY_HOLE);
         else
-            *vp = getDenseArrayElement(uint32(i));
+            *vp = getDenseArrayElement(uint32_t(i));
         return true;
     }
 
     JSBool hole;
     jsid id;
     if (!IndexToId(cx, this, i, &hole, &id))
         return false;
 
@@ -386,17 +386,17 @@ DoGetElement(JSContext *cx, JSObject *ob
         if (!obj->getGeneric(cx, idr.id(), vp))
             return JS_FALSE;
         *hole = JS_FALSE;
     }
     return JS_TRUE;
 }
 
 static inline JSBool
-DoGetElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *hole, Value *vp)
+DoGetElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *hole, Value *vp)
 {
     bool present;
     if (!obj->getElementIfPresent(cx, obj, index, vp, &present))
         return false;
 
     *hole = !present;
     if (*hole)
         vp->setUndefined();
@@ -405,36 +405,36 @@ DoGetElement(JSContext *cx, JSObject *ob
 }
 
 template<typename IndexType>
 static JSBool
 GetElement(JSContext *cx, JSObject *obj, IndexType index, JSBool *hole, Value *vp)
 {
     JS_ASSERT(index >= 0);
     if (obj->isDenseArray() && index < obj->getDenseArrayInitializedLength() &&
-        !(*vp = obj->getDenseArrayElement(uint32(index))).isMagic(JS_ARRAY_HOLE)) {
+        !(*vp = obj->getDenseArrayElement(uint32_t(index))).isMagic(JS_ARRAY_HOLE)) {
         *hole = JS_FALSE;
         return JS_TRUE;
     }
     if (obj->isArguments()) {
-        if (obj->asArguments()->getElement(uint32(index), vp)) {
+        if (obj->asArguments()->getElement(uint32_t(index), vp)) {
             *hole = JS_FALSE;
             return true;
         }
     }
 
     return DoGetElement(cx, obj, index, hole, vp);
 }
 
 namespace js {
 
 static bool
-GetElementsSlow(JSContext *cx, JSObject *aobj, uint32 length, Value *vp)
+GetElementsSlow(JSContext *cx, JSObject *aobj, uint32_t length, Value *vp)
 {
-    for (uint32 i = 0; i < length; i++) {
+    for (uint32_t i = 0; i < length; i++) {
         if (!aobj->getElement(cx, i, &vp[i]))
             return false;
     }
 
     return true;
 }
 
 bool
@@ -594,30 +594,30 @@ array_length_getter(JSContext *cx, JSObj
 static JSBool
 array_length_setter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
 {
     if (!obj->isArray()) {
         return obj->defineProperty(cx, cx->runtime->atomState.lengthAtom, *vp,
                                    NULL, NULL, JSPROP_ENUMERATE);
     }
 
-    uint32 newlen;
+    uint32_t newlen;
     if (!ToUint32(cx, *vp, &newlen))
         return false;
 
     jsdouble d;
     if (!ToNumber(cx, *vp, &d))
         return false;
 
     if (d != newlen) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_ARRAY_LENGTH);
         return false;
     }
 
-    uint32 oldlen = obj->getArrayLength();
+    uint32_t oldlen = obj->getArrayLength();
     if (oldlen == newlen)
         return true;
 
     vp->setNumber(newlen);
     if (oldlen < newlen) {
         obj->setArrayLength(cx, newlen);
         return true;
     }
@@ -679,34 +679,34 @@ array_length_setter(JSContext *cx, JSObj
     }
 
     obj->setArrayLength(cx, newlen);
     return true;
 }
 
 /* Returns true if the dense array has an own property at the index. */
 static inline bool
-IsDenseArrayIndex(JSObject *obj, uint32 index)
+IsDenseArrayIndex(JSObject *obj, uint32_t index)
 {
     JS_ASSERT(obj->isDenseArray());
 
     return index < obj->getDenseArrayInitializedLength() &&
            !obj->getDenseArrayElement(index).isMagic(JS_ARRAY_HOLE);
 }
 
 /*
  * We have only indexed properties up to initialized length, plus the
  * length property. For all else, we delegate to the prototype.
  */
 static inline bool
 IsDenseArrayId(JSContext *cx, JSObject *obj, jsid id)
 {
     JS_ASSERT(obj->isDenseArray());
 
-    uint32 i;
+    uint32_t i;
     return JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom) ||
            (js_IdIsIndex(id, &i) && IsDenseArrayIndex(obj, i));
 }
 
 static JSBool
 array_lookupGeneric(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
                     JSProperty **propp)
 {
@@ -731,17 +731,17 @@ array_lookupGeneric(JSContext *cx, JSObj
 static JSBool
 array_lookupProperty(JSContext *cx, JSObject *obj, PropertyName *name, JSObject **objp,
                      JSProperty **propp)
 {
     return array_lookupGeneric(cx, obj, ATOM_TO_JSID(name), objp, propp);
 }
 
 static JSBool
-array_lookupElement(JSContext *cx, JSObject *obj, uint32 index, JSObject **objp,
+array_lookupElement(JSContext *cx, JSObject *obj, uint32_t index, JSObject **objp,
                     JSProperty **propp)
 {
     if (!obj->isDenseArray())
         return js_LookupElement(cx, obj, index, objp, propp);
 
     if (IsDenseArrayIndex(obj, index)) {
         *propp = (JSProperty *) 1;  /* non-null to indicate found */
         *objp = obj;
@@ -763,30 +763,30 @@ array_lookupSpecial(JSContext *cx, JSObj
     return array_lookupGeneric(cx, obj, SPECIALID_TO_JSID(sid), objp, propp);
 }
 
 JSBool
 js_GetDenseArrayElementValue(JSContext *cx, JSObject *obj, jsid id, Value *vp)
 {
     JS_ASSERT(obj->isDenseArray());
 
-    uint32 i;
+    uint32_t i;
     if (!js_IdIsIndex(id, &i)) {
         JS_ASSERT(JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom));
         vp->setNumber(obj->getArrayLength());
         return JS_TRUE;
     }
     *vp = obj->getDenseArrayElement(i);
     return JS_TRUE;
 }
 
 static JSBool
 array_getGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp)
 {
-    uint32 i;
+    uint32_t i;
 
     if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom)) {
         vp->setNumber(obj->getArrayLength());
         return JS_TRUE;
     }
 
     if (JSID_IS_ATOM(id, cx->runtime->atomState.protoAtom)) {
         vp->setObjectOrNull(obj->getProto());
@@ -818,17 +818,17 @@ array_getGeneric(JSContext *cx, JSObject
 
 static JSBool
 array_getProperty(JSContext *cx, JSObject *obj, JSObject *receiver, PropertyName *name, Value *vp)
 {
     return array_getGeneric(cx, obj, receiver, ATOM_TO_JSID(name), vp);
 }
 
 static JSBool
-array_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp)
+array_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32_t index, Value *vp)
 {
     if (!obj->isDenseArray())
         return js_GetElement(cx, obj, index, vp);
 
     if (index < obj->getDenseArrayInitializedLength() &&
         !obj->getDenseArrayElement(index).isMagic(JS_ARRAY_HOLE))
     {
         *vp = obj->getDenseArrayElement(index);
@@ -867,17 +867,17 @@ static JSType
 array_typeOf(JSContext *cx, JSObject *obj)
 {
     return JSTYPE_OBJECT;
 }
 
 static JSBool
 array_setGeneric(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
 {
-    uint32 i;
+    uint32_t i;
 
     if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
         return array_length_setter(cx, obj, id, strict, vp);
 
     if (!obj->isDenseArray())
         return js_SetPropertyHelper(cx, obj, id, 0, vp, strict);
 
     do {
@@ -907,17 +907,17 @@ array_setGeneric(JSContext *cx, JSObject
 
 static JSBool
 array_setProperty(JSContext *cx, JSObject *obj, PropertyName *name, Value *vp, JSBool strict)
 {
     return array_setGeneric(cx, obj, ATOM_TO_JSID(name), vp, strict);
 }
 
 static JSBool
-array_setElement(JSContext *cx, JSObject *obj, uint32 index, Value *vp, JSBool strict)
+array_setElement(JSContext *cx, JSObject *obj, uint32_t index, Value *vp, JSBool strict)
 {
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
 
     if (!obj->isDenseArray())
         return js_SetPropertyHelper(cx, obj, id, 0, vp, strict);
 
@@ -984,17 +984,17 @@ array_defineGeneric(JSContext *cx, JSObj
 {
     if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
         return JS_TRUE;
 
     if (!obj->isDenseArray())
         return js_DefineProperty(cx, obj, id, value, getter, setter, attrs);
 
     do {
-        uint32 i = 0;       // init to shut GCC up
+        uint32_t i = 0;       // init to shut GCC up
         bool isIndex = js_IdIsIndex(id, &i);
         if (!isIndex || attrs != JSPROP_ENUMERATE)
             break;
 
         JSObject::EnsureDenseResult result = obj->ensureDenseArrayElements(cx, i, 1);
         if (result != JSObject::ED_OK) {
             if (result == JSObject::ED_FAILED)
                 return false;
@@ -1019,17 +1019,17 @@ array_defineProperty(JSContext *cx, JSOb
 {
     return array_defineGeneric(cx, obj, ATOM_TO_JSID(name), value, getter, setter, attrs);
 }
 
 namespace js {
 
 /* non-static for direct definition of array elements within the engine */
 JSBool
-array_defineElement(JSContext *cx, JSObject *obj, uint32 index, const Value *value,
+array_defineElement(JSContext *cx, JSObject *obj, uint32_t index, const Value *value,
                     PropertyOp getter, StrictPropertyOp setter, uintN attrs)
 {
     if (!obj->isDenseArray())
         return js_DefineElement(cx, obj, index, value, getter, setter, attrs);
 
     jsid id;
     if (!IndexToId(cx, index, &id))
         return false;
@@ -1083,17 +1083,17 @@ array_getPropertyAttributes(JSContext *c
 {
     *attrsp = (name == cx->runtime->atomState.lengthAtom)
               ? JSPROP_PERMANENT
               : JSPROP_ENUMERATE;
     return true;
 }
 
 static JSBool
-array_getElementAttributes(JSContext *cx, JSObject *obj, uint32 index, uintN *attrsp)
+array_getElementAttributes(JSContext *cx, JSObject *obj, uint32_t index, uintN *attrsp)
 {
     *attrsp = JSPROP_ENUMERATE;
     return true;
 }
 
 static JSBool
 array_getSpecialAttributes(JSContext *cx, JSObject *obj, SpecialId sid, uintN *attrsp)
 {
@@ -1111,33 +1111,33 @@ array_setGenericAttributes(JSContext *cx
 static JSBool
 array_setPropertyAttributes(JSContext *cx, JSObject *obj, PropertyName *name, uintN *attrsp)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_SET_ARRAY_ATTRS);
     return false;
 }
 
 static JSBool
-array_setElementAttributes(JSContext *cx, JSObject *obj, uint32 index, uintN *attrsp)
+array_setElementAttributes(JSContext *cx, JSObject *obj, uint32_t index, uintN *attrsp)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_SET_ARRAY_ATTRS);
     return false;
 }
 
 static JSBool
 array_setSpecialAttributes(JSContext *cx, JSObject *obj, SpecialId sid, uintN *attrsp)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_SET_ARRAY_ATTRS);
     return false;
 }
 
 static JSBool
 array_deleteGeneric(JSContext *cx, JSObject *obj, jsid id, Value *rval, JSBool strict)
 {
-    uint32 i;
+    uint32_t i;
 
     if (!obj->isDenseArray())
         return js_DeleteProperty(cx, obj, id, rval, strict);
 
     if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom)) {
         rval->setBoolean(false);
         return true;
     }
@@ -1159,17 +1159,17 @@ array_deleteProperty(JSContext *cx, JSOb
 {
     return array_deleteGeneric(cx, obj, ATOM_TO_JSID(name), rval, strict);
 }
 
 namespace js {
 
 /* non-static for direct deletion of array elements within the engine */
 JSBool
-array_deleteElement(JSContext *cx, JSObject *obj, uint32 index, Value *rval, JSBool strict)
+array_deleteElement(JSContext *cx, JSObject *obj, uint32_t index, Value *rval, JSBool strict)
 {
     if (!obj->isDenseArray())
         return js_DeleteElement(cx, obj, index, rval, strict);
 
     if (index < obj->getDenseArrayInitializedLength()) {
         obj->markDenseArrayNotPacked(cx);
         obj->setDenseArrayElement(index, MagicValue(JS_ARRAY_HOLE));
     }
@@ -1189,17 +1189,17 @@ array_deleteSpecial(JSContext *cx, JSObj
     return array_deleteGeneric(cx, obj, SPECIALID_TO_JSID(sid), rval, strict);
 }
 
 static void
 array_trace(JSTracer *trc, JSObject *obj)
 {
     JS_ASSERT(obj->isDenseArray());
 
-    uint32 initLength = obj->getDenseArrayInitializedLength();
+    uint32_t initLength = obj->getDenseArrayInitializedLength();
     MarkValueRange(trc, initLength, obj->getDenseArrayElements(), "element");
 }
 
 static JSBool
 array_fix(JSContext *cx, JSObject *obj, bool *success, AutoIdVector *props)
 {
     JS_ASSERT(obj->isDenseArray());
 
@@ -1326,18 +1326,18 @@ JSBool
 JSObject::makeDenseArraySlow(JSContext *cx)
 {
     JS_ASSERT(isDenseArray());
 
     MarkTypeObjectFlags(cx, this,
                         OBJECT_FLAG_NON_PACKED_ARRAY |
                         OBJECT_FLAG_NON_DENSE_ARRAY);
 
-    uint32 arrayCapacity = getDenseArrayCapacity();
-    uint32 arrayInitialized = getDenseArrayInitializedLength();
+    uint32_t arrayCapacity = getDenseArrayCapacity();
+    uint32_t arrayInitialized = getDenseArrayInitializedLength();
 
     /*
      * Get an allocated array of the existing elements, evicting from the fixed
      * slots if necessary.
      */
     if (!hasDynamicElements()) {
         if (!growElements(cx, arrayCapacity))
             return false;
@@ -1376,18 +1376,18 @@ JSObject::makeDenseArraySlow(JSContext *
         elements = elems;
         return false;
     }
 
     /*
      * Create new properties pointing to existing elements. Pack the array to
      * remove holes, so that shapes use successive slots (as for other objects).
      */
-    uint32 next = 0;
-    for (uint32 i = 0; i < arrayInitialized; i++) {
+    uint32_t next = 0;
+    for (uint32_t i = 0; i < arrayInitialized; i++) {
         /* Dense array indexes can always fit in a jsid. */
         jsid id;
         JS_ALWAYS_TRUE(ValueToId(cx, Int32Value(i), &id));
 
         if (elems[i].isMagic(JS_ARRAY_HOLE))
             continue;
 
         if (!addDataProperty(cx, id, next, JSPROP_ENUMERATE)) {
@@ -1547,17 +1547,17 @@ array_toSource(JSContext *cx, uintN argc
     return true;
 }
 #endif
 
 class AutoArrayCycleDetector
 {
     JSContext *cx;
     JSObject *obj;
-    uint32 genBefore;
+    uint32_t genBefore;
     BusyArraysSet::AddPtr hashPointer;
     bool cycle;
     JS_DECL_USE_GUARD_OBJECT_NOTIFIER
 
   public:
     AutoArrayCycleDetector(JSContext *cx, JSObject *obj JS_GUARD_OBJECT_NOTIFIER_PARAM)
       : cx(cx),
         obj(obj),
@@ -1752,17 +1752,17 @@ InitArrayTypes(JSContext *cx, TypeObject
 
 enum ShouldUpdateTypes
 {
     UpdateTypes = true,
     DontUpdateTypes = false
 };
 
 static bool
-InitArrayElements(JSContext *cx, JSObject *obj, uint32 start, uint32 count, const Value *vector, ShouldUpdateTypes updateTypes)
+InitArrayElements(JSContext *cx, JSObject *obj, uint32_t start, uint32_t count, const Value *vector, ShouldUpdateTypes updateTypes)
 {
     JS_ASSERT(count <= MAX_ARRAY_INDEX);
 
     if (count == 0)
         return true;
 
     if (updateTypes && !InitArrayTypes(cx, obj->getType(cx), vector, count))
         return false;
@@ -1920,17 +1920,17 @@ array_reverse(JSContext *cx, uintN argc,
                 return false;
             JS_ASSERT(result == JSObject::ED_SPARSE);
             break;
         }
 
         /* Fill out the array's initialized length to its proper length. */
         obj->ensureDenseArrayInitializedLength(cx, len, 0);
 
-        uint32 lo = 0, hi = len - 1;
+        uint32_t lo = 0, hi = len - 1;
         for (; lo < hi; lo++, hi--) {
             Value origlo = obj->getDenseArrayElement(lo);
             Value orighi = obj->getDenseArrayElement(hi);
             obj->setDenseArrayElement(lo, orighi);
             if (orighi.isMagic(JS_ARRAY_HOLE) &&
                 !js_SuppressDeletedProperty(cx, obj, INT_TO_JSID(lo))) {
                 return false;
             }
@@ -1970,17 +1970,17 @@ namespace {
 inline bool
 CompareStringValues(JSContext *cx, const Value &a, const Value &b, bool *lessOrEqualp)
 {
     if (!JS_CHECK_OPERATION_LIMIT(cx))
         return false;
 
     JSString *astr = a.toString();
     JSString *bstr = b.toString();
-    int32 result;
+    int32_t result;
     if (!CompareStrings(cx, astr, bstr, &result))
         return false;
 
     *lessOrEqualp = (result <= 0);
     return true;
 }
 
 struct SortComparatorStrings {
@@ -2262,17 +2262,17 @@ array_push_slowly(JSContext *cx, JSObjec
     return js_SetLengthProperty(cx, obj, newlength);
 }
 
 static bool
 array_push1_dense(JSContext* cx, JSObject* obj, CallArgs &args)
 {
     JS_ASSERT(args.length() == 1);
 
-    uint32 length = obj->getArrayLength();
+    uint32_t length = obj->getArrayLength();
     JSObject::EnsureDenseResult result = obj->ensureDenseArrayElements(cx, length, 1);
     if (result != JSObject::ED_OK) {
         if (result == JSObject::ED_FAILED)
             return false;
         JS_ASSERT(result == JSObject::ED_SPARSE);
         if (!obj->makeDenseArraySlow(cx))
             return false;
         return array_push_slowly(cx, obj, args);
@@ -2284,17 +2284,17 @@ array_push1_dense(JSContext* cx, JSObjec
     return true;
 }
 
 JS_ALWAYS_INLINE JSBool
 NewbornArrayPushImpl(JSContext *cx, JSObject *obj, const Value &v)
 {
     JS_ASSERT(!v.isMagic());
 
-    uint32 length = obj->getArrayLength();
+    uint32_t length = obj->getArrayLength();
     if (obj->isSlowArray()) {
         /* This can happen in one evil case. See bug 630377. */
         jsid id;
         return IndexToId(cx, length, &id) &&
                js_DefineProperty(cx, obj, id, &v, NULL, NULL, JSPROP_ENUMERATE);
     }
 
     JS_ASSERT(obj->isDenseArray());
@@ -2402,17 +2402,17 @@ mjit::stubs::ArrayShift(VMFrame &f)
     JSObject *obj = &f.regs.sp[-1].toObject();
     JS_ASSERT(obj->isDenseArray());
 
     /*
      * At this point the length and initialized length have already been
      * decremented and the result fetched, so just shift the array elements
      * themselves.
      */
-    uint32 initlen = obj->getDenseArrayInitializedLength();
+    uint32_t initlen = obj->getDenseArrayInitializedLength();
     obj->moveDenseArrayElements(0, 1, initlen);
 }
 #endif /* JS_METHODJIT */
 
 JSBool
 js::array_shift(JSContext *cx, uintN argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -2489,17 +2489,17 @@ array_unshift(JSContext *cx, uintN argc,
                 JSObject::EnsureDenseResult result = obj->ensureDenseArrayElements(cx, length, args.length());
                 if (result != JSObject::ED_OK) {
                     if (result == JSObject::ED_FAILED)
                         return false;
                     JS_ASSERT(result == JSObject::ED_SPARSE);
                     break;
                 }
                 obj->moveDenseArrayElements(args.length(), 0, length);
-                for (uint32 i = 0; i < args.length(); i++)
+                for (uint32_t i = 0; i < args.length(); i++)
                     obj->setDenseArrayElement(i, MagicValue(JS_ARRAY_HOLE));
                 optimized = true;
             } while (false);
 
             if (!optimized) {
                 jsdouble last = length;
                 jsdouble upperIndex = last + args.length();
                 AutoValueRooter tvr(cx);
@@ -2547,17 +2547,17 @@ TryReuseArrayType(JSObject *obj, JSObjec
 /*
  * Returns true if this is a dense array whose |count| properties starting from
  * |startingIndex| may be accessed (get, set, delete) directly through its
  * contiguous vector of elements without fear of getters, setters, etc. along
  * the prototype chain, or of enumerators requiring notification of
  * modifications.
  */
 static inline bool
-CanOptimizeForDenseStorage(JSObject *arr, uint32 startingIndex, uint32 count, JSContext *cx)
+CanOptimizeForDenseStorage(JSObject *arr, uint32_t startingIndex, uint32_t count, JSContext *cx)
 {
     /* If the desired properties overflow dense storage, we can't optimize. */
     if (UINT32_MAX - startingIndex < count)
         return false;
 
     /* There's no optimizing possible if it's not a dense array. */
     if (!arr->isDenseArray())
         return false;
@@ -2579,18 +2579,18 @@ CanOptimizeForDenseStorage(JSObject *arr
         return false;
 
     /* Now just watch out for getters and setters along the prototype chain. */
     return !js_PrototypeHasIndexedProperties(cx, arr) &&
            startingIndex + count <= arr->getDenseArrayInitializedLength();
 }
 
 static inline bool
-CopyArrayElement(JSContext *cx, JSObject *source, uint32 sourceIndex,
-                 JSObject *target, uint32 targetIndex)
+CopyArrayElement(JSContext *cx, JSObject *source, uint32_t sourceIndex,
+                 JSObject *target, uint32_t targetIndex)
 {
     if (!JS_CHECK_OPERATION_LIMIT(cx))
         return false;
 
     JSBool hole;
     Value fromValue;
     return GetElement(cx, source, sourceIndex, &hole, &fromValue) &&
            SetOrDeleteArrayElement(cx, target, targetIndex, hole, fromValue);
@@ -2603,34 +2603,34 @@ array_splice(JSContext *cx, uintN argc, 
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
     JSObject *obj = ToObject(cx, &args.thisv());
     if (!obj)
         return false;
 
     /* Steps 3-4. */
-    uint32 len;
+    uint32_t len;
     if (!js_GetLengthProperty(cx, obj, &len))
         return false;
 
     /* Step 5. */
     double relativeStart;
     if (!ToInteger(cx, argc >= 1 ? args[0] : UndefinedValue(), &relativeStart))
         return false;
 
     /* Step 6. */
-    uint32 actualStart;
+    uint32_t actualStart;
     if (relativeStart < 0)
         actualStart = JS_MAX(len + relativeStart, 0);
     else
         actualStart = JS_MIN(relativeStart, len);
 
     /* Step 7. */
-    uint32 actualDeleteCount;
+    uint32_t actualDeleteCount;
     if (argc != 1) {
         jsdouble deleteCountDouble;
         if (!ToInteger(cx, argc >= 2 ? args[1] : Int32Value(0), &deleteCountDouble))
             return false;
         actualDeleteCount = JS_MIN(JS_MAX(deleteCountDouble, 0), len - actualStart);
     } else {
         /*
          * Non-standard: if start was specified but deleteCount was omitted,
@@ -2650,36 +2650,36 @@ array_splice(JSContext *cx, uintN argc, 
             return false;
         TryReuseArrayType(obj, arr);
     } else {
         arr = NewDenseAllocatedArray(cx, actualDeleteCount);
         if (!arr)
             return false;
         TryReuseArrayType(obj, arr);
 
-        for (uint32 k = 0; k < actualDeleteCount; k++) {
+        for (uint32_t k = 0; k < actualDeleteCount; k++) {
             JSBool hole;
             Value fromValue;
             if (!JS_CHECK_OPERATION_LIMIT(cx) ||
                 !GetElement(cx, obj, actualStart + k, &hole, &fromValue) ||
                 (!hole && !arr->defineElement(cx, k, fromValue)))
             {
                 return false;
             }
         }
     }
 
     /* Step 11. */
-    uint32 itemCount = (argc >= 2) ? (argc - 2) : 0;
+    uint32_t itemCount = (argc >= 2) ? (argc - 2) : 0;
 
     if (itemCount < actualDeleteCount) {
         /* Step 12: the array is being shrunk. */
-        uint32 sourceIndex = actualStart + actualDeleteCount;
-        uint32 targetIndex = actualStart + itemCount;
-        uint32 finalLength = len - actualDeleteCount + itemCount;
+        uint32_t sourceIndex = actualStart + actualDeleteCount;
+        uint32_t targetIndex = actualStart + itemCount;
+        uint32_t finalLength = len - actualDeleteCount + itemCount;
 
         if (CanOptimizeForDenseStorage(obj, 0, len, cx)) {
             /* Steps 12(a)-(b). */
             obj->moveDenseArrayElements(targetIndex, sourceIndex, len - sourceIndex);
 
             /*
              * Update the initialized length. Do so before shrinking so that we
              * can apply the write barrier to the old slots.
@@ -2697,29 +2697,29 @@ array_splice(JSContext *cx, uintN argc, 
             /*
              * This is all very slow if the length is very large. We don't yet
              * have the ability to iterate in sorted order, so we just do the
              * pessimistic thing and let JS_CHECK_OPERATION_LIMIT handle the
              * fallout.
              */
 
             /* Steps 12(a)-(b). */
-            for (uint32 from = sourceIndex, to = targetIndex; from < len; from++, to++) {
+            for (uint32_t from = sourceIndex, to = targetIndex; from < len; from++, to++) {
                 JSBool hole;
                 Value fromValue;
                 if (!JS_CHECK_OPERATION_LIMIT(cx) ||
                     !GetElement(cx, obj, from, &hole, &fromValue) ||
                     !SetOrDeleteArrayElement(cx, obj, to, hole, fromValue))
                 {
                     return false;
                 }
             }
 
             /* Steps 12(c)-(d). */
-            for (uint32 k = len; k > finalLength; k--) {
+            for (uint32_t k = len; k > finalLength; k--) {
                 if (DeleteArrayElement(cx, obj, k - 1, true) < 0)
                     return false;
             }
         }
     } else if (itemCount > actualDeleteCount) {
         /* Step 13. */
 
         /*
@@ -2764,17 +2764,17 @@ array_splice(JSContext *cx, uintN argc, 
             }
         }
     }
 
     /* Step 10. */
     Value *items = args.array() + 2;
 
     /* Steps 14-15. */
-    for (uint32 k = actualStart, i = 0; i < itemCount; i++, k++) {
+    for (uint32_t k = actualStart, i = 0; i < itemCount; i++, k++) {
         if (!SetArrayElement(cx, obj, k, items[i]))
             return false;
     }
 
     /* Step 16. */
     jsdouble finalLength = jsdouble(len) - actualDeleteCount + itemCount;
     if (!js_SetLengthProperty(cx, obj, finalLength))
         return false;
@@ -2789,24 +2789,24 @@ void JS_FASTCALL
 mjit::stubs::ArrayConcatTwoArrays(VMFrame &f)
 {
     JSObject *result = &f.regs.sp[-3].toObject();
     JSObject *obj1 = &f.regs.sp[-2].toObject();
     JSObject *obj2 = &f.regs.sp[-1].toObject();
 
     JS_ASSERT(result->isDenseArray() && obj1->isDenseArray() && obj2->isDenseArray());
 
-    uint32 initlen1 = obj1->getDenseArrayInitializedLength();
+    uint32_t initlen1 = obj1->getDenseArrayInitializedLength();
     JS_ASSERT(initlen1 == obj1->getArrayLength());
 
-    uint32 initlen2 = obj2->getDenseArrayInitializedLength();
+    uint32_t initlen2 = obj2->getDenseArrayInitializedLength();
     JS_ASSERT(initlen2 == obj2->getArrayLength());
 
     /* No overflow here due to nslots limit. */
-    uint32 len = initlen1 + initlen2;
+    uint32_t len = initlen1 + initlen2;
 
     if (!result->ensureElements(f.cx, len))
         THROW();
 
     JS_ASSERT(!result->getDenseArrayInitializedLength());
     result->setDenseArrayInitializedLength(len);
 
     result->initDenseArrayElements(0, obj1->getDenseArrayElements(), initlen1);
@@ -2860,17 +2860,17 @@ js::array_concat(JSContext *cx, uintN ar
             return false;
         const Value &v = p[i];
         if (v.isObject()) {
             JSObject &obj = v.toObject();
             if (ObjectClassIs(obj, ESClass_Array, cx)) {
                 jsuint alength;
                 if (!js_GetLengthProperty(cx, &obj, &alength))
                     return false;
-                for (uint32 slot = 0; slot < alength; slot++) {
+                for (uint32_t slot = 0; slot < alength; slot++) {
                     JSBool hole;
                     Value tmp;
                     if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, &obj, slot, &hole, &tmp))
                         return false;
 
                     /*
                      * Per ECMA 262, 15.4.4.4, step 9, ignore nonexistent
                      * properties.
@@ -3104,34 +3104,34 @@ static inline bool
 array_readonlyCommon(JSContext *cx, CallArgs &args)
 {
     /* Step 1. */
     JSObject *obj = ToObject(cx, &args.thisv());
     if (!obj)
         return false;
 
     /* Step 2-3. */
-    uint32 len;
+    uint32_t len;
     if (!js_GetLengthProperty(cx, obj, &len))
         return false;
 
     /* Step 4. */
     if (args.length() == 0) {
         js_ReportMissingArg(cx, args.calleev(), 0);
         return false;
     }
     JSObject *callable = js_ValueToCallableObject(cx, &args[0], JSV2F_SEARCH_STACK);
     if (!callable)
         return false;
 
     /* Step 5. */
     Value thisv = args.length() >= 2 ? args[1] : UndefinedValue();
 
     /* Step 6. */
-    uint32 k = 0;
+    uint32_t k = 0;
 
     /* Step 7. */
     InvokeArgsGuard ag;
     while (k < len) {
         if (!JS_CHECK_OPERATION_LIMIT(cx))
             return false;
 
         /* Step a, b, and c.i. */
@@ -3196,17 +3196,17 @@ array_map(JSContext *cx, uintN argc, Val
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
     JSObject *obj = ToObject(cx, &args.thisv());
     if (!obj)
         return false;
 
     /* Step 2-3. */
-    uint32 len;
+    uint32_t len;
     if (!js_GetLengthProperty(cx, obj, &len))
         return false;
 
     /* Step 4. */
     if (args.length() == 0) {
         js_ReportMissingArg(cx, args.calleev(), 0);
         return false;
     }
@@ -3222,17 +3222,17 @@ array_map(JSContext *cx, uintN argc, Val
     if (!arr)
         return false;
     TypeObject *newtype = GetTypeCallerInitObject(cx, JSProto_Array);
     if (!newtype)
         return false;
     arr->setType(newtype);
 
     /* Step 7. */
-    uint32 k = 0;
+    uint32_t k = 0;
 
     /* Step 8. */
     InvokeArgsGuard ag;
     while (k < len) {
         if (!JS_CHECK_OPERATION_LIMIT(cx))
             return false;
 
         /* Step a, b, and c.i. */
@@ -3272,17 +3272,17 @@ array_filter(JSContext *cx, uintN argc, 
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
     JSObject *obj = ToObject(cx, &args.thisv());
     if (!obj)
         return false;
 
     /* Step 2-3. */
-    uint32 len;
+    uint32_t len;
     if (!js_GetLengthProperty(cx, obj, &len))
         return false;
 
     /* Step 4. */
     if (args.length() == 0) {
         js_ReportMissingArg(cx, args.calleev(), 0);
         return false;
     }
@@ -3298,20 +3298,20 @@ array_filter(JSContext *cx, uintN argc, 
     if (!arr)
         return false;
     TypeObject *newtype = GetTypeCallerInitObject(cx, JSProto_Array);
     if (!newtype)
         return false;
     arr->setType(newtype);
 
     /* Step 7. */
-    uint32 k = 0;
+    uint32_t k = 0;
 
     /* Step 8. */
-    uint32 to = 0;
+    uint32_t to = 0;
 
     /* Step 9. */
     InvokeArgsGuard ag;
     while (k < len) {
         if (!JS_CHECK_OPERATION_LIMIT(cx))
             return false;