Bug 714728 - Remove jsword/jsuword in favour of intptr_t/uintptr_t; r=Waldo
authorMs2ger <ms2ger@gmail.com>
Wed, 11 Jan 2012 09:23:05 +0100
changeset 85382 2f310f45610707e33b63f292d144b946d7b8bec1
parent 85381 d5f3e38021fd52a6c331d4d532e4b1875461b26e
child 85383 109e7285c5eee7650494ebf560f596cb7ff71fc3
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs714728
milestone12.0a1
Bug 714728 - Remove jsword/jsuword in favour of intptr_t/uintptr_t; r=Waldo
js/jsd/jsd.h
js/jsd/jsd_hook.c
js/jsd/jsd_scpt.c
js/jsd/jsd_stak.c
js/jsd/jsd_step.c
js/jsd/jsd_xpc.cpp
js/jsd/jsd_xpc.h
js/jsd/jsdebug.c
js/jsd/jsdebug.h
js/src/ctypes/CTypes.h
js/src/jsapi-tests/testIntTypesABI.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsatom.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscompat.h
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsfriendapi.h
js/src/jsfun.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcchunk.cpp
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsinferinlines.h
js/src/jsiter.cpp
js/src/jslock.cpp
js/src/jslock.h
js/src/jslocko.asm
js/src/jslog2.cpp
js/src/jsnativestack.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/jspropertycache.h
js/src/jspropertytree.h
js/src/jsscope.cpp
js/src/jsscope.h
js/src/jsscopeinlines.h
js/src/jsscript.cpp
js/src/jstypes.h
js/src/shell/js.cpp
js/xpconnect/src/xpcprivate.h
--- a/js/jsd/jsd.h
+++ b/js/jsd/jsd.h
@@ -230,17 +230,17 @@ struct JSDSourceText
     uintN            alterCount;
     JSBool           doingEval;
 };
 
 struct JSDExecHook
 {
     JSCList               links;        /* we are part of a JSCList */
     JSDScript*            jsdscript;
-    jsuword               pc;
+    uintptr_t             pc;
     JSD_ExecutionHookProc hook;
     void*                 callerdata;
 };
 
 #define TS_HAS_DISABLED_FRAME 0x01
 
 struct JSDThreadState
 {
@@ -252,17 +252,17 @@ struct JSDThreadState
     uintN               flags;
 };
 
 struct JSDStackFrameInfo
 {
     JSCList             links;        /* we are part of a JSCList */
     JSDThreadState*     jsdthreadstate;
     JSDScript*          jsdscript;
-    jsuword             pc;
+    uintptr_t           pc;
     JSStackFrame*       fp;
 };
 
 #define GOT_PROTO   ((short) (1 << 0))
 #define GOT_PROPS   ((short) (1 << 1))
 #define GOT_PARENT  ((short) (1 << 2))
 #define GOT_CTOR    ((short) (1 << 3))
 
@@ -469,26 +469,26 @@ extern uintN
 jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern JSBool
 jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata);
 
 extern JSBool
 jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata);
 
-extern jsuword
+extern uintptr_t
 jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line);
 
 extern uintN
-jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc);
+jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc);
 
 extern JSBool
 jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
                uintN startLine, uintN maxLines,
-               uintN* count, uintN** lines, jsuword** pcs);
+               uintN* count, uintN** lines, uintptr_t** pcs);
 
 extern void
 jsd_NewScriptHookProc(
                 JSContext   *cx,
                 const char  *filename,      /* URL this script loads from */
                 uintN       lineno,         /* line where this script starts */
                 JSScript    *script,
                 JSFunction  *fun,
@@ -500,24 +500,24 @@ jsd_DestroyScriptHookProc(
                 JSScript    *script,
                 void*       callerdata);
 
 /* Script execution hook functions */
 
 extern JSBool
 jsd_SetExecutionHook(JSDContext*           jsdc,
                      JSDScript*            jsdscript,
-                     jsuword               pc,
+                     uintptr_t             pc,
                      JSD_ExecutionHookProc hook,
                      void*                 callerdata);
 
 extern JSBool
 jsd_ClearExecutionHook(JSDContext*           jsdc,
                        JSDScript*            jsdscript,
-                       jsuword               pc);
+                       uintptr_t             pc);
 
 extern JSBool
 jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript);
 
 extern JSBool
 jsd_ClearAllExecutionHooks(JSDContext* jsdc);
 
 extern void
@@ -698,17 +698,17 @@ jsd_GetCallingStackFrame(JSDContext* jsd
                          JSDThreadState* jsdthreadstate,
                          JSDStackFrameInfo* jsdframe);
 
 extern JSDScript*
 jsd_GetScriptForStackFrame(JSDContext* jsdc,
                            JSDThreadState* jsdthreadstate,
                            JSDStackFrameInfo* jsdframe);
 
-extern jsuword
+extern uintptr_t
 jsd_GetPCForStackFrame(JSDContext* jsdc,
                        JSDThreadState* jsdthreadstate,
                        JSDStackFrameInfo* jsdframe);
 
 extern JSDValue*
 jsd_GetCallObjectForStackFrame(JSDContext* jsdc,
                                JSDThreadState* jsdthreadstate,
                                JSDStackFrameInfo* jsdframe);
@@ -1123,17 +1123,17 @@ jsdlw_BuildAppRelativeFilename(LWDBGApp*
 extern JSDSourceText*
 jsdlw_PreLoadSource(JSDContext* jsdc, LWDBGApp* app,
                      const char* filename, JSBool clear);
 
 extern JSDSourceText*
 jsdlw_ForceLoadSource(JSDContext* jsdc, JSDSourceText* jsdsrc);
 
 extern JSBool
-jsdlw_UserCodeAtPC(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc);
+jsdlw_UserCodeAtPC(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc);
 
 extern JSBool
 jsdlw_RawToProcessedLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
                                uintN lineIn, uintN* lineOut);
 
 extern JSBool
 jsdlw_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
                                uintN lineIn, uintN* lineOut);
--- a/js/jsd/jsd_hook.c
+++ b/js/jsd/jsd_hook.c
@@ -67,17 +67,17 @@ jsd_InterruptHandler(JSContext *cx, JSSc
     
     JSD_LOCK_SCRIPTS(jsdc);
     jsdscript = jsd_FindOrCreateJSDScript(jsdc, cx, script, NULL);
     JSD_UNLOCK_SCRIPTS(jsdc);
     if( ! jsdscript )
         return JSTRAP_CONTINUE;
 
 #ifdef LIVEWIRE
-    if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (jsuword)pc) )
+    if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
         return JSTRAP_CONTINUE;
 #endif
 
     return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_INTERRUPTED,
                                  hook, hookData, rval);
 }
 
 JSTrapStatus
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -518,20 +518,20 @@ jsd_GetScriptBaseLineNumber(JSDContext* 
 uintN
 jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript)
 {
     if( NOT_SET_YET == (int)jsdscript->lineExtent )
         jsdscript->lineExtent = JS_GetScriptLineExtent(jsdc->dumbContext, jsdscript->script);
     return jsdscript->lineExtent;
 }
 
-jsuword
+uintptr_t
 jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line)
 {
-    jsuword pc;
+    uintptr_t pc;
     JSCrossCompartmentCall *call;
 
     if( !jsdscript )
         return 0;
 #ifdef LIVEWIRE
     if( jsdscript->lwscript )
     {
         uintN newline;
@@ -539,23 +539,23 @@ jsd_GetClosestPC(JSDContext* jsdc, JSDSc
         if( line != newline )
             line = newline;
     }
 #endif
 
     call = JS_EnterCrossCompartmentCallScript(jsdc->dumbContext, jsdscript->script);
     if(!call)
         return 0;
-    pc = (jsuword) JS_LineNumberToPC(jsdc->dumbContext, jsdscript->script, line );
+    pc = (uintptr_t) JS_LineNumberToPC(jsdc->dumbContext, jsdscript->script, line );
     JS_LeaveCrossCompartmentCall(call);
     return pc;
 }
 
 uintN
-jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc)
+jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc)
 {
     JSCrossCompartmentCall *call;
     uintN first = jsdscript->lineBase;
     uintN last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1;
     uintN line = 0;
 
     call = JS_EnterCrossCompartmentCallScript(jsdc->dumbContext, jsdscript->script);
     if(!call)
@@ -579,17 +579,17 @@ jsd_GetClosestLine(JSDContext* jsdc, JSD
 #endif
 
     return line;    
 }
 
 JSBool
 jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
                uintN startLine, uintN maxLines,
-               uintN* count, uintN** retLines, jsuword** retPCs)
+               uintN* count, uintN** retLines, uintptr_t** retPCs)
 {
     JSCrossCompartmentCall *call;
     uintN first = jsdscript->lineBase;
     uintN last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1;
     JSBool ok;
     uintN *lines;
     jsbytecode **pcs;
     uintN i;
@@ -749,17 +749,17 @@ jsd_DestroyScriptHookProc(
     JSD_UNLOCK_SCRIPTS(jsdc);
 #endif /* JSD_DUMP */
 }                
 
 
 /***************************************************************************/
 
 static JSDExecHook*
-_findHook(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc)
+_findHook(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc)
 {
     JSDExecHook* jsdhook;
     JSCList* list = &jsdscript->hooks;
 
     for( jsdhook = (JSDExecHook*)list->next;
          jsdhook != (JSDExecHook*)list;
          jsdhook = (JSDExecHook*)jsdhook->links.next )
     {
@@ -816,17 +816,17 @@ jsd_TrapHandler(JSContext *cx, JSScript 
     if( NULL == (jsdc = jsd_JSDContextForJSContext(cx)) ||
         ! _isActiveHook(jsdc, script, jsdhook) )
     {
         JSD_UNLOCK();
         return JSTRAP_CONTINUE;
     }
 
     JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
-    JS_ASSERT(!jsdhook->pc || jsdhook->pc == (jsuword)pc);
+    JS_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
     JS_ASSERT(jsdhook->jsdscript->script == script);
     JS_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
 
     hook = jsdhook->hook;
     hookData = jsdhook->callerdata;
     jsdscript = jsdhook->jsdscript;
 
     /* do not use jsdhook-> after this point */
@@ -834,30 +834,30 @@ jsd_TrapHandler(JSContext *cx, JSScript 
 
     if( ! jsdc || ! jsdc->inited )
         return JSTRAP_CONTINUE;
 
     if( JSD_IS_DANGEROUS_THREAD(jsdc) )
         return JSTRAP_CONTINUE;
 
 #ifdef LIVEWIRE
-    if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (jsuword)pc) )
+    if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
         return JSTRAP_CONTINUE;
 #endif
 
     return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_BREAKPOINT,
                                  hook, hookData, rval);
 }
 
 
 
 JSBool
 jsd_SetExecutionHook(JSDContext*           jsdc, 
                      JSDScript*            jsdscript,
-                     jsuword               pc,
+                     uintptr_t             pc,
                      JSD_ExecutionHookProc hook,
                      void*                 callerdata)
 {
     JSDExecHook* jsdhook;
     JSBool rv;
     JSCrossCompartmentCall *call;
 
     JSD_LOCK();
@@ -911,17 +911,17 @@ jsd_SetExecutionHook(JSDContext*        
     JSD_UNLOCK();
 
     return JS_TRUE;
 }
 
 JSBool
 jsd_ClearExecutionHook(JSDContext*           jsdc, 
                        JSDScript*            jsdscript,
-                       jsuword               pc)
+                       uintptr_t             pc)
 {
     JSCrossCompartmentCall *call;
     JSDExecHook* jsdhook;
 
     JSD_LOCK();
 
     jsdhook = _findHook(jsdc, jsdscript, pc);
     if( ! jsdhook )
--- a/js/jsd/jsd_stak.c
+++ b/js/jsd/jsd_stak.c
@@ -55,17 +55,17 @@ void JSD_ASSERT_VALID_STACK_FRAME(JSDSta
     JS_ASSERT(jsdframe->jsdthreadstate);
 }
 #endif
 
 static JSDStackFrameInfo* 
 _addNewFrame(JSDContext*        jsdc,
              JSDThreadState*    jsdthreadstate,
              JSScript*          script,
-             jsuword            pc,
+             uintptr_t          pc,
              JSStackFrame*      fp)
 {
     JSDStackFrameInfo* jsdframe;
     JSDScript*         jsdscript = NULL;
 
     if (JS_IsScriptFrame(jsdthreadstate->context, fp))
     {
         JSD_LOCK_SCRIPTS(jsdc);
@@ -120,17 +120,17 @@ jsd_NewThreadState(JSDContext* jsdc, JSC
     jsdthreadstate->thread = JSD_CURRENT_THREAD();
     JS_INIT_CLIST(&jsdthreadstate->stack);
     jsdthreadstate->stackDepth = 0;
 
     JS_BeginRequest(jsdthreadstate->context);
     while( NULL != (fp = JS_FrameIterator(cx, &iter)) )
     {
         JSScript* script = JS_GetFrameScript(cx, fp);
-        jsuword  pc = (jsuword) JS_GetFramePC(cx, fp);
+        uintptr_t  pc = (uintptr_t) JS_GetFramePC(cx, fp);
         jsval dummyThis;
 
         /*
          * don't construct a JSDStackFrame for dummy frames (those without a
          * |this| object, or native frames, if JSD_INCLUDE_NATIVE_FRAMES
          * isn't set.
          */
         if (JS_GetFrameThis(cx, fp, &dummyThis) &&
@@ -265,22 +265,22 @@ jsd_GetScriptForStackFrame(JSDContext* j
     if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
         jsdscript = jsdframe->jsdscript;
 
     JSD_UNLOCK_THREADSTATES(jsdc);
 
     return jsdscript;
 }
 
-jsuword
+uintptr_t
 jsd_GetPCForStackFrame(JSDContext* jsdc, 
                        JSDThreadState* jsdthreadstate,
                        JSDStackFrameInfo* jsdframe)
 {
-    jsuword pc = 0;
+    uintptr_t pc = 0;
 
     JSD_LOCK_THREADSTATES(jsdc);
 
     if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
         pc = jsdframe->pc;
 
     JSD_UNLOCK_THREADSTATES(jsdc);
 
--- a/js/jsd/jsd_step.c
+++ b/js/jsd/jsd_step.c
@@ -93,17 +93,17 @@ static void
 
     if(before)
     {
         jsval thisVal;
 
         printf("%s this: ", JS_IsConstructorFrame(cx, fp) ? "constructing":"");
 
         if (JS_GetFrameThis(cx, fp, &thisVal))
-            printf("0x%0llx", (JSUword) thisVal);
+            printf("0x%0llx", (uintptr_t) thisVal);
         else
             puts("<unavailable>");
     }
     printf("\n");
     JS_ASSERT(indent >= 0);
 }
 #endif
 
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -371,17 +371,17 @@ jsds_FilterHook (JSDContext *jsdc, JSDTh
         NS_WARNING("No frame in threadstate");
         return false;
     }
 
     JSDScript *script = JSD_GetScriptForStackFrame (jsdc, state, frame);
     if (!script)
         return true;
 
-    jsuword pc = JSD_GetPCForStackFrame (jsdc, state, frame);
+    uintptr_t pc = JSD_GetPCForStackFrame (jsdc, state, frame);
 
     nsCString url(JSD_GetScriptFilename (jsdc, script));
     if (url.IsEmpty()) {
         NS_WARNING ("Script with no filename");
         return false;
     }
 
     if (!gFilters)
@@ -1301,17 +1301,17 @@ jsdScript::GetParameterNames(PRUint32* c
     }
 
     PRUnichar **ret =
         static_cast<PRUnichar**>(NS_Alloc(nargs * sizeof(PRUnichar*)));
     if (!ret)
         return NS_ERROR_OUT_OF_MEMORY;
 
     void *mark;
-    jsuword *names = JS_GetFunctionLocalNameArray(cx, fun, &mark);
+    uintptr_t *names = JS_GetFunctionLocalNameArray(cx, fun, &mark);
     if (!names) {
         NS_Free(ret);
         return NS_ERROR_OUT_OF_MEMORY;
     }
 
     nsresult rv = NS_OK;
     for (uintN i = 0; i < nargs; ++i) {
         JSAtom *atom = JS_LocalNameToAtom(names[i]);
@@ -1502,17 +1502,17 @@ jsdScript::PcToLine(PRUint32 aPC, PRUint
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdScript::LineToPc(PRUint32 aLine, PRUint32 aPcmap, PRUint32 *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     if (aPcmap == PCMAP_SOURCETEXT) {
-        jsuword pc = JSD_GetClosestPC (mCx, mScript, aLine);
+        uintptr_t pc = JSD_GetClosestPC (mCx, mScript, aLine);
         *_rval = pc - mFirstPC;
     } else if (aPcmap == PCMAP_PRETTYPRINT) {
         *_rval = PPLineToPc(aLine);
     } else {
         return NS_ERROR_INVALID_ARG;
     }
 
     return NS_OK;
@@ -1531,20 +1531,20 @@ jsdScript::EnableSingleStepInterrupts(bo
 }
 
 NS_IMETHODIMP
 jsdScript::GetExecutableLines(PRUint32 aPcmap, PRUint32 aStartLine, PRUint32 aMaxLines,
                               PRUint32* aCount, PRUint32** aExecutableLines)
 {
     ASSERT_VALID_EPHEMERAL;
     if (aPcmap == PCMAP_SOURCETEXT) {
-        jsuword start = JSD_GetClosestPC(mCx, mScript, 0);
+        uintptr_t start = JSD_GetClosestPC(mCx, mScript, 0);
         uintN lastLine = JSD_GetScriptBaseLineNumber(mCx, mScript)
                        + JSD_GetScriptLineExtent(mCx, mScript) - 1;
-        jsuword end = JSD_GetClosestPC(mCx, mScript, lastLine + 1);
+        uintptr_t end = JSD_GetClosestPC(mCx, mScript, lastLine + 1);
 
         *aExecutableLines = static_cast<PRUint32*>(NS_Alloc((end - start + 1) * sizeof(PRUint32)));
         if (!JSD_GetLinePCs(mCx, mScript, aStartLine, aMaxLines, aCount, aExecutableLines, NULL))
             return NS_ERROR_OUT_OF_MEMORY;
         
         return NS_OK;
     }
 
@@ -1582,17 +1582,17 @@ jsdScript::GetExecutableLines(PRUint32 a
     return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
 jsdScript::IsLineExecutable(PRUint32 aLine, PRUint32 aPcmap, bool *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     if (aPcmap == PCMAP_SOURCETEXT) {    
-        jsuword pc = JSD_GetClosestPC (mCx, mScript, aLine);
+        uintptr_t pc = JSD_GetClosestPC (mCx, mScript, aLine);
         *_rval = (aLine == JSD_GetClosestLine (mCx, mScript, pc));
     } else if (aPcmap == PCMAP_PRETTYPRINT) {
         if (!mPPLineMap && !CreatePPLineMap())
             return NS_ERROR_OUT_OF_MEMORY;
         *_rval = false;
         for (PRUint32 i = 0; i < mPCMapSize; ++i) {
             if (mPPLineMap[i].line >= aLine) {
                 *_rval = (mPPLineMap[i].line == aLine);
@@ -1605,26 +1605,26 @@ jsdScript::IsLineExecutable(PRUint32 aLi
     
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdScript::SetBreakpoint(PRUint32 aPC)
 {
     ASSERT_VALID_EPHEMERAL;
-    jsuword pc = mFirstPC + aPC;
+    uintptr_t pc = mFirstPC + aPC;
     JSD_SetExecutionHook (mCx, mScript, pc, jsds_ExecutionHookProc, NULL);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdScript::ClearBreakpoint(PRUint32 aPC)
 {
     ASSERT_VALID_EPHEMERAL;    
-    jsuword pc = mFirstPC + aPC;
+    uintptr_t pc = mFirstPC + aPC;
     JSD_ClearExecutionHook (mCx, mScript, pc);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdScript::ClearAllBreakpoints()
 {
     ASSERT_VALID_EPHEMERAL;
@@ -2004,34 +2004,34 @@ jsdStackFrame::GetScript(jsdIScript **_r
 NS_IMETHODIMP
 jsdStackFrame::GetPc(PRUint32 *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     JSDScript *script = JSD_GetScriptForStackFrame (mCx, mThreadState,
                                                     mStackFrameInfo);
     if (!script)
         return NS_ERROR_FAILURE;
-    jsuword pcbase = JSD_GetClosestPC(mCx, script, 0);
+    uintptr_t pcbase = JSD_GetClosestPC(mCx, script, 0);
     
-    jsuword pc = JSD_GetPCForStackFrame (mCx, mThreadState, mStackFrameInfo);
+    uintptr_t pc = JSD_GetPCForStackFrame (mCx, mThreadState, mStackFrameInfo);
     if (pc)
         *_rval = pc - pcbase;
     else
         *_rval = pcbase;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdStackFrame::GetLine(PRUint32 *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     JSDScript *script = JSD_GetScriptForStackFrame (mCx, mThreadState,
                                                     mStackFrameInfo);
     if (script) {
-        jsuword pc = JSD_GetPCForStackFrame (mCx, mThreadState, mStackFrameInfo);
+        uintptr_t pc = JSD_GetPCForStackFrame (mCx, mThreadState, mStackFrameInfo);
         *_rval = JSD_GetClosestLine (mCx, script, pc);
     } else {
         return NS_ERROR_FAILURE;
     }
     return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/js/jsd/jsd_xpc.h
+++ b/js/jsd/jsd_xpc.h
@@ -177,17 +177,17 @@ class jsdScript : public jsdIScript
     PRUint32    mTag;
     JSDContext *mCx;
     JSDScript  *mScript;
     nsCString  *mFileName;
     nsCString  *mFunctionName;
     PRUint32    mBaseLineNumber, mLineExtent;
     PCMapEntry *mPPLineMap;
     PRUint32    mPCMapSize;
-    jsuword     mFirstPC;
+    uintptr_t   mFirstPC;
 };
 
 PRUint32 jsdScript::LastTag = 0;
 
 class jsdContext : public jsdIContext
 {
   public:
     NS_DECL_ISUPPORTS
--- a/js/jsd/jsdebug.c
+++ b/js/jsd/jsdebug.c
@@ -335,36 +335,36 @@ JSD_SetScriptHook(JSDContext* jsdc, JSD_
 
 JSD_PUBLIC_API(JSBool)
 JSD_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_GetScriptHook(jsdc, hook, callerdata);
 }
 
-JSD_PUBLIC_API(jsuword)
+JSD_PUBLIC_API(uintptr_t)
 JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetClosestPC(jsdc, jsdscript, line);
 }
 
 JSD_PUBLIC_API(uintN)
-JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc)
+JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetClosestLine(jsdc, jsdscript, pc);
 }
 
 JSD_PUBLIC_API(JSBool)
 JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
                uintN startLine, uintN maxLines,
-               uintN* count, uintN** lines, jsuword** pcs)
+               uintN* count, uintN** lines, uintptr_t** pcs)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetLinePCs(jsdc, jsdscript, startLine, maxLines, count, lines, pcs);
 }
 
 JSD_PUBLIC_API(void)
 JSD_ScriptCreated(JSDContext* jsdc,
@@ -538,29 +538,29 @@ JSD_AddFullSourceText(JSDContext* jsdc,
 }
 
 /***************************************************************************/
 /* Execution/Interrupt Hook functions */
 
 JSD_PUBLIC_API(JSBool)
 JSD_SetExecutionHook(JSDContext*           jsdc,
                      JSDScript*            jsdscript,
-                     jsuword              pc,
+                     uintptr_t             pc,
                      JSD_ExecutionHookProc hook,
                      void*                 callerdata)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_SetExecutionHook(jsdc, jsdscript, pc, hook, callerdata);
 }
 
 JSD_PUBLIC_API(JSBool)
 JSD_ClearExecutionHook(JSDContext*           jsdc,
                        JSDScript*            jsdscript,
-                       jsuword              pc)
+                       uintptr_t             pc)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_ClearExecutionHook(jsdc, jsdscript, pc);
 }
 
 JSD_PUBLIC_API(JSBool)
 JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
@@ -718,17 +718,17 @@ JSD_PUBLIC_API(JSDScript*)
 JSD_GetScriptForStackFrame(JSDContext* jsdc,
                            JSDThreadState* jsdthreadstate,
                            JSDStackFrameInfo* jsdframe)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_GetScriptForStackFrame(jsdc, jsdthreadstate, jsdframe);
 }
 
-JSD_PUBLIC_API(jsuword)
+JSD_PUBLIC_API(uintptr_t)
 JSD_GetPCForStackFrame(JSDContext* jsdc,
                        JSDThreadState* jsdthreadstate,
                        JSDStackFrameInfo* jsdframe)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_GetPCForStackFrame(jsdc, jsdthreadstate, jsdframe);
 }
 
--- a/js/jsd/jsdebug.h
+++ b/js/jsd/jsdebug.h
@@ -480,37 +480,37 @@ JSD_GetScriptHook(JSDContext* jsdc, JSD_
 * Get a 'Program Counter' value for a given line. This represents the location
 * of the first bit of executable code for this line of source. This 'pc' should 
 * be considered an opaque handle.
 * 0 is returned for invalid scripts, or lines that lie outside the script.
 * If no code is on the given line, then the returned pc represents the first
 * code within the script (if any) after the given line.
 * This function can be used to set breakpoints -- see JSD_SetExecutionHook
 */
-extern JSD_PUBLIC_API(jsuword)
+extern JSD_PUBLIC_API(uintptr_t)
 JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line);
 
 /*
 * Get the source line number for a given 'Program Counter' location.
 * Returns 0 if no source line information is appropriate (or available) for
 * the given pc.
 */
 extern JSD_PUBLIC_API(uintN)
-JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc);
+JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc);
 
 /*
  * Get a list of lines and the corresponding earliest PC for each (see
  * JSD_GetClosestPC). Lines with no PCs associated will not be returned. NULL
  * may be passed for either lines or pcs to avoid filling anything in for that
  * argument.
  */
 extern JSD_PUBLIC_API(JSBool)
 JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript,
                uintN startLine, uintN maxLines,
-               uintN* count, uintN** lines, jsuword** pcs);
+               uintN* count, uintN** lines, uintptr_t** pcs);
 
 /* these are only used in cases where scripts are created outside of JS*/
 
 /*
 * Direct call to notify JSD that a script has been created.
 * Embeddings that use the normal jsapi script functions need not call this.
 * Any embedding that follows the (discouraged!) practice of contructing script
 * structures manually should call this function to inform JSD. (older ssjs
@@ -775,27 +775,27 @@ typedef JSBool
 
 /*
 * Set Hook to be called whenever the given pc is about to be executed --
 * i.e. for 'trap' or 'breakpoint'
 */
 extern JSD_PUBLIC_API(JSBool)
 JSD_SetExecutionHook(JSDContext*           jsdc,
                      JSDScript*            jsdscript,
-                     jsuword               pc,
+                     uintptr_t             pc,
                      JSD_ExecutionHookProc hook,
                      void*                 callerdata);
 
 /*
 * Clear the hook for this pc
 */
 extern JSD_PUBLIC_API(JSBool)
 JSD_ClearExecutionHook(JSDContext*          jsdc,
                        JSDScript*           jsdscript,
-                       jsuword              pc);
+                       uintptr_t            pc);
 
 /*
 * Clear all the pc specific hooks for this script
 */
 extern JSD_PUBLIC_API(JSBool)
 JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript);
 
 /*
@@ -934,17 +934,17 @@ JSD_GetCallingStackFrame(JSDContext* jsd
 extern JSD_PUBLIC_API(JSDScript*)
 JSD_GetScriptForStackFrame(JSDContext* jsdc,
                            JSDThreadState* jsdthreadstate,
                            JSDStackFrameInfo* jsdframe);
 
 /*
 * Get the 'Program Counter' for the given call stack frame
 */
-extern JSD_PUBLIC_API(jsuword)
+extern JSD_PUBLIC_API(uintptr_t)
 JSD_GetPCForStackFrame(JSDContext* jsdc,
                        JSDThreadState* jsdthreadstate,
                        JSDStackFrameInfo* jsdframe);
 
 /*
 * Get the JavaScript Call Object for the given call stack frame.
 * *** new for version 1.1 ****
 */
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -327,17 +327,17 @@ struct ClosureInfo
                          // been GCed.
   JSObject* closureObj;  // CClosure object
   JSObject* typeObj;     // FunctionType describing the C function
   JSObject* thisObj;     // 'this' object to use for the JS function call
   JSObject* jsfnObj;     // JS function
   void* errResult;       // Result that will be returned if the closure throws
   ffi_closure* closure;  // The C closure itself
 #ifdef DEBUG
-  jsword cxThread;       // The thread on which the context may be used
+  intptr_t cxThread;     // The thread on which the context may be used
 #endif
 
   // Anything conditionally freed in the destructor should be initialized to
   // NULL here.
   ClosureInfo(JSRuntime* runtime)
     : rt(runtime)
     , errResult(NULL)
     , closure(NULL)
--- a/js/src/jsapi-tests/testIntTypesABI.cpp
+++ b/js/src/jsapi-tests/testIntTypesABI.cpp
@@ -53,14 +53,19 @@ typedef ConflictingType JSUint16;
 typedef ConflictingType JSUint32;
 typedef ConflictingType JSUint64;
 
 typedef ConflictingType JSInt8;
 typedef ConflictingType JSInt16;
 typedef ConflictingType JSInt32;
 typedef ConflictingType JSInt64;
 
+typedef ConflictingType jsword;
+typedef ConflictingType jsuword;
+typedef ConflictingType JSWord;
+typedef ConflictingType JSUword;
+
 BEGIN_TEST(testIntTypesABI)
 {
     /* This passes if the typedefs didn't conflict at compile time. */
     return true;
 }
 END_TEST(testIntTypesABI)
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2996,45 +2996,45 @@ extern JS_PUBLIC_API(void *)
 JS_GetExternalStringClosure(JSContext *cx, JSString *str)
 {
     AssertNoGCOrFlatString(cx, str);
     CHECK_REQUEST(cx);
     return str->asExternal().externalClosure();
 }
 
 JS_PUBLIC_API(void)
-JS_SetThreadStackLimit(JSContext *cx, jsuword limitAddr)
+JS_SetThreadStackLimit(JSContext *cx, uintptr_t limitAddr)
 {
 #if JS_STACK_GROWTH_DIRECTION > 0
     if (limitAddr == 0)
-        limitAddr = jsuword(-1);
+        limitAddr = UINTPTR_MAX;
 #endif
     cx->stackLimit = limitAddr;
 }
 
 JS_PUBLIC_API(void)
 JS_SetNativeStackQuota(JSContext *cx, size_t stackSize)
 {
 #ifdef JS_THREADSAFE
     JS_ASSERT(cx->thread());
 #endif
 
 #if JS_STACK_GROWTH_DIRECTION > 0
     if (stackSize == 0) {
-        cx->stackLimit = jsuword(-1);
+        cx->stackLimit = UINTPTR_MAX;
     } else {
-        jsuword stackBase = reinterpret_cast<jsuword>(JS_THREAD_DATA(cx)->nativeStackBase);
+        uintptr_t stackBase = reinterpret_cast<uintptr_t>(JS_THREAD_DATA(cx)->nativeStackBase);
         JS_ASSERT(stackBase <= size_t(-1) - stackSize);
         cx->stackLimit = stackBase + stackSize - 1;
     }
 #else
     if (stackSize == 0) {
         cx->stackLimit = 0;
     } else {
-        jsuword stackBase = reinterpret_cast<jsuword>(JS_THREAD_DATA(cx)->nativeStackBase);
+        uintptr_t stackBase = reinterpret_cast<uintptr_t>(JS_THREAD_DATA(cx)->nativeStackBase);
         JS_ASSERT(stackBase >= stackSize);
         cx->stackLimit = stackBase - (stackSize - 1);
     }
 #endif
 }
 
 /************************************************************************/
 
@@ -6574,41 +6574,41 @@ JS_ThrowStopIteration(JSContext *cx)
     AssertNoGC(cx);
     return js_ThrowStopIteration(cx);
 }
 
 /*
  * Get the owning thread id of a context. Returns 0 if the context is not
  * owned by any thread.
  */
-JS_PUBLIC_API(jsword)
+JS_PUBLIC_API(intptr_t)
 JS_GetContextThread(JSContext *cx)
 {
 #ifdef JS_THREADSAFE
-    return reinterpret_cast<jsword>(JS_THREAD_ID(cx));
+    return reinterpret_cast<intptr_t>(JS_THREAD_ID(cx));
 #else
     return 0;
 #endif
 }
 
 /*
  * Set the current thread as the owning thread of a context. Returns the
  * old owning thread id, or -1 if the operation failed.
  */
-JS_PUBLIC_API(jsword)
+JS_PUBLIC_API(intptr_t)
 JS_SetContextThread(JSContext *cx)
 {
     /* This function can be called by a finalizer. */
     JS_AbortIfWrongThread(cx->runtime);
 
 #ifdef JS_THREADSAFE
     JS_ASSERT(!cx->outstandingRequests);
     if (cx->thread()) {
         JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread()));
-        return reinterpret_cast<jsword>(cx->thread()->id);
+        return reinterpret_cast<intptr_t>(cx->thread()->id);
     }
 
     if (!js_InitContextThreadAndLockGC(cx)) {
         js_ReportOutOfMemory(cx);
         return -1;
     }
 
     JS_UNLOCK_GC(cx->runtime);
@@ -6638,17 +6638,17 @@ extern JS_NEVER_INLINE JS_PUBLIC_API(voi
 JS_AbortIfWrongThread(JSRuntime *rt)
 {
 #ifdef JS_THREADSAFE
     if (!rt->onOwnerThread())
         JS_Assert("rt->onOwnerThread()", __FILE__, __LINE__);
 #endif
 }
 
-JS_PUBLIC_API(jsword)
+JS_PUBLIC_API(intptr_t)
 JS_ClearContextThread(JSContext *cx)
 {
     JS_AbortIfWrongThread(cx->runtime);
     AssertNoGC(cx);
 
 #ifdef JS_THREADSAFE
     /*
      * cx must have exited all requests it entered and, if cx is associated
@@ -6670,17 +6670,17 @@ JS_ClearContextThread(JSContext *cx)
     js_WaitForGC(rt);
     js_ClearContextThread(cx);
     JS_ASSERT_IF(JS_CLIST_IS_EMPTY(&t->contextList), !t->data.requestDepth);
 
     /*
      * We can access t->id as long as the GC lock is held and we cannot race
      * with the GC that may delete t.
      */
-    return reinterpret_cast<jsword>(t->id);
+    return reinterpret_cast<intptr_t>(t->id);
 #else
     return 0;
 #endif
 }
 
 #ifdef JS_GC_ZEAL
 JS_PUBLIC_API(void)
 JS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency, JSBool compartment)
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -210,29 +210,29 @@ inline Anchor<T>::~Anchor()
  *
  * If the moving GC hazard analysis is in use and detects a non-rooted stack
  * pointer to a GC thing, one byte of that pointer is poisoned to refer to an
  * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the
  * pointer is overwritten, to reduce the likelihood of accidentally changing
  * a live integer value.
  */
 
-inline void PoisonPtr(jsuword *v)
+inline void PoisonPtr(uintptr_t *v)
 {
 #if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
     uint8_t *ptr = (uint8_t *) v + 3;
     *ptr = JS_FREE_PATTERN;
 #endif
 }
 
 template <typename T>
 inline bool IsPoisonedPtr(T *v)
 {
 #if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
-    uint32_t mask = jsuword(v) & 0xff000000;
+    uint32_t mask = uintptr_t(v) & 0xff000000;
     return mask == uint32_t(JS_FREE_PATTERN << 24);
 #else
     return false;
 #endif
 }
 
 /*
  * JS::Value is the C++ interface for a single JavaScript Engine value.
@@ -3081,17 +3081,17 @@ JS_IsExternalString(JSContext *cx, JSStr
  */
 extern JS_PUBLIC_API(void *)
 JS_GetExternalStringClosure(JSContext *cx, JSString *str);
 
 /*
  * Deprecated. Use JS_SetNativeStackQuoata instead.
  */
 extern JS_PUBLIC_API(void)
-JS_SetThreadStackLimit(JSContext *cx, jsuword limitAddr);
+JS_SetThreadStackLimit(JSContext *cx, uintptr_t limitAddr);
 
 /*
  * Set the size of the native stack that should not be exceed. To disable
  * stack size checking pass 0.
  */
 extern JS_PUBLIC_API(void)
 JS_SetNativeStackQuota(JSContext *cx, size_t stackSize);
 
@@ -4927,23 +4927,23 @@ JS_ThrowStopIteration(JSContext *cx);
  * Associate the current thread with the given context.  This is done
  * implicitly by JS_NewContext.
  *
  * Returns the old thread id for this context, which should be treated as
  * an opaque value.  This value is provided for comparison to 0, which
  * indicates that ClearContextThread has been called on this context
  * since the last SetContextThread, or non-0, which indicates the opposite.
  */
-extern JS_PUBLIC_API(jsword)
+extern JS_PUBLIC_API(intptr_t)
 JS_GetContextThread(JSContext *cx);
 
-extern JS_PUBLIC_API(jsword)
+extern JS_PUBLIC_API(intptr_t)
 JS_SetContextThread(JSContext *cx);
 
-extern JS_PUBLIC_API(jsword)
+extern JS_PUBLIC_API(intptr_t)
 JS_ClearContextThread(JSContext *cx);
 
 /*
  * A JS runtime always has an "owner thread". The owner thread is set when the
  * runtime is created (to the current thread) and practically all entry points
  * into the JS engine check that a runtime (or anything contained in the
  * runtime: context, compartment, object, etc) is only touched by its owner
  * thread. Embeddings may check this invariant outside the JS engine by calling
--- a/js/src/jsatom.h
+++ b/js/src/jsatom.h
@@ -150,18 +150,18 @@ struct DefaultHasher<jsid>
     }
 };
 
 }
 
 #if JS_BYTES_PER_WORD == 4
 # define ATOM_HASH(atom)          ((JSHashNumber)(atom) >> 2)
 #elif JS_BYTES_PER_WORD == 8
-# define ATOM_HASH(atom)          (((JSHashNumber)(jsuword)(atom) >> 3) ^     \
-                                   (JSHashNumber)((jsuword)(atom) >> 32))
+# define ATOM_HASH(atom)          (((JSHashNumber)(uintptr_t)(atom) >> 3) ^   \
+                                   (JSHashNumber)((uintptr_t)(atom) >> 32))
 #else
 # error "Unsupported configuration"
 #endif
 
 /*
  * Return a printable, lossless char[] representation of a string-type atom.
  * The lifetime of the result matches the lifetime of bytes.
  */
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -1387,17 +1387,17 @@ JSContext::JSContext(JSRuntime *rt)
     throwing(false),
     exception(UndefinedValue()),
     runOptions(0),
     reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
     localeCallbacks(NULL),
     resolvingList(NULL),
     generatingError(false),
 #if JS_STACK_GROWTH_DIRECTION > 0
-    stackLimit((jsuword)-1),
+    stackLimit(UINTPTR_MAX),
 #else
     stackLimit(0),
 #endif
     runtime(rt),
     compartment(NULL),
 #ifdef JS_THREADSAFE
     thread_(NULL),
 #endif
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -193,17 +193,17 @@ struct ThreadData {
 
     /* Property cache for faster call/get/set invocation. */
     PropertyCache       propertyCache;
 
     /* State used by jsdtoa.cpp. */
     DtoaState           *dtoaState;
 
     /* Base address of the native stack for the current thread. */
-    jsuword             *nativeStackBase;
+    uintptr_t           *nativeStackBase;
 
     /* List of currently pending operations on proxies. */
     PendingProxyOperation *pendingProxyOperation;
 
     ConservativeGCThreadData conservativeGC;
 
 #ifdef DEBUG
     size_t              noGCOrAllocationCheck;
@@ -428,18 +428,18 @@ struct JSRuntime
     volatile uint32_t   gcNumArenasFreeCommitted;
     uint32_t            gcNumber;
     js::GCMarker        *gcIncrementalTracer;
     void                *gcVerifyData;
     bool                gcChunkAllocationSinceLastGC;
     int64_t             gcNextFullGCTime;
     int64_t             gcJitReleaseTime;
     JSGCMode            gcMode;
-    volatile jsuword    gcBarrierFailed;
-    volatile jsuword    gcIsNeeded;
+    volatile uintptr_t  gcBarrierFailed;
+    volatile uintptr_t  gcIsNeeded;
     js::WeakMapBase     *gcWeakMapList;
     js::gcstats::Statistics gcStats;
 
     /* The reason that an interrupt-triggered GC should be called. */
     js::gcstats::Reason gcTriggerReason;
 
     /* Pre-allocated space for the GC mark stack. */
     uintptr_t           gcMarkStackArray[js::MARK_STACK_LENGTH];
@@ -932,17 +932,17 @@ struct JSContext
 
     /*
      * True if generating an error, to prevent runaway recursion.
      * NB: generatingError packs with throwing below.
      */
     JSPackedBool        generatingError;
 
     /* Limit pointer for checking native stack consumption during recursion. */
-    jsuword             stackLimit;
+    uintptr_t           stackLimit;
 
     /* Data shared by threads in an address space. */
     JSRuntime *const    runtime;
 
     /* GC heap compartment. */
     JSCompartment       *compartment;
 
     inline void setCompartment(JSCompartment *compartment);
--- a/js/src/jscompat.h
+++ b/js/src/jscompat.h
@@ -43,11 +43,9 @@
  * Compatibility glue for various NSPR versions.  We must always define int8,
  * int16, jsword, and so on to minimize differences with js/ref, no matter what
  * the NSPR typedef names may be.
  */
 #include "jstypes.h"
 
 typedef JSIntn intN;
 typedef JSUintn uintN;
-typedef JSUword jsuword;
-typedef JSWord jsword;
 #endif /* jscompat_h___ */
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -427,38 +427,38 @@ JS_GetFunctionArgumentCount(JSContext *c
 }
 
 JS_PUBLIC_API(JSBool)
 JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun)
 {
     return fun->script()->bindings.hasLocalNames();
 }
 
-extern JS_PUBLIC_API(jsuword *)
+extern JS_PUBLIC_API(uintptr_t *)
 JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp)
 {
     Vector<JSAtom *> localNames(cx);
     if (!fun->script()->bindings.getLocalNameArray(cx, &localNames))
         return NULL;
 
     /* Munge data into the API this method implements.  Avert your eyes! */
     *markp = cx->tempLifoAlloc().mark();
 
-    jsuword *names = cx->tempLifoAlloc().newArray<jsuword>(localNames.length());
+    uintptr_t *names = cx->tempLifoAlloc().newArray<uintptr_t>(localNames.length());
     if (!names) {
         js_ReportOutOfMemory(cx);
         return NULL;
     }
 
-    memcpy(names, localNames.begin(), localNames.length() * sizeof(jsuword));
+    memcpy(names, localNames.begin(), localNames.length() * sizeof(uintptr_t));
     return names;
 }
 
 extern JS_PUBLIC_API(JSAtom *)
-JS_LocalNameToAtom(jsuword w)
+JS_LocalNameToAtom(uintptr_t w)
 {
     return JS_LOCAL_NAME_TO_ATOM(w);
 }
 
 extern JS_PUBLIC_API(JSString *)
 JS_AtomKey(JSAtom *atom)
 {
     return atom;
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -201,21 +201,21 @@ JS_GetFunctionArgumentCount(JSContext *c
 extern JS_PUBLIC_API(JSBool)
 JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
 
 /*
  * N.B. The mark is in the context temp pool and thus the caller must take care
  * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other
  * call that may use the temp pool.
  */
-extern JS_PUBLIC_API(jsuword *)
+extern JS_PUBLIC_API(uintptr_t *)
 JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);
 
 extern JS_PUBLIC_API(JSAtom *)
-JS_LocalNameToAtom(jsuword w);
+JS_LocalNameToAtom(uintptr_t w);
 
 extern JS_PUBLIC_API(JSString *)
 JS_AtomKey(JSAtom *atom);
 
 extern JS_PUBLIC_API(void)
 JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);
 
 extern JS_PUBLIC_API(JSScript *)
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -257,17 +257,17 @@ struct Shape {
 struct Object {
     Shape       *shape;
     TypeObject  *type;
     js::Value   *slots;
     js::Value   *_1;
 
     size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }
     Value *fixedSlots() const {
-        return (Value *)((jsuword) this + sizeof(shadow::Object));
+        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));
     }
 
     js::Value &slotRef(size_t slot) const {
         size_t nfixed = numFixedSlots();
         if (slot < nfixed)
             return fixedSlots()[slot];
         return slots[slot - nfixed];
     }
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -145,18 +145,18 @@ struct JSFunction : public JSObject
     void setArgCount(uint16_t nargs) {
         JS_ASSERT(this->nargs == 0);
         this->nargs = nargs;
     }
 
     /* uint16_t representation bounds number of call object dynamic slots. */
     enum { MAX_ARGS_AND_VARS = 2 * ((1U << 16) - 1) };
 
-#define JS_LOCAL_NAME_TO_ATOM(nameWord)  ((JSAtom *) ((nameWord) & ~(jsuword) 1))
-#define JS_LOCAL_NAME_IS_CONST(nameWord) ((((nameWord) & (jsuword) 1)) != 0)
+#define JS_LOCAL_NAME_TO_ATOM(nameWord)  ((JSAtom *) ((nameWord) & ~uintptr_t(1)))
+#define JS_LOCAL_NAME_IS_CONST(nameWord) ((((nameWord) & uintptr_t(1))) != 0)
 
     bool mightEscape() const {
         return isInterpreted() && (isFlatClosure() || !script()->bindings.hasUpvars());
     }
 
     bool joinable() const {
         return flags & JSFUN_JOINABLE;
     }
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -936,17 +936,17 @@ InFreeList(ArenaHeader *aheader, uintptr
     }
 }
 
 /*
  * Tests whether w is a (possibly dead) GC thing. Returns CGCT_VALID and
  * details about the thing if so. On failure, returns the reason for rejection.
  */
 inline ConservativeGCTest
-IsAddressableGCThing(JSRuntime *rt, jsuword w,
+IsAddressableGCThing(JSRuntime *rt, uintptr_t w,
                      gc::AllocKind *thingKindPtr, ArenaHeader **arenaHeader, void **thing)
 {
     /*
      * We assume that the compiler never uses sub-word alignment to store
      * pointers and does not tag pointers on its own. Additionally, the value
      * representation for all values and the jsid representation for GC-things
      * do not touch the low two bits. Thus any word with the low two bits set
      * is not a valid GC-thing.
@@ -954,21 +954,21 @@ IsAddressableGCThing(JSRuntime *rt, jsuw
     JS_STATIC_ASSERT(JSID_TYPE_STRING == 0 && JSID_TYPE_OBJECT == 4);
     if (w & 0x3)
         return CGCT_LOWBITSET;
 
     /*
      * An object jsid has its low bits tagged. In the value representation on
      * 64-bit, the high bits are tagged.
      */
-    const jsuword JSID_PAYLOAD_MASK = ~jsuword(JSID_TYPE_MASK);
+    const uintptr_t JSID_PAYLOAD_MASK = ~uintptr_t(JSID_TYPE_MASK);
 #if JS_BITS_PER_WORD == 32
-    jsuword addr = w & JSID_PAYLOAD_MASK;
+    uintptr_t addr = w & JSID_PAYLOAD_MASK;
 #elif JS_BITS_PER_WORD == 64
-    jsuword addr = w & JSID_PAYLOAD_MASK & JSVAL_PAYLOAD_MASK;
+    uintptr_t addr = w & JSID_PAYLOAD_MASK & JSVAL_PAYLOAD_MASK;
 #endif
 
     Chunk *chunk = Chunk::fromAddress(addr);
 
     if (!rt->gcChunkSet.has(chunk))
         return CGCT_NOTCHUNK;
 
     /*
@@ -1012,17 +1012,17 @@ IsAddressableGCThing(JSRuntime *rt, jsuw
     return CGCT_VALID;
 }
 
 /*
  * Returns CGCT_VALID and mark it if the w can be a  live GC thing and sets
  * thingKind accordingly. Otherwise returns the reason for rejection.
  */
 inline ConservativeGCTest
-MarkIfGCThingWord(JSTracer *trc, jsuword w)
+MarkIfGCThingWord(JSTracer *trc, uintptr_t w)
 {
     void *thing;
     ArenaHeader *aheader;
     AllocKind thingKind;
     ConservativeGCTest status = IsAddressableGCThing(trc->runtime, w, &thingKind, &aheader, &thing);
     if (status != CGCT_VALID)
         return status;
 
@@ -1042,54 +1042,54 @@ MarkIfGCThingWord(JSTracer *trc, jsuword
 #endif
     MarkKind(trc, thing, MapAllocToTraceKind(thingKind));
 
 #ifdef JS_DUMP_CONSERVATIVE_GC_ROOTS
     if (IS_GC_MARKING_TRACER(trc)) {
         GCMarker *marker = static_cast<GCMarker *>(trc);
         if (marker->conservativeDumpFileName)
             marker->conservativeRoots.append(thing);
-        if (jsuword(thing) != w)
+        if (uintptr_t(thing) != w)
             marker->conservativeStats.unaligned++;
     }
 #endif
 
     return CGCT_VALID;
 }
 
 static void
-MarkWordConservatively(JSTracer *trc, jsuword w)
+MarkWordConservatively(JSTracer *trc, uintptr_t w)
 {
     /*
      * The conservative scanner may access words that valgrind considers as
      * undefined. To avoid false positives and not to alter valgrind view of
      * the memory we make as memcheck-defined the argument, a copy of the
      * original word. See bug 572678.
      */
 #ifdef JS_VALGRIND
     JS_SILENCE_UNUSED_VALUE_IN_EXPR(VALGRIND_MAKE_MEM_DEFINED(&w, sizeof(w)));
 #endif
 
     MarkIfGCThingWord(trc, w);
 }
 
 static void
-MarkRangeConservatively(JSTracer *trc, const jsuword *begin, const jsuword *end)
+MarkRangeConservatively(JSTracer *trc, const uintptr_t *begin, const uintptr_t *end)
 {
     JS_ASSERT(begin <= end);
-    for (const jsuword *i = begin; i != end; ++i)
+    for (const uintptr_t *i = begin; i < end; ++i)
         MarkWordConservatively(trc, *i);
 }
 
 static void
 MarkThreadDataConservatively(JSTracer *trc, ThreadData *td)
 {
     ConservativeGCThreadData *ctd = &td->conservativeGC;
     JS_ASSERT(ctd->hasStackToScan());
-    jsuword *stackMin, *stackEnd;
+    uintptr_t *stackMin, *stackEnd;
 #if JS_STACK_GROWTH_DIRECTION > 0
     stackMin = td->nativeStackBase;
     stackEnd = ctd->nativeStackTop;
 #else
     stackMin = ctd->nativeStackTop + 1;
     stackEnd = td->nativeStackBase;
 #endif
     JS_ASSERT(stackMin <= stackEnd);
@@ -1114,25 +1114,25 @@ MarkStackRangeConservatively(JSTracer *t
 
         AutoSkipChecking(JSRuntime *rt)
           : runtime(rt), savedCompartment(rt->gcCheckCompartment) {
             rt->gcCheckCompartment = NULL;
         }
         ~AutoSkipChecking() { runtime->gcCheckCompartment = savedCompartment; }
     } as(trc->runtime);
 
-    const jsuword *begin = beginv->payloadWord();
-    const jsuword *end = endv->payloadWord();
+    const uintptr_t *begin = beginv->payloadWord();
+    const uintptr_t *end = endv->payloadWord();
 #ifdef JS_NUNBOX32
     /*
      * With 64-bit jsvals on 32-bit systems, we can optimize a bit by
      * scanning only the payloads.
      */
     JS_ASSERT(begin <= end);
-    for (const jsuword *i = begin; i != end; i += sizeof(Value)/sizeof(jsuword))
+    for (const uintptr_t *i = begin; i < end; i += sizeof(Value) / sizeof(uintptr_t))
         MarkWordConservatively(trc, *i);
 #else
     MarkRangeConservatively(trc, begin, end);
 #endif
 }
 
 void
 MarkConservativeStackRoots(JSTracer *trc)
@@ -1153,17 +1153,17 @@ MarkConservativeStackRoots(JSTracer *trc
     MarkThreadDataConservatively(trc, &trc->runtime->threadData);
 #endif
 }
 
 JS_NEVER_INLINE void
 ConservativeGCThreadData::recordStackTop()
 {
     /* Update the native stack pointer if it points to a bigger stack. */
-    jsuword dummy;
+    uintptr_t dummy;
     nativeStackTop = &dummy;
 
     /*
      * To record and update the register snapshot for the conservative
      * scanning with the latest values we use setjmp.
      */
 #if defined(_MSC_VER)
 # pragma warning(push)
@@ -1187,17 +1187,17 @@ RecordNativeStackTopForGC(JSContext *cx)
         return;
 #endif
     ctd->recordStackTop();
 }
 
 } /* namespace js */
 
 bool
-js_IsAddressableGCThing(JSRuntime *rt, jsuword w, gc::AllocKind *thingKind, void **thing)
+js_IsAddressableGCThing(JSRuntime *rt, uintptr_t w, gc::AllocKind *thingKind, void **thing)
 {
     return js::IsAddressableGCThing(rt, w, thingKind, NULL, thing) == CGCT_VALID;
 }
 
 #ifdef DEBUG
 static void
 CheckLeakedRoots(JSRuntime *rt);
 #endif
@@ -1881,17 +1881,17 @@ gc_root_traversal(JSTracer *trc, const R
     if (ptr && !trc->runtime->gcCurrentCompartment) {
         /*
          * Use conservative machinery to find if ptr is a valid GC thing.
          * We only do this during global GCs, to preserve the invariant
          * that mark callbacks are not in place during compartment GCs.
          */
         JSTracer checker;
         JS_TRACER_INIT(&checker, trc->context, EmptyMarkCallback);
-        ConservativeGCTest test = MarkIfGCThingWord(&checker, reinterpret_cast<jsuword>(ptr));
+        ConservativeGCTest test = MarkIfGCThingWord(&checker, reinterpret_cast<uintptr_t>(ptr));
         if (test != CGCT_VALID && entry.value.name) {
             fprintf(stderr,
 "JS API usage error: the address passed to JS_AddNamedRoot currently holds an\n"
 "invalid gcthing.  This is usually caused by a missing call to JS_RemoveRoot.\n"
 "The root's name is \"%s\".\n",
                     entry.value.name);
         }
         JS_ASSERT(test == CGCT_VALID);
@@ -3436,17 +3436,17 @@ RunDebugGC(JSContext *cx)
 
     RunLastDitchGC(cx);
 #endif
 }
 
 #if defined(DEBUG) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
 
 static void
-CheckStackRoot(JSTracer *trc, jsuword *w)
+CheckStackRoot(JSTracer *trc, uintptr_t *w)
 {
     /* Mark memory as defined for valgrind, as in MarkWordConservatively. */
 #ifdef JS_VALGRIND
     VALGRIND_MAKE_MEM_DEFINED(&w, sizeof(w));
 #endif
 
     ConservativeGCTest test = MarkIfGCThingWord(trc, *w, DONT_MARK_THING);
 
@@ -3478,20 +3478,20 @@ CheckStackRoot(JSTracer *trc, jsuword *w
              * case we want to avoid damaging the smaller value.
              */
             PoisonPtr(w);
         }
     }
 }
 
 static void
-CheckStackRootsRange(JSTracer *trc, jsuword *begin, jsuword *end)
+CheckStackRootsRange(JSTracer *trc, uintptr_t *begin, uintptr_t *end)
 {
     JS_ASSERT(begin <= end);
-    for (jsuword *i = begin; i != end; ++i)
+    for (uintptr_t *i = begin; i != end; ++i)
         CheckStackRoot(trc, i);
 }
 
 void
 CheckStackRoots(JSContext *cx)
 {
     AutoCopyFreeListToArenas copy(cx->runtime);
 
@@ -3499,17 +3499,17 @@ CheckStackRoots(JSContext *cx)
     JS_TRACER_INIT(&checker, cx, EmptyMarkCallback);
 
     ThreadData *td = JS_THREAD_DATA(cx);
 
     ConservativeGCThreadData *ctd = &td->conservativeGC;
     ctd->recordStackTop();
 
     JS_ASSERT(ctd->hasStackToScan());
-    jsuword *stackMin, *stackEnd;
+    uintptr_t *stackMin, *stackEnd;
 #if JS_STACK_GROWTH_DIRECTION > 0
     stackMin = td->nativeStackBase;
     stackEnd = ctd->nativeStackTop;
 #else
     stackMin = ctd->nativeStackTop + 1;
     stackEnd = td->nativeStackBase;
 #endif
 
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -66,19 +66,19 @@
 #include "js/TemplateLib.h"
 
 struct JSCompartment;
 
 extern "C" void
 js_TraceXML(JSTracer *trc, JSXML* thing);
 
 #if JS_STACK_GROWTH_DIRECTION > 0
-# define JS_CHECK_STACK_SIZE(limit, lval)  ((jsuword)(lval) < limit)
+# define JS_CHECK_STACK_SIZE(limit, lval)  ((uintptr_t)(lval) < limit)
 #else
-# define JS_CHECK_STACK_SIZE(limit, lval)  ((jsuword)(lval) > limit)
+# define JS_CHECK_STACK_SIZE(limit, lval)  ((uintptr_t)(lval) > limit)
 #endif
 
 namespace js {
 
 class GCHelperThread;
 struct Shape;
 
 namespace gc {
@@ -1365,17 +1365,17 @@ IsAboutToBeFinalized(JSContext *cx, cons
 
 extern JS_FRIEND_API(bool)
 js_GCThingIsMarked(void *thing, uintN color);
 
 extern void
 js_TraceStackFrame(JSTracer *trc, js::StackFrame *fp);
 
 extern bool
-js_IsAddressableGCThing(JSRuntime *rt, jsuword w, js::gc::AllocKind *thingKind, void **thing);
+js_IsAddressableGCThing(JSRuntime *rt, uintptr_t w, js::gc::AllocKind *thingKind, void **thing);
 
 namespace js {
 
 extern void
 MarkRuntime(JSTracer *trc);
 
 extern void
 TraceRuntime(JSTracer *trc);
@@ -1571,40 +1571,40 @@ class GCHelperThread {
 struct GCChunkHasher {
     typedef gc::Chunk *Lookup;
 
     /*
      * Strip zeros for better distribution after multiplying by the golden
      * ratio.
      */
     static HashNumber hash(gc::Chunk *chunk) {
-        JS_ASSERT(!(jsuword(chunk) & gc::ChunkMask));
-        return HashNumber(jsuword(chunk) >> gc::ChunkShift);
+        JS_ASSERT(!(uintptr_t(chunk) & gc::ChunkMask));
+        return HashNumber(uintptr_t(chunk) >> gc::ChunkShift);
     }
 
     static bool match(gc::Chunk *k, gc::Chunk *l) {
-        JS_ASSERT(!(jsuword(k) & gc::ChunkMask));
-        JS_ASSERT(!(jsuword(l) & gc::ChunkMask));
+        JS_ASSERT(!(uintptr_t(k) & gc::ChunkMask));
+        JS_ASSERT(!(uintptr_t(l) & gc::ChunkMask));
         return k == l;
     }
 };
 
 typedef HashSet<js::gc::Chunk *, GCChunkHasher, SystemAllocPolicy> GCChunkSet;
 
 struct ConservativeGCThreadData {
 
     /*
      * The GC scans conservatively between ThreadData::nativeStackBase and
      * nativeStackTop unless the latter is NULL.
      */
-    jsuword             *nativeStackTop;
+    uintptr_t           *nativeStackTop;
 
     union {
         jmp_buf         jmpbuf;
-        jsuword         words[JS_HOWMANY(sizeof(jmp_buf), sizeof(jsuword))];
+        uintptr_t       words[JS_HOWMANY(sizeof(jmp_buf), sizeof(uintptr_t))];
     } registerSnapshot;
 
     /*
      * Cycle collector uses this to communicate that the native stack of the
      * GC thread should be scanned only if the thread have more than the given
      * threshold of requests.
      */
     unsigned requestThreshold;
--- a/js/src/jsgcchunk.cpp
+++ b/js/src/jsgcchunk.cpp
@@ -98,17 +98,17 @@ UnmapPages(void *addr, size_t size)
     /* if DosFreeMem() failed, 'addr' is probably part of an "expensive"
      * allocation, so calculate the base address and try again
      */
     unsigned long cb = 2 * size;
     unsigned long flags;
     if (DosQueryMem(addr, &cb, &flags) || cb < size)
         return;
 
-    jsuword base = reinterpret_cast<jsuword>(addr) - ((2 * size) - cb);
+    uintptr_t base = reinterpret_cast<uintptr_t>(addr) - ((2 * size) - cb);
     DosFreeMem(reinterpret_cast<void*>(base));
 
     return;
 }
 
 static void *
 MapAlignedPagesRecursively(size_t size, size_t alignment, int& recursions)
 {
@@ -116,17 +116,17 @@ MapAlignedPagesRecursively(size_t size, 
         return NULL;
 
     void *tmp;
     if (DosAllocMem(&tmp, size,
                     OBJ_ANY | PAG_COMMIT | PAG_READ | PAG_WRITE)) {
         JS_ALWAYS_TRUE(DosAllocMem(&tmp, size,
                                    PAG_COMMIT | PAG_READ | PAG_WRITE) == 0);
     }
-    size_t offset = reinterpret_cast<jsuword>(tmp) & (alignment - 1);
+    size_t offset = reinterpret_cast<uintptr_t>(tmp) & (alignment - 1);
     if (!offset)
         return tmp;
 
     /* if there are 'filler' bytes of free space above 'tmp', free 'tmp',
      * then reallocate it as a 'filler'-sized block;  assuming we're not
      * in a race with another thread, the next recursion should succeed
      */
     size_t filler = size + alignment - offset;
@@ -167,17 +167,17 @@ MapAlignedPages(size_t size, size_t alig
      * as requested and return an aligned address within this block
      */
     if (DosAllocMem(&p, 2 * size,
                     OBJ_ANY | PAG_COMMIT | PAG_READ | PAG_WRITE)) {
         JS_ALWAYS_TRUE(DosAllocMem(&p, 2 * size,
                                    PAG_COMMIT | PAG_READ | PAG_WRITE) == 0);
     }
 
-    jsuword addr = reinterpret_cast<jsuword>(p);
+    uintptr_t addr = reinterpret_cast<uintptr_t>(p);
     addr = (addr + (alignment - 1)) & ~(alignment - 1);
 
     return reinterpret_cast<void *>(addr);
 }
 
 #elif defined(XP_MACOSX) || defined(DARWIN)
 
 static void *
@@ -272,17 +272,17 @@ UnmapPages(void *addr, size_t size)
 #endif
 
 namespace js {
 namespace gc {
 
 static inline void *
 FindChunkStart(void *p)
 {
-    jsuword addr = reinterpret_cast<jsuword>(p);
+    uintptr_t addr = reinterpret_cast<uintptr_t>(p);
     addr = (addr + ChunkMask) & ~ChunkMask;
     return reinterpret_cast<void *>(addr);
 }
 
 void *
 AllocChunk()
 {
     void *p;
@@ -297,17 +297,17 @@ AllocChunk()
      * and deallocation operations.  Therefore, take care here to acquire the
      * final result via one mapping operation.  This means unmapping any
      * preliminary result that is not correctly aligned.
      */
     p = MapPages(NULL, ChunkSize);
     if (!p)
         return NULL;
 
-    if (reinterpret_cast<jsuword>(p) & ChunkMask) {
+    if (reinterpret_cast<uintptr_t>(p) & ChunkMask) {
         UnmapPages(p, ChunkSize);
         p = MapPages(FindChunkStart(p), ChunkSize);
         while (!p) {
             /*
              * Over-allocate in order to map a memory region that is
              * definitely large enough then deallocate and allocate again the
              * correct size, within the over-sized mapping.
              */
@@ -320,25 +320,25 @@ AllocChunk()
             /*
              * Failure here indicates a race with another thread, so
              * try again.
              */
         }
     }
 #endif /* !JS_GC_HAS_MAP_ALIGN */
 
-    JS_ASSERT(!(reinterpret_cast<jsuword>(p) & ChunkMask));
+    JS_ASSERT(!(reinterpret_cast<uintptr_t>(p) & ChunkMask));
     return p;
 }
 
 void
 FreeChunk(void *p)
 {
     JS_ASSERT(p);
-    JS_ASSERT(!(reinterpret_cast<jsuword>(p) & ChunkMask));
+    JS_ASSERT(!(reinterpret_cast<uintptr_t>(p) & ChunkMask));
     UnmapPages(p, ChunkSize);
 }
 
 #ifdef XP_WIN
 bool
 CommitMemory(void *addr, size_t size)
 {
     JS_ASSERT(uintptr_t(addr) % 4096UL == 0);
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -5012,17 +5012,17 @@ TypeMonitorCallSlow(JSContext *cx, JSObj
     for (; arg < nargs; arg++)
         TypeScript::SetArgument(cx, script, arg, UndefinedValue());
 }
 
 static inline bool
 IsAboutToBeFinalized(JSContext *cx, TypeObjectKey *key)
 {
     /* Mask out the low bit indicating whether this is a type or JS object. */
-    return !reinterpret_cast<const gc::Cell *>((jsuword) key & ~1)->isMarked();
+    return !reinterpret_cast<const gc::Cell *>(uintptr_t(key) & ~1)->isMarked();
 }
 
 void
 TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc, Type type)
 {
     JS_ASSERT(cx->typeInferenceEnabled());
     AutoEnterTypeInference enter(cx);
 
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -62,30 +62,30 @@ struct TypeObjectKey {
 
 /*
  * Information about a single concrete type. We pack this into a single word,
  * where small values are particular primitive or other singleton types, and
  * larger values are either specific JS objects or type objects.
  */
 class Type
 {
-    jsuword data;
-    Type(jsuword data) : data(data) {}
+    uintptr_t data;
+    Type(uintptr_t data) : data(data) {}
 
   public:
 
-    jsuword raw() const { return data; }
+    uintptr_t raw() const { return data; }
 
     bool isPrimitive() const {
         return data < JSVAL_TYPE_OBJECT;
     }
 
     bool isPrimitive(JSValueType type) const {
         JS_ASSERT(type < JSVAL_TYPE_OBJECT);
-        return (jsuword) type == data;
+        return (uintptr_t) type == data;
     }
 
     JSValueType primitive() const {
         JS_ASSERT(isPrimitive());
         return (JSValueType) data;
     }
 
     bool isAnyObject() const {
@@ -1056,17 +1056,17 @@ class TypeScript
     /* Dynamic types generated at points within this script. */
     TypeResult *dynamicList;
 
     inline TypeScript();
 
     bool hasScope() { return size_t(global.get()) != GLOBAL_MISSING_SCOPE; }
 
     /* Array of type type sets for variables and JOF_TYPESET ops. */
-    TypeSet *typeArray() { return (TypeSet *) (jsuword(this) + sizeof(TypeScript)); }
+    TypeSet *typeArray() { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); }
 
     static inline unsigned NumTypeSets(JSScript *script);
 
     static bool SetScope(JSContext *cx, JSScript *script, JSObject *scope);
 
     static inline TypeSet *ReturnTypes(JSScript *script);
     static inline TypeSet *ThisTypes(JSScript *script);
     static inline TypeSet *ArgTypes(JSScript *script, unsigned i);
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -58,32 +58,32 @@
 
 namespace js {
 namespace types {
 
 /* static */ inline Type
 Type::ObjectType(JSObject *obj)
 {
     if (obj->hasSingletonType())
-        return Type((jsuword) obj | 1);
-    return Type((jsuword) obj->type());
+        return Type(uintptr_t(obj) | 1);
+    return Type(uintptr_t(obj->type()));
 }
 
 /* static */ inline Type
 Type::ObjectType(TypeObject *obj)
 {
     if (obj->singleton)
-        return Type((jsuword) obj->singleton.get() | 1);
-    return Type((jsuword) obj);
+        return Type(uintptr_t(obj->singleton.get()) | 1);
+    return Type(uintptr_t(obj));
 }
 
 /* static */ inline Type
 Type::ObjectType(TypeObjectKey *obj)
 {
-    return Type((jsuword) obj);
+    return Type(uintptr_t(obj));
 }
 
 inline Type
 GetValueType(JSContext *cx, const Value &val)
 {
     JS_ASSERT(cx->typeInferenceEnabled());
     if (val.isDouble())
         return Type::DoubleType();
@@ -1076,24 +1076,24 @@ TypeSet::getObject(unsigned i)
     }
     return objectSet[i];
 }
 
 inline JSObject *
 TypeSet::getSingleObject(unsigned i)
 {
     TypeObjectKey *key = getObject(i);
-    return ((jsuword) key & 1) ? (JSObject *)((jsuword) key ^ 1) : NULL;
+    return (uintptr_t(key) & 1) ? (JSObject *)(uintptr_t(key) ^ 1) : NULL;
 }
 
 inline TypeObject *
 TypeSet::getTypeObject(unsigned i)
 {
     TypeObjectKey *key = getObject(i);
-    return (key && !((jsuword) key & 1)) ? (TypeObject *) key : NULL;
+    return (key && !(uintptr_t(key) & 1)) ? (TypeObject *) key : NULL;
 }
 
 /////////////////////////////////////////////////////////////////////
 // TypeCallsite
 /////////////////////////////////////////////////////////////////////
 
 inline
 TypeCallsite::TypeCallsite(JSContext *cx, JSScript *script, jsbytecode *pc,
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -696,17 +696,17 @@ GetIterator(JSContext *cx, JSObject *obj
                 if (!pobj->isNative() ||
                     pobj->hasUncacheableProto() ||
                     obj->getOps()->enumerate ||
                     pobj->getClass()->enumerate != JS_EnumerateStub) {
                     shapes.clear();
                     goto miss;
                 }
                 const Shape *shape = pobj->lastProperty();
-                key = (key + (key << 16)) ^ ((jsuword)shape >> 3);
+                key = (key + (key << 16)) ^ (uintptr_t(shape) >> 3);
                 if (!shapes.append((Shape *) shape))
                     return false;
                 pobj = pobj->getProto();
             } while (pobj);
 
             JSObject *iterobj = cx->compartment->nativeIterCache.get(key);
             if (iterobj) {
                 NativeIterator *ni = iterobj->getNativeIterator();
--- a/js/src/jslock.cpp
+++ b/js/src/jslock.cpp
@@ -70,71 +70,72 @@ using namespace js;
 #if !defined(__GNUC__)
 # define __asm__ asm
 # define __volatile__ volatile
 #endif
 
 /* Implement NativeCompareAndSwap. */
 
 #if defined(_MSC_VER) && defined(_M_IX86)
+// TODO: Bug 716204 - undo this pragma.
 #pragma warning( disable : 4035 )
 JS_BEGIN_EXTERN_C
 extern long __cdecl
 _InterlockedCompareExchange(long *volatile dest, long exchange, long comp);
 JS_END_EXTERN_C
 #pragma intrinsic(_InterlockedCompareExchange)
-JS_STATIC_ASSERT(sizeof(jsword) == sizeof(long));
+JS_STATIC_ASSERT(sizeof(intptr_t) == sizeof(long));
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwapHelper(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwapHelper(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     _InterlockedCompareExchange((long*) w, nv, ov);
     __asm {
         sete al
     }
 }
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     return (NativeCompareAndSwapHelper(w, ov, nv) & 1);
 }
 
 #elif defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_X64))
 /*
  * Compared with the _InterlockedCompareExchange in the 32 bit case above MSVC
  * declares _InterlockedCompareExchange64 through <windows.h>.
  */
 #pragma intrinsic(_InterlockedCompareExchange64)
-JS_STATIC_ASSERT(sizeof(jsword) == sizeof(long long));
+JS_STATIC_ASSERT(sizeof(intptr_t) == sizeof(long long));
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     return _InterlockedCompareExchange64((long long *volatile)w, nv, ov) == ov;
 }
 
 #elif defined(XP_MACOSX) || defined(DARWIN)
 
 #include <libkern/OSAtomic.h>
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     /* Details on these functions available in the manpage for atomic */
     return OSAtomicCompareAndSwapPtrBarrier(reinterpret_cast<void *>(ov),
                                             reinterpret_cast<void *>(nv),
                                             reinterpret_cast<void * volatile *>(w));
 }
 
 #elif defined(__i386) && (defined(__GNUC__) || defined(__SUNPRO_CC))
 
 /* Note: This fails on 386 cpus, cmpxchgl is a >= 486 instruction */
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     unsigned int res;
 
     __asm__ __volatile__ (
                           "lock\n"
                           "cmpxchgl %2, (%1)\n"
                           "sete %%al\n"
                           "andl $1, %%eax\n"
@@ -146,17 +147,17 @@ NativeCompareAndSwap(volatile jsword *w,
                           : "r" (w), "r" (nv), "a" (ov)
 #endif
                           : "cc", "memory");
     return (int)res;
 }
 #elif defined(__x86_64) && (defined(__GNUC__) || defined(__SUNPRO_CC))
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     unsigned int res;
 
     __asm__ __volatile__ (
                           "lock\n"
                           "cmpxchgq %2, (%1)\n"
                           "sete %%al\n"
                           "movzbl %%al, %%eax\n"
@@ -165,17 +166,17 @@ NativeCompareAndSwap(volatile jsword *w,
                           : "cc", "memory");
     return (int)res;
 }
 
 #elif defined(__sparc)
 #if defined(__GNUC__)
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     unsigned int res;
 
     __asm__ __volatile__ (
                   "membar #StoreLoad | #LoadLoad\n"
 #if JS_BITS_PER_WORD == 32
                   "cas [%1],%2,%3\n"
 #else
@@ -191,59 +192,59 @@ NativeCompareAndSwap(volatile jsword *w,
                   : "r" (w), "r" (ov), "r" (nv));
     return (int)res;
 }
 
 #elif defined(__SUNPRO_CC)
 
 /* Implementation in lock_sparc*.il */
 extern "C" int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv);
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv);
 
 #endif
 
 #elif defined(AIX)
 
 #include <sys/atomic_op.h>
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     int res;
-    JS_STATIC_ASSERT(sizeof(jsword) == sizeof(long));
+    JS_STATIC_ASSERT(sizeof(intptr_t) == sizeof(long));
 
     res = compare_and_swaplp((atomic_l)w, &ov, nv);
     if (res)
         __asm__("isync");
     return res;
 }
 
 #elif defined(__arm__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
 
-JS_STATIC_ASSERT(sizeof(jsword) == sizeof(int));
+JS_STATIC_ASSERT(sizeof(intptr_t) == sizeof(int));
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
   return __sync_bool_compare_and_swap(w, ov, nv);
 }
 
 #elif defined(USE_ARM_KUSER)
 
 /* See https://bugzilla.mozilla.org/show_bug.cgi?id=429387 for a
  * description of this ABI; this is a function provided at a fixed
  * location by the kernel in the memory space of each process.
  */
 typedef int (__kernel_cmpxchg_t)(int oldval, int newval, volatile int *ptr);
 #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *)0xffff0fc0)
 
-JS_STATIC_ASSERT(sizeof(jsword) == sizeof(int));
+JS_STATIC_ASSERT(sizeof(intptr_t) == sizeof(int));
 
 static JS_ALWAYS_INLINE int
-NativeCompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+NativeCompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     volatile int *vp = (volatile int *) w;
     PRInt32 failed = 1;
 
     /* Loop until a __kernel_cmpxchg succeeds. See bug 446169 */
     do {
         failed = __kernel_cmpxchg(ov, nv, vp);
     } while (failed && *vp == ov);
@@ -254,29 +255,29 @@ NativeCompareAndSwap(volatile jsword *w,
 
 #error "JS_HAS_NATIVE_COMPARE_AND_SWAP should be 0 if your platform lacks a compare-and-swap instruction."
 
 #endif /* arch-tests */
 
 #if JS_HAS_NATIVE_COMPARE_AND_SWAP
 
 JSBool
-js_CompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+js_CompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     return !!NativeCompareAndSwap(w, ov, nv);
 }
 
 #elif defined(NSPR_LOCK)
 
 # ifdef __GNUC__
 # warning "js_CompareAndSwap is implemented using NSPR lock"
 # endif
 
 JSBool
-js_CompareAndSwap(volatile jsword *w, jsword ov, jsword nv)
+js_CompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv)
 {
     int result;
     static PRLock *CompareAndSwapLock = JS_NEW_LOCK();
 
     JS_ACQUIRE_LOCK(CompareAndSwapLock);
     result = (*w == ov);
     if (result)
         *w = nv;
@@ -286,30 +287,30 @@ js_CompareAndSwap(volatile jsword *w, js
 
 #else /* !defined(NSPR_LOCK) */
 
 #error "NSPR_LOCK should be on when the platform lacks native compare-and-swap."
 
 #endif
 
 void
-js_AtomicSetMask(volatile jsword *w, jsword mask)
+js_AtomicSetMask(volatile intptr_t *w, intptr_t mask)
 {
-    jsword ov, nv;
+    intptr_t ov, nv;
 
     do {
         ov = *w;
         nv = ov | mask;
     } while (!js_CompareAndSwap(w, ov, nv));
 }
 
 void
-js_AtomicClearMask(volatile jsword *w, jsword mask)
+js_AtomicClearMask(volatile intptr_t *w, intptr_t mask)
 {
-    jsword ov, nv;
+    intptr_t ov, nv;
 
     do {
         ov = *w;
         nv = ov & ~mask;
     } while (!js_CompareAndSwap(w, ov, nv));
 }
 
 unsigned
@@ -339,17 +340,17 @@ struct JSFatLock {
     JSFatLock   **prevp;
 };
 
 typedef struct JSFatLockTable {
     JSFatLock   *free_;
     JSFatLock   *taken;
 } JSFatLockTable;
 
-#define GLOBAL_LOCK_INDEX(id)   (((uint32_t)(jsuword)(id)>>2) & global_locks_mask)
+#define GLOBAL_LOCK_INDEX(id)   (((uint32_t)(uintptr_t)(id)>>2) & global_locks_mask)
 
 static void
 js_Dequeue(JSThinLock *);
 
 static PRLock **global_locks;
 static uint32_t global_lock_count = 1;
 static uint32_t global_locks_log2 = 0;
 static uint32_t global_locks_mask = 0;
@@ -559,24 +560,24 @@ js_CleanupLocks()
         fl_list_table_len = 0;
     }
 #endif /* !NSPR_LOCK */
 }
 
 #ifdef NSPR_LOCK
 
 static JS_ALWAYS_INLINE void
-ThinLock(JSThinLock *tl, jsword me)
+ThinLock(JSThinLock *tl, intptr_t me)
 {
     JS_ACQUIRE_LOCK((JSLock *) tl->fat);
     tl->owner = me;
 }
 
 static JS_ALWAYS_INLINE void
-ThinUnlock(JSThinLock *tl, jsword /*me*/)
+ThinUnlock(JSThinLock *tl, intptr_t /*me*/)
 {
     tl->owner = 0;
     JS_RELEASE_LOCK((JSLock *) tl->fat);
 }
 
 #else
 
 /*
@@ -650,19 +651,19 @@ js_ResumeThread(JSThinLock *tl)
     PR_Lock(fl->slock);
     js_UnlockGlobal(tl);
     DebugOnly<PRStatus> stat = PR_NotifyCondVar(fl->svar);
     JS_ASSERT(stat != PR_FAILURE);
     PR_Unlock(fl->slock);
 }
 
 static void
-js_Enqueue(JSThinLock *tl, jsword me)
+js_Enqueue(JSThinLock *tl, intptr_t me)
 {
-    jsword o, n;
+    intptr_t o, n;
 
     js_LockGlobal(tl);
     for (;;) {
         o = ReadWord(tl->owner);
         n = Thin_SetWait(o);
         if (o != 0 && NativeCompareAndSwap(&tl->owner, o, n)) {
             if (js_SuspendThread(tl))
                 me = Thin_RemoveWait(me);
@@ -674,43 +675,43 @@ js_Enqueue(JSThinLock *tl, jsword me)
             return;
         }
     }
 }
 
 static void
 js_Dequeue(JSThinLock *tl)
 {
-    jsword o;
+    intptr_t o;
 
     js_LockGlobal(tl);
     o = ReadWord(tl->owner);
     JS_ASSERT(Thin_GetWait(o) != 0);
     JS_ASSERT(tl->fat != NULL);
     if (!NativeCompareAndSwap(&tl->owner, o, 0)) /* release it */
         JS_ASSERT(0);
     js_ResumeThread(tl);
 }
 
 static JS_ALWAYS_INLINE void
-ThinLock(JSThinLock *tl, jsword me)
+ThinLock(JSThinLock *tl, intptr_t me)
 {
     JS_ASSERT(CURRENT_THREAD_IS_ME(me));
     if (NativeCompareAndSwap(&tl->owner, 0, me))
         return;
     if (Thin_RemoveWait(ReadWord(tl->owner)) != me)
         js_Enqueue(tl, me);
 #ifdef DEBUG
     else
         JS_ASSERT(0);
 #endif
 }
 
 static JS_ALWAYS_INLINE void
-ThinUnlock(JSThinLock *tl, jsword me)
+ThinUnlock(JSThinLock *tl, intptr_t me)
 {
     JS_ASSERT(CURRENT_THREAD_IS_ME(me));
 
     /*
      * Since we can race with the NativeCompareAndSwap in js_Enqueue, we need
      * to use a C_A_S here as well -- Arjan van de Ven 30/1/08
      */
     if (NativeCompareAndSwap(&tl->owner, me, 0))
--- a/js/src/jslock.h
+++ b/js/src/jslock.h
@@ -67,28 +67,28 @@
 #endif
 
 #if defined(JS_USE_ONLY_NSPR_LOCKS) || !JS_HAS_NATIVE_COMPARE_AND_SWAP
 # define NSPR_LOCK 1
 #else
 # undef NSPR_LOCK
 #endif
 
-#define Thin_GetWait(W) ((jsword)(W) & 0x1)
-#define Thin_SetWait(W) ((jsword)(W) | 0x1)
-#define Thin_RemoveWait(W) ((jsword)(W) & ~0x1)
+#define Thin_GetWait(W) ((intptr_t)(W) & 0x1)
+#define Thin_SetWait(W) ((intptr_t)(W) | 0x1)
+#define Thin_RemoveWait(W) ((intptr_t)(W) & ~0x1)
 
 typedef struct JSFatLock JSFatLock;
 
 typedef struct JSThinLock {
-    jsword      owner;
+    intptr_t    owner;
     JSFatLock   *fat;
 } JSThinLock;
 
-#define CX_THINLOCK_ID(cx)       ((jsword)(cx)->thread())
+#define CX_THINLOCK_ID(cx)       ((intptr_t)(cx)->thread())
 #define CURRENT_THREAD_IS_ME(me) (((JSThread *)me)->id == js_CurrentThreadId())
 
 typedef PRLock JSLock;
 
 /*
  * Atomic increment and decrement for a reference counter, given jsrefcount *p.
  * NB: jsrefcount is int32, aka PRInt32, so that pratom.h functions work.
  */
@@ -178,39 +178,39 @@ extern JSBool js_IsRuntimeLocked(JSRunti
 #endif
 #ifndef JS_SET_TITLE_INFO
 #define JS_SET_TITLE_INFO(title,f,l)    ((void)0)
 #endif
 
 #ifdef JS_THREADSAFE
 
 extern JSBool
-js_CompareAndSwap(volatile jsword *w, jsword ov, jsword nv);
+js_CompareAndSwap(volatile intptr_t *w, intptr_t ov, intptr_t nv);
 
 /* Atomically bitwise-or the mask into the word *w using compare and swap. */
 extern void
-js_AtomicSetMask(volatile jsword *w, jsword mask);
+js_AtomicSetMask(volatile intptr_t *w, intptr_t mask);
 
 /*
  * Atomically bitwise-and the complement of the mask into the word *w using
  * compare and swap.
  */
 extern void
-js_AtomicClearMask(volatile jsword *w, jsword mask);
+js_AtomicClearMask(volatile intptr_t *w, intptr_t mask);
 
 #define JS_ATOMIC_SET_MASK(w, mask) js_AtomicSetMask(w, mask)
 #define JS_ATOMIC_CLEAR_MASK(w, mask) js_AtomicClearMask(w, mask)
 
 extern  unsigned
 js_GetCPUCount();
 
 #else
 
 static inline JSBool
-js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
+js_CompareAndSwap(intptr_t *w, intptr_t ov, intptr_t nv)
 {
     return (*w == ov) ? *w = nv, JS_TRUE : JS_FALSE;
 }
 
 #define JS_ATOMIC_SET_MASK(w, mask) (*(w) |= (mask))
 #define JS_ATOMIC_CLEAR_MASK(w, mask) (*(w) &= ~(mask))
 
 static inline unsigned
--- a/js/src/jslocko.asm
+++ b/js/src/jslocko.asm
@@ -38,17 +38,17 @@
 
         .486P
         .MODEL FLAT, OPTLINK
         .STACK
 
         .CODE
 
 ;;;---------------------------------------------------------------------
-;;; int _Optlink js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
+;;; int _Optlink js_CompareAndSwap(intptr_t *w, intptr_t ov, intptr_t nv)
 ;;;---------------------------------------------------------------------
 js_CompareAndSwap     PROC OPTLINK EXPORT
         push ebx
         mov ebx, eax
         mov eax, edx
         mov edx, ebx
         lock cmpxchg [ebx], ecx
         sete al
--- a/js/src/jslog2.cpp
+++ b/js/src/jslog2.cpp
@@ -41,21 +41,21 @@
 /*
  * Check that we can use js_bitscan_clz32 to implement JS_FLOOR_LOG2 and
  * JS_FLOOR_LOG2W and js_bitscan_clz64 to implement JS_FLOOR_LOG2W on 64-bit
  * systems.
  */
 #ifdef JS_HAS_BUILTIN_BITSCAN32
 JS_STATIC_ASSERT(sizeof(unsigned int) == sizeof(uint32_t));
 JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 4,
-                    sizeof(unsigned int) == sizeof(JSUword));
+                    sizeof(unsigned int) == sizeof(uintptr_t));
 #endif
 #ifdef JS_HAS_BUILTIN_BITSCAN64
 JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 8,
-                    sizeof(unsigned long long) == sizeof(JSUword));
+                    sizeof(unsigned long long) == sizeof(uintptr_t));
 #endif
 
 #if !defined(JS_HAS_BUILTIN_BITSCAN32) && JS_BYTES_PER_WORD == 4
 
 size_t
 js_FloorLog2wImpl(size_t n)
 {
     size_t log2;
--- a/js/src/jsnativestack.h
+++ b/js/src/jsnativestack.h
@@ -42,19 +42,19 @@
 #include "jspubtd.h"
 #include "jsutil.h"
 
 namespace js {
 
 extern void *
 GetNativeStackBaseImpl();
 
-inline jsuword *
+inline uintptr_t *
 GetNativeStackBase()
 {
     void *stackBase = GetNativeStackBaseImpl();
-    JS_ASSERT(reinterpret_cast<jsuword>(stackBase) % sizeof(void *) == 0);
-    return static_cast<jsuword *>(stackBase);
+    JS_ASSERT(reinterpret_cast<uintptr_t>(stackBase) % sizeof(void *) == 0);
+    return static_cast<uintptr_t *>(stackBase);
 }
 
 } /* namespace js */
 
 #endif /* jsnativestack_h__ */
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -6534,17 +6534,17 @@ js_SetReservedSlot(JSContext *cx, JSObje
     JS_ASSERT(slot < JSSLOT_FREE(obj->getClass()));
     obj->setSlot(slot, v);
     GCPoke(cx, NullValue());
     return true;
 }
 
 static ObjectElements emptyObjectHeader(0, 0);
 HeapValue *js::emptyObjectElements =
-    (HeapValue *) (jsuword(&emptyObjectHeader) + sizeof(ObjectElements));
+    (HeapValue *) (uintptr_t(&emptyObjectHeader) + sizeof(ObjectElements));
 
 JSBool
 js_ReportGetterOnlyAssignment(JSContext *cx)
 {
     return JS_ReportErrorFlagsAndNumber(cx,
                                         JSREPORT_WARNING | JSREPORT_STRICT |
                                         JSREPORT_STRICT_MODE_ERROR,
                                         js_GetErrorMessage, NULL,
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -419,19 +419,19 @@ class ObjectElements
     }
 
   public:
 
     ObjectElements(uint32_t capacity, uint32_t length)
         : capacity(capacity), initializedLength(0), length(length)
     {}
 
-    HeapValue * elements() { return (HeapValue *)(jsuword(this) + sizeof(ObjectElements)); }
+    HeapValue * elements() { return (HeapValue *)(uintptr_t(this) + sizeof(ObjectElements)); }
     static ObjectElements * fromElements(HeapValue *elems) {
-        return (ObjectElements *)(jsuword(elems) - sizeof(ObjectElements));
+        return (ObjectElements *)(uintptr_t(elems) - sizeof(ObjectElements));
     }
 
     static int offsetOfCapacity() {
         return (int)offsetof(ObjectElements, capacity) - (int)sizeof(ObjectElements);
     }
     static int offsetOfInitializedLength() {
         return (int)offsetof(ObjectElements, initializedLength) - (int)sizeof(ObjectElements);
     }
@@ -1487,17 +1487,17 @@ static JS_ALWAYS_INLINE bool
 operator!=(const JSObject &lhs, const JSObject &rhs)
 {
     return &lhs != &rhs;
 }
 
 inline js::HeapValue*
 JSObject::fixedSlots() const
 {
-    return (js::HeapValue *) (jsuword(this) + sizeof(JSObject));
+    return (js::HeapValue *) (uintptr_t(this) + sizeof(JSObject));
 }
 
 inline size_t
 JSObject::numFixedSlots() const
 {
     return reinterpret_cast<const js::shadow::Object *>(this)->numFixedSlots();
 }
 
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -1518,17 +1518,17 @@ class AutoPropertyDescriptorRooter : pri
     }
 
     friend void AutoGCRooter::trace(JSTracer *trc);
 };
 
 inline bool
 NewObjectCache::lookup(Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry)
 {
-    jsuword hash = (jsuword(clasp) ^ jsuword(key)) + kind;
+    uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind;
     *pentry = hash % js::ArrayLength(entries);
 
     Entry *entry = &entries[*pentry];
 
     /* N.B. Lookups with the same clasp/key but different kinds map to different entries. */
     return (entry->clasp == clasp && entry->key == key);
 }
 
--- a/js/src/jspropertycache.h
+++ b/js/src/jspropertycache.h
@@ -169,20 +169,20 @@ class PropertyCache
 # define PCMETER(x)     ((void)0)
 #endif
 
     PropertyCache() {
         PodZero(this);
     }
     
   private:
-    static inline jsuword
+    static inline uintptr_t
     hash(jsbytecode *pc, const Shape *kshape)
     {
-        return (((jsuword(pc) >> SIZE_LOG2) ^ jsuword(pc) ^ ((jsuword)kshape >> 3)) & MASK);
+        return (((uintptr_t(pc) >> SIZE_LOG2) ^ uintptr_t(pc) ^ ((uintptr_t)kshape >> 3)) & MASK);
     }
 
     static inline bool matchShape(JSContext *cx, JSObject *obj, uint32_t shape);
 
     PropertyName *
     fullTest(JSContext *cx, jsbytecode *pc, JSObject **objp,
              JSObject **pobjp, PropertyCacheEntry *entry);
 
--- a/js/src/jspropertytree.h
+++ b/js/src/jspropertytree.h
@@ -59,42 +59,42 @@ typedef HashSet<js::Shape *, ShapeHasher
 class KidsPointer {
   private:
     enum {
         SHAPE = 0,
         HASH  = 1,
         TAG   = 1
     };
 
-    jsuword w;
+    uintptr_t w;
 
   public:
     bool isNull() const { return !w; }
     void setNull() { w = 0; }
 
     bool isShape() const { return (w & TAG) == SHAPE && !isNull(); }
     js::Shape *toShape() const {
         JS_ASSERT(isShape());
-        return reinterpret_cast<js::Shape *>(w & ~jsuword(TAG));
+        return reinterpret_cast<js::Shape *>(w & ~uintptr_t(TAG));
     }
     void setShape(js::Shape *shape) {
         JS_ASSERT(shape);
-        JS_ASSERT((reinterpret_cast<jsuword>(shape) & TAG) == 0);
-        w = reinterpret_cast<jsuword>(shape) | SHAPE;
+        JS_ASSERT((reinterpret_cast<uintptr_t>(shape) & TAG) == 0);
+        w = reinterpret_cast<uintptr_t>(shape) | SHAPE;
     }
 
     bool isHash() const { return (w & TAG) == HASH; }
     KidsHash *toHash() const {
         JS_ASSERT(isHash());
-        return reinterpret_cast<KidsHash *>(w & ~jsuword(TAG));
+        return reinterpret_cast<KidsHash *>(w & ~uintptr_t(TAG));
     }
     void setHash(KidsHash *hash) {
         JS_ASSERT(hash);
-        JS_ASSERT((reinterpret_cast<jsuword>(hash) & TAG) == 0);
-        w = reinterpret_cast<jsuword>(hash) | HASH;
+        JS_ASSERT((reinterpret_cast<uintptr_t>(hash) & TAG) == 0);
+        w = reinterpret_cast<uintptr_t>(hash) | HASH;
     }
 
 #ifdef DEBUG
     void checkConsistency(const js::Shape *aKid) const;
 #endif
 };
 
 class PropertyTree
--- a/js/src/jsscope.cpp
+++ b/js/src/jsscope.cpp
@@ -202,28 +202,28 @@ PropertyTable::search(jsid id, bool addi
         return spp;
 
     /* Collision: double hash. */
     sizeLog2 = JS_DHASH_BITS - hashShift;
     hash2 = HASH2(hash0, sizeLog2, hashShift);
     sizeMask = JS_BITMASK(sizeLog2);
 
 #ifdef DEBUG
-    jsuword collision_flag = SHAPE_COLLISION;
+    uintptr_t collision_flag = SHAPE_COLLISION;
 #endif
 
     /* Save the first removed entry pointer so we can recycle it if adding. */
     if (SHAPE_IS_REMOVED(stored)) {
         firstRemoved = spp;
     } else {
         firstRemoved = NULL;
         if (adding && !SHAPE_HAD_COLLISION(stored))
             SHAPE_FLAG_COLLISION(spp, shape);
 #ifdef DEBUG
-        collision_flag &= jsuword(*spp) & SHAPE_COLLISION;
+        collision_flag &= uintptr_t(*spp) & SHAPE_COLLISION;
 #endif
     }
 
     for (;;) {
         hash1 -= hash2;
         hash1 &= sizeMask;
         spp = entries + hash1;
 
@@ -239,17 +239,17 @@ PropertyTable::search(jsid id, bool addi
 
         if (SHAPE_IS_REMOVED(stored)) {
             if (!firstRemoved)
                 firstRemoved = spp;
         } else {
             if (adding && !SHAPE_HAD_COLLISION(stored))
                 SHAPE_FLAG_COLLISION(spp, shape);
 #ifdef DEBUG
-            collision_flag &= jsuword(*spp) & SHAPE_COLLISION;
+            collision_flag &= uintptr_t(*spp) & SHAPE_COLLISION;
 #endif
         }
     }
 
     /* NOTREACHED */
     return NULL;
 }
 
@@ -1261,20 +1261,20 @@ Shape::setObjectFlag(JSContext *cx, Base
 
     return replaceLastProperty(cx, base, proto, last);
 }
 
 /* static */ inline HashNumber
 StackBaseShape::hash(const StackBaseShape *base)
 {
     JSDHashNumber hash = base->flags;
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ (jsuword(base->clasp) >> 3);
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ (jsuword(base->parent) >> 3);
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ jsuword(base->rawGetter);
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ jsuword(base->rawSetter);
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ (uintptr_t(base->clasp) >> 3);
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ (uintptr_t(base->parent) >> 3);
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ uintptr_t(base->rawGetter);
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ uintptr_t(base->rawSetter);
     return hash;
 }
 
 /* static */ inline bool
 StackBaseShape::match(UnownedBaseShape *key, const StackBaseShape *lookup)
 {
     return key->flags == lookup->flags
         && key->clasp == lookup->clasp
@@ -1397,19 +1397,19 @@ Bindings::setParent(JSContext *cx, JSObj
         return false;
     self->lastBinding = newShape;
     return true;
 }
 
 /* static */ inline HashNumber
 InitialShapeEntry::hash(const Lookup &lookup)
 {
-    JSDHashNumber hash = jsuword(lookup.clasp) >> 3;
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ (jsuword(lookup.proto) >> 3);
-    hash = JS_ROTATE_LEFT32(hash, 4) ^ (jsuword(lookup.parent) >> 3);
+    JSDHashNumber hash = uintptr_t(lookup.clasp) >> 3;
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ (uintptr_t(lookup.proto) >> 3);
+    hash = JS_ROTATE_LEFT32(hash, 4) ^ (uintptr_t(lookup.parent) >> 3);
     return hash + lookup.nfixed;
 }
 
 /* static */ inline bool
 InitialShapeEntry::match(const InitialShapeEntry &key, const Lookup &lookup)
 {
     return lookup.clasp == key.shape->getObjectClass()
         && lookup.proto == key.proto
--- a/js/src/jsscope.h
+++ b/js/src/jsscope.h
@@ -1039,33 +1039,33 @@ class RootStackShape
       : baseShapeRoot(cx, &shape->base),
         propidRoot(cx, &shape->propid)
     {}
 };
 
 } /* namespace js */
 
 /* js::Shape pointer tag bit indicating a collision. */
-#define SHAPE_COLLISION                 (jsuword(1))
+#define SHAPE_COLLISION                 (uintptr_t(1))
 #define SHAPE_REMOVED                   ((js::Shape *) SHAPE_COLLISION)
 
 /* Macros to get and set shape pointer values and collision flags. */
 #define SHAPE_IS_FREE(shape)            ((shape) == NULL)
 #define SHAPE_IS_REMOVED(shape)         ((shape) == SHAPE_REMOVED)
 #define SHAPE_IS_LIVE(shape)            ((shape) > SHAPE_REMOVED)
 #define SHAPE_FLAG_COLLISION(spp,shape) (*(spp) = (js::Shape *)               \
-                                         (jsuword(shape) | SHAPE_COLLISION))
-#define SHAPE_HAD_COLLISION(shape)      (jsuword(shape) & SHAPE_COLLISION)
+                                         (uintptr_t(shape) | SHAPE_COLLISION))
+#define SHAPE_HAD_COLLISION(shape)      (uintptr_t(shape) & SHAPE_COLLISION)
 #define SHAPE_FETCH(spp)                SHAPE_CLEAR_COLLISION(*(spp))
 
 #define SHAPE_CLEAR_COLLISION(shape)                                          \
-    ((js::Shape *) (jsuword(shape) & ~SHAPE_COLLISION))
+    ((js::Shape *) (uintptr_t(shape) & ~SHAPE_COLLISION))
 
 #define SHAPE_STORE_PRESERVING_COLLISION(spp, shape)                          \
-    (*(spp) = (js::Shape *) (jsuword(shape) | SHAPE_HAD_COLLISION(*(spp))))
+    (*(spp) = (js::Shape *) (uintptr_t(shape) | SHAPE_HAD_COLLISION(*(spp))))
 
 namespace js {
 
 inline Shape *
 Shape::search(JSContext *cx, Shape *start, jsid id, Shape ***pspp, bool adding)
 {
     if (start->inDictionary()) {
         *pspp = start->table().search(id, adding);
--- a/js/src/jsscopeinlines.h
+++ b/js/src/jsscopeinlines.h
@@ -234,17 +234,17 @@ Shape::Shape(UnownedBaseShape *base, uin
 {
     JS_ASSERT(base);
     kids.setNull();
 }
 
 inline JSDHashNumber
 StackShape::hash() const
 {
-    JSDHashNumber hash = jsuword(base);
+    JSDHashNumber hash = uintptr_t(base);
 
     /* Accumulate from least to most random so the low bits are most random. */
     hash = JS_ROTATE_LEFT32(hash, 4) ^ (flags & Shape::PUBLIC_FLAGS);
     hash = JS_ROTATE_LEFT32(hash, 4) ^ attrs;
     hash = JS_ROTATE_LEFT32(hash, 4) ^ shortid;
     hash = JS_ROTATE_LEFT32(hash, 4) ^ slot_;
     hash = JS_ROTATE_LEFT32(hash, 4) ^ JSID_BITS(propid);
     return hash;
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -1027,17 +1027,17 @@ JSScript::NewScript(JSContext *cx, uint3
     JS_STATIC_ASSERT(sizeof(JSObjectArray) +
                      sizeof(JSUpvarArray) +
                      sizeof(JSObjectArray) +
                      sizeof(JSTryNoteArray) +
                      sizeof(GlobalSlotArray) < 0xFF);
 
 
     if (nconsts != 0) {
-        JS_ASSERT(reinterpret_cast<jsuword>(cursor) % sizeof(jsval) == 0);
+        JS_ASSERT(reinterpret_cast<uintptr_t>(cursor) % sizeof(jsval) == 0);
         script->consts()->length = nconsts;
         script->consts()->vector = (HeapValue *)cursor;
         cursor += nconsts * sizeof(script->consts()->vector[0]);
     }
 
     if (natoms != 0) {
         script->natoms = natoms;
         script->atoms = reinterpret_cast<JSAtom **>(cursor);
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -296,22 +296,16 @@ typedef JSIntn JSBool;
 /************************************************************************
 ** TYPES:       JSPackedBool
 ** DESCRIPTION:
 **  Use JSPackedBool within structs where bitfields are not desireable
 **      but minimum and consistent overhead matters.
 ************************************************************************/
 typedef uint8_t JSPackedBool;
 
-/*
-** A JSWord is an integer that is the same size as a void*
-*/
-typedef intptr_t JSWord;
-typedef uintptr_t JSUword;
-
 /***********************************************************************
 ** MACROS:      JS_LIKELY
 **              JS_UNLIKELY
 ** DESCRIPTION:
 **      These macros allow you to give a hint to the compiler about branch
 **      probability so that it can better optimize.  Use them like this:
 **
 **      if (JS_LIKELY(v == 1)) {
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -139,17 +139,17 @@ size_t gStackChunkSize = 8192;
 #endif
 
 size_t gMaxStackSize = DEFAULT_MAX_STACK_SIZE;
 
 
 #ifdef JS_THREADSAFE
 static PRUintn gStackBaseThreadIndex;
 #else
-static jsuword gStackBase;
+static uintptr_t gStackBase;
 #endif
 
 /*
  * Limit the timeout to 30 minutes to prevent an overflow on platfoms
  * that represent the time internally in microseconds using 32-bit int.
  */
 static jsdouble MAX_TIMEOUT_INTERVAL = 1800.0;
 static jsdouble gTimeoutInterval = -1.0;
@@ -3087,17 +3087,17 @@ ShapeOf(JSContext *cx, uintN argc, jsval
         JS_ReportError(cx, "shapeOf: object expected");
         return JS_FALSE;
     }
     JSObject *obj = JSVAL_TO_OBJECT(v);
     if (!obj) {
         *vp = JSVAL_ZERO;
         return JS_TRUE;
     }
-    return JS_NewNumberValue(cx, (double) ((jsuword)obj->lastProperty() >> 3), vp);
+    return JS_NewNumberValue(cx, (double) ((uintptr_t)obj->lastProperty() >> 3), vp);
 }
 
 /*
  * If referent has an own property named id, copy that property to obj[id].
  * Since obj is native, this isn't totally transparent; properties of a
  * non-native referent may be simplified to data properties.
  */
 static JSBool
@@ -5301,17 +5301,17 @@ main(int argc, char **argv, char **envp)
 #endif
 
 #ifdef JS_THREADSAFE
     if (PR_FAILURE == PR_NewThreadPrivateIndex(&gStackBaseThreadIndex, NULL) ||
         PR_FAILURE == PR_SetThreadPrivate(gStackBaseThreadIndex, &stackDummy)) {
         return 1;
     }
 #else
-    gStackBase = (jsuword) &stackDummy;
+    gStackBase = (uintptr_t) &stackDummy;
 #endif
 
 #ifdef XP_OS2
    /* these streams are normally line buffered on OS/2 and need a \n, *
     * so we need to unbuffer then to get a reasonable prompt          */
     setbuf(stdout,0);
     setbuf(stderr,0);
 #endif
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2390,23 +2390,23 @@ public:
     XPCWrappedNativeTearOff()
         : mInterface(nsnull), mNative(nsnull), mJSObject(nsnull) {}
     ~XPCWrappedNativeTearOff();
 
     // NOP. This is just here to make the AutoMarkingPtr code compile.
     inline void TraceJS(JSTracer* trc) {}
     inline void AutoTrace(JSTracer* trc) {}
 
-    void Mark()       {mJSObject = (JSObject*)(((jsword)mJSObject) | 1);}
-    void Unmark()     {mJSObject = (JSObject*)(((jsword)mJSObject) & ~1);}
-    JSBool IsMarked() const {return (JSBool)(((jsword)mJSObject) & 1);}
+    void Mark()       {mJSObject = (JSObject*)(intptr_t(mJSObject) | 1);}
+    void Unmark()     {mJSObject = (JSObject*)(intptr_t(mJSObject) & ~1);}
+    bool IsMarked() const {return !!(intptr_t(mJSObject) & 1);}
 
 private:
-    XPCWrappedNativeTearOff(const XPCWrappedNativeTearOff& r); // not implemented
-    XPCWrappedNativeTearOff& operator= (const XPCWrappedNativeTearOff& r); // not implemented
+    XPCWrappedNativeTearOff(const XPCWrappedNativeTearOff& r) MOZ_DELETE;
+    XPCWrappedNativeTearOff& operator= (const XPCWrappedNativeTearOff& r) MOZ_DELETE;
 
 private:
     XPCNativeInterface* mInterface;
     nsISupports*        mNative;
     JSObject*           mJSObject;
 };
 
 /***********************************************/
@@ -2465,20 +2465,20 @@ public:
     NS_CYCLE_COLLECTION_PARTICIPANT_INSTANCE
     NS_DECL_CYCLE_COLLECTION_UNMARK_PURPLE_STUB(XPCWrappedNative)
 
     nsIPrincipal* GetObjectPrincipal() const;
 
     JSBool
     IsValid() const {return nsnull != mFlatJSObject;}
 
-#define XPC_SCOPE_WORD(s)   ((jsword)(s))
-#define XPC_SCOPE_MASK      ((jsword)0x3)
-#define XPC_SCOPE_TAG       ((jsword)0x1)
-#define XPC_WRAPPER_EXPIRED ((jsword)0x2)
+#define XPC_SCOPE_WORD(s)   (intptr_t(s))
+#define XPC_SCOPE_MASK      (intptr_t(0x3))
+#define XPC_SCOPE_TAG       (intptr_t(0x1))
+#define XPC_WRAPPER_EXPIRED (intptr_t(0x2))
 
     static inline JSBool
     IsTaggedScope(XPCWrappedNativeScope* s)
         {return XPC_SCOPE_WORD(s) & XPC_SCOPE_TAG;}
 
     static inline XPCWrappedNativeScope*
     TagScope(XPCWrappedNativeScope* s)
         {NS_ASSERTION(!IsTaggedScope(s), "bad pointer!");
@@ -3954,17 +3954,17 @@ public:
      * Does the post script evaluation and resets the error reporter
      */
     ~AutoScriptEvaluate();
 private:
     JSContext* mJSContext;
     JSExceptionState* mState;
     bool mErrorReporterSet;
     bool mEvaluated;
-    jsword mContextHasThread;
+    intptr_t mContextHasThread;
     JSAutoEnterCompartment mEnterCompartment;
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 
     // No copying or assignment allowed
     AutoScriptEvaluate(const AutoScriptEvaluate &) MOZ_DELETE;
     AutoScriptEvaluate & operator =(const AutoScriptEvaluate &) MOZ_DELETE;
 };