bug 686279 - fixing GCC 4.6 warnings under js/src. r=luke
authorIgor Bukanov <igor@mir2.org>
Mon, 12 Sep 2011 11:43:47 +0200
changeset 76896 f350135d6b108a1305f1754ef47b578c7e57359a
parent 76895 e60a0b9fe93c716a4f04959474621c269a8ac160
child 76897 88e23391bc2c99799a4a8c112fc91230179b5ccf
push id21152
push usermbrubeck@mozilla.com
push dateTue, 13 Sep 2011 13:34:26 +0000
treeherdermozilla-central@c9479e3f6c54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs686279
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 686279 - fixing GCC 4.6 warnings under js/src. r=luke
js/src/jsemit.cpp
js/src/jslock.cpp
js/src/jsopcode.cpp
--- a/js/src/jsemit.cpp
+++ b/js/src/jsemit.cpp
@@ -4348,17 +4348,17 @@ MaybeEmitGroupAssignment(JSContext *cx, 
 }
 
 #endif /* JS_HAS_DESTRUCTURING */
 
 static JSBool
 EmitVariables(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
               JSBool inLetHead, ptrdiff_t *headNoteIndex)
 {
-    bool let, forInVar, first;
+    bool forInVar, first;
     ptrdiff_t off, noteIndex, tmp;
     JSParseNode *pn2, *pn3, *next;
     JSOp op;
     jsatomid atomIndex;
     uintN oldflags;
 
     /* Default in case of JS_HAS_BLOCK_SCOPE early return, below. */
     *headNoteIndex = -1;
@@ -4370,17 +4370,17 @@ EmitVariables(JSContext *cx, JSCodeGener
      * block from any calls to BindNameToSlot hiding in pn2->pn_expr so that
      * it won't find any names in the new let block.
      *
      * The same goes for let declarations in the head of any kind of for loop.
      * Unlike a let declaration 'let x = i' within a block, where x is hoisted
      * to the start of the block, a 'for (let x = i...) ...' loop evaluates i
      * in the containing scope, and puts x in the loop body's scope.
      */
-    let = (pn->pn_op == JSOP_NOP);
+    DebugOnly<bool> let = (pn->pn_op == JSOP_NOP);
     forInVar = (pn->pn_xflags & PNX_FORINVAR) != 0;
 
     off = noteIndex = -1;
     for (pn2 = pn->pn_head; ; pn2 = next) {
         first = pn2 == pn->pn_head;
         next = pn2->pn_next;
 
         if (pn2->pn_type != TOK_NAME) {
@@ -5949,27 +5949,25 @@ js_EmitTree(JSContext *cx, JSCodeGenerat
             return JS_FALSE;
         }
         break;
       }
 
       case TOK_CATCH:
       {
         ptrdiff_t catchStart, guardJump;
-        JSObject *blockObj;
 
         /*
          * Morph STMT_BLOCK to STMT_CATCH, note the block entry code offset,
          * and save the block object atom.
          */
         stmt = cg->topStmt;
         JS_ASSERT(stmt->type == STMT_BLOCK && (stmt->flags & SIF_SCOPE));
         stmt->type = STMT_CATCH;
         catchStart = stmt->update;
-        blockObj = stmt->blockBox->object;
 
         /* Go up one statement info record to the TRY or FINALLY record. */
         stmt = stmt->down;
         JS_ASSERT(stmt->type == STMT_TRY || stmt->type == STMT_FINALLY);
 
         /* Pick up the pending exception and bind it to the catch variable. */
         if (js_Emit1(cx, cg, JSOP_EXCEPTION) < 0)
             return JS_FALSE;
--- a/js/src/jslock.cpp
+++ b/js/src/jslock.cpp
@@ -587,27 +587,25 @@ ThinUnlock(JSThinLock *tl, jsword /*me*/
  * Invariants:
  * (i)  global lock is held
  * (ii) fl->susp >= 0
  */
 static int
 js_SuspendThread(JSThinLock *tl)
 {
     JSFatLock *fl;
-    PRStatus stat;
-
     if (tl->fat == NULL)
         fl = tl->fat = GetFatlock(tl);
     else
         fl = tl->fat;
     JS_ASSERT(fl->susp >= 0);
     fl->susp++;
     PR_Lock(fl->slock);
     js_UnlockGlobal(tl);
-    stat = PR_WaitCondVar(fl->svar, PR_INTERVAL_NO_TIMEOUT);
+    DebugOnly<PRStatus> stat = PR_WaitCondVar(fl->svar, PR_INTERVAL_NO_TIMEOUT);
     JS_ASSERT(stat != PR_FAILURE);
     PR_Unlock(fl->slock);
     js_LockGlobal(tl);
     fl->susp--;
     if (fl->susp == 0) {
         PutFatlock(fl, tl);
         tl->fat = NULL;
     }
@@ -617,23 +615,21 @@ js_SuspendThread(JSThinLock *tl)
 /*
  * (i)  global lock is held
  * (ii) fl->susp > 0
  */
 static void
 js_ResumeThread(JSThinLock *tl)
 {
     JSFatLock *fl = tl->fat;
-    PRStatus stat;
-
     JS_ASSERT(fl != NULL);
     JS_ASSERT(fl->susp > 0);
     PR_Lock(fl->slock);
     js_UnlockGlobal(tl);
-    stat = PR_NotifyCondVar(fl->svar);
+    DebugOnly<PRStatus> stat = PR_NotifyCondVar(fl->svar);
     JS_ASSERT(stat != PR_FAILURE);
     PR_Unlock(fl->slock);
 }
 
 static void
 js_Enqueue(JSThinLock *tl, jsword me)
 {
     jsword o, n;
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1670,17 +1670,17 @@ DecompileDestructuringLHS(SprintStack *s
  * immediately and return endpc.
  */
 static jsbytecode *
 DecompileDestructuring(SprintStack *ss, jsbytecode *pc, jsbytecode *endpc)
 {
     ptrdiff_t head;
     JSContext *cx;
     JSPrinter *jp;
-    JSOp op, saveop;
+    JSOp op;
     const JSCodeSpec *cs;
     uintN oplen;
     jsint i, lasti;
     jsdouble d;
     const char *lval;
     JSAtom *atom;
     jssrcnote *sn;
     JSBool hole;
@@ -1705,17 +1705,16 @@ DecompileDestructuring(SprintStack *ss, 
     lasti = -1;
 
     while (pc < endpc) {
 #if JS_HAS_DESTRUCTURING_SHORTHAND
         ptrdiff_t nameoff = -1;
 #endif
 
         LOAD_OP_DATA(pc);
-        saveop = op;
 
         switch (op) {
           case JSOP_POP:
             pc += oplen;
             goto out;
 
           /* Handle the optimized number-pushing opcodes. */
           case JSOP_ZERO:   d = i = 0; goto do_getelem;