[INFER] Fix warnings.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 15 Aug 2011 11:41:52 -0700
changeset 77436 0d5f119ab1722c0002c367cbf6061585eb54d65b
parent 77435 9cea788e8c07db2610b5c2408add1d5dac82bff0
child 77437 74bfd74ca2895c602d8c3f6269b9ef8106b69723
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone8.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
[INFER] Fix warnings.
js/src/jsanalyze.cpp
js/src/jsobj.cpp
js/src/methodjit/Compiler.cpp
js/src/methodjit/FastBuiltins.cpp
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -885,32 +885,34 @@ ScriptAnalysis::analyzeLifetimes(JSConte
             JS_ASSERT_IF(loop, loop->head < offset);
         }
 
         /* Find the last jump target in the loop, other than the initial entry point. */
         if (loop && code->jumpTarget && offset != loop->entry && offset > loop->lastBlock)
             loop->lastBlock = offset;
 
         if (code->exceptionEntry) {
-            bool found = false;
+            DebugOnly<bool> found = false;
             JSTryNote *tn = script->trynotes()->vector;
             JSTryNote *tnlimit = tn + script->trynotes()->length;
             for (; tn < tnlimit; tn++) {
                 unsigned startOffset = script->main - script->code + tn->start;
                 if (startOffset + tn->length == offset) {
                     /*
                      * Extend all live variables at exception entry to the start of
                      * the try block.
                      */
                     for (unsigned i = 0; i < numSlots; i++) {
                         if (lifetimes[i].lifetime)
                             ensureVariable(lifetimes[i], startOffset - 1);
                     }
 
+#ifdef DEBUG
                     found = true;
+#endif
                     break;
                 }
             }
             JS_ASSERT(found);
         }
 
         switch (op) {
           case JSOP_GETARG:
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3408,17 +3408,17 @@ js_CloneBlockObject(JSContext *cx, JSObj
 {
     JS_ASSERT(proto->isStaticBlock());
 
     size_t count = OBJ_BLOCK_COUNT(cx, proto);
     gc::FinalizeKind kind = gc::GetGCObjectKind(count + 1);
 
     TypeObject *type = proto->getNewType(cx);
     if (!type)
-        return false;
+        return NULL;
 
     JSObject *clone = js_NewGCObject(cx, kind);
     if (!clone)
         return NULL;
 
     StackFrame *priv = js_FloatingFrameIfGenerator(cx, fp);
 
     /* The caller sets parent on its own. */
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -773,17 +773,17 @@ mjit::Compiler::generatePrologue()
              * inspected directly by JIT code, and is not guaranteed to be
              * correct if the UNDERFLOW and OVERFLOW flags are not set.
              */
             Jump hasArgs = masm.branchTest32(Assembler::NonZero, FrameFlagsAddress(),
                                              Imm32(StackFrame::OVERRIDE_ARGS |
                                                    StackFrame::UNDERFLOW_ARGS |
                                                    StackFrame::OVERFLOW_ARGS |
                                                    StackFrame::HAS_ARGS_OBJ));
-            masm.storePtr(ImmPtr((void *) script->function()->nargs),
+            masm.storePtr(ImmPtr((void *)(size_t) script->function()->nargs),
                           Address(JSFrameReg, StackFrame::offsetOfArgs()));
             hasArgs.linkTo(masm.label(), &masm);
         }
     }
 
     if (cx->typeInferenceEnabled()) {
 #ifdef DEBUG
         if (script->hasFunction) {
--- a/js/src/methodjit/FastBuiltins.cpp
+++ b/js/src/methodjit/FastBuiltins.cpp
@@ -87,18 +87,18 @@ mjit::Compiler::compileMathAbsInt(FrameE
 CompileStatus
 mjit::Compiler::compileMathAbsDouble(FrameEntry *arg)
 {
     FPRegisterID fpResultReg = frame.allocFPReg();
 
     FPRegisterID fpReg;
     bool allocate;
 
-    MaybeJump notNumber = loadDouble(arg, &fpReg, &allocate);
-    JS_ASSERT(!notNumber.isSet());
+    DebugOnly<MaybeJump> notNumber = loadDouble(arg, &fpReg, &allocate);
+    JS_ASSERT(!((MaybeJump)notNumber).isSet());
 
     masm.absDouble(fpReg, fpResultReg);
 
     if (allocate)
         frame.freeReg(fpReg);
 
     frame.popn(3);
     frame.pushDouble(fpResultReg);
@@ -109,18 +109,18 @@ mjit::Compiler::compileMathAbsDouble(Fra
 CompileStatus
 mjit::Compiler::compileRound(FrameEntry *arg, RoundingMode mode)
 {
     FPRegisterID fpScratchReg = frame.allocFPReg();
 
     FPRegisterID fpReg;
     bool allocate;
 
-    MaybeJump notNumber = loadDouble(arg, &fpReg, &allocate);
-    JS_ASSERT(!notNumber.isSet());
+    DebugOnly<MaybeJump> notNumber = loadDouble(arg, &fpReg, &allocate);
+    JS_ASSERT(!((MaybeJump)notNumber).isSet());
 
     masm.zeroDouble(fpScratchReg);
 
     /* Slow path for NaN and numbers <= 0. */
     Jump negOrNan = masm.branchDouble(Assembler::DoubleLessThanOrEqualOrUnordered, fpReg, fpScratchReg);
     stubcc.linkExit(negOrNan, Uses(3));
 
     /* For round add 0.5 and floor. */
@@ -156,18 +156,18 @@ mjit::Compiler::compileRound(FrameEntry 
 CompileStatus
 mjit::Compiler::compileMathSqrt(FrameEntry *arg)
 {
     FPRegisterID fpResultReg = frame.allocFPReg();
 
     FPRegisterID fpReg;
     bool allocate;
 
-    MaybeJump notNumber = loadDouble(arg, &fpReg, &allocate);
-    JS_ASSERT(!notNumber.isSet());
+    DebugOnly<MaybeJump> notNumber = loadDouble(arg, &fpReg, &allocate);
+    JS_ASSERT(!((MaybeJump)notNumber).isSet());
 
     masm.sqrtDouble(fpReg, fpResultReg);
 
     if (allocate)
         frame.freeReg(fpReg);
 
     frame.popn(3);
     frame.pushDouble(fpResultReg);
@@ -179,18 +179,18 @@ CompileStatus
 mjit::Compiler::compileMathPowSimple(FrameEntry *arg1, FrameEntry *arg2)
 {
     FPRegisterID fpScratchReg = frame.allocFPReg();
     FPRegisterID fpResultReg = frame.allocFPReg();
 
     FPRegisterID fpReg;
     bool allocate;
 
-    MaybeJump notNumber = loadDouble(arg1, &fpReg, &allocate);
-    JS_ASSERT(!notNumber.isSet());
+    DebugOnly<MaybeJump> notNumber = loadDouble(arg1, &fpReg, &allocate);
+    JS_ASSERT(!((MaybeJump)notNumber).isSet());
 
     /* Slow path for -Infinity (must return Infinity, not NaN). */
     masm.slowLoadConstantDouble(js_NegativeInfinity, fpResultReg);
     Jump isNegInfinity = masm.branchDouble(Assembler::DoubleEqual, fpReg, fpResultReg);
     stubcc.linkExit(isNegInfinity, Uses(4));
 
     /* Convert -0 to +0. */
     masm.zeroDouble(fpResultReg);