Bug 850928 - Fix assorted JS compiler warnings. r=dholbert,dvander
authorBenjamin Peterson <benjamin@python.org>
Wed, 13 Mar 2013 19:55:22 -0500
changeset 124777 f7e7835ea89a3c13b5c90e4e519a7813f1934f67
parent 124776 7c406c24a3aebb557691e2485583a7be6c4996c1
child 124778 1987fe6f38d5025374a231b79ad1c28817c265a1
push id24597
push userbenjamin@python.org
push dateThu, 14 Mar 2013 03:54:41 +0000
treeherdermozilla-inbound@f7e7835ea89a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, dvander
bugs850928
milestone22.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 850928 - Fix assorted JS compiler warnings. r=dholbert,dvander
js/src/frontend/BytecodeEmitter.cpp
js/src/ion/BitSet.cpp
js/src/ion/IonCaches.cpp
js/src/ion/MoveResolver.cpp
js/src/ion/shared/IonFrames-x86-shared.cpp
js/src/jscompartment.cpp
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3953,28 +3953,28 @@ EmitLet(JSContext *cx, BytecodeEmitter *
     for (uint32_t i = alreadyPushed; i < blockObjCount; ++i) {
         if (Emit1(cx, bce, JSOP_UNDEFINED) < 0)
             return false;
     }
 
     StmtInfoBCE stmtInfo(cx);
     PushBlockScopeBCE(bce, &stmtInfo, *blockObj, bce->offset());
 
-    ptrdiff_t bodyBegin = bce->offset();
+    DebugOnly<ptrdiff_t> bodyBegin = bce->offset();
     if (!EmitEnterBlock(cx, bce, letBody, JSOP_ENTERLET0))
         return false;
 
     if (!EmitTree(cx, bce, letBody->pn_expr))
         return false;
 
     JSOp leaveOp = letBody->getOp();
     JS_ASSERT(leaveOp == JSOP_LEAVEBLOCK || leaveOp == JSOP_LEAVEBLOCKEXPR);
     EMIT_UINT16_IMM_OP(leaveOp, blockObj->slotCount());
 
-    ptrdiff_t bodyEnd = bce->offset();
+    DebugOnly<ptrdiff_t> bodyEnd = bce->offset();
     JS_ASSERT(bodyEnd > bodyBegin);
 
     return PopStatementBCE(cx, bce);
 }
 #endif
 
 /*
  * Using MOZ_NEVER_INLINE in here is a workaround for llvm.org/pr14047. See
--- a/js/src/ion/BitSet.cpp
+++ b/js/src/ion/BitSet.cpp
@@ -3,16 +3,18 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsutil.h"
 #include "BitSet.h"
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 BitSet *
 BitSet::New(unsigned int max)
 {
     BitSet *result = new BitSet(max);
     if (!result->init())
--- a/js/src/ion/IonCaches.cpp
+++ b/js/src/ion/IonCaches.cpp
@@ -1542,19 +1542,16 @@ bool
 GetElementIC::attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval)
 {
     JS_ASSERT(obj->isNative());
     JS_ASSERT(idval.isInt32());
 
     Label failures;
     MacroAssembler masm(cx);
 
-    Register scratchReg = output().scratchReg().gpr();
-    JS_ASSERT(scratchReg != InvalidReg);
-
     // Guard object's shape.
     RootedObject globalObj(cx, &script->global());
     RootedShape shape(cx, obj->lastProperty());
     if (!shape)
         return false;
     masm.branchTestObjShape(Assembler::NotEqual, object(), shape, &failures);
 
     // Ensure the index is an int32 value.
@@ -1616,18 +1613,18 @@ GetElementIC::attachTypedArrayElement(JS
     Label failures;
     MacroAssembler masm(cx);
 
     // The array type is the object within the table of typed array classes.
     int arrayType = TypedArray::type(obj);
 
     // The output register is not yet specialized as a float register, the only
     // way to accept float typed arrays for now is to return a Value type.
-    bool floatOutput = arrayType == TypedArray::TYPE_FLOAT32 ||
-                       arrayType == TypedArray::TYPE_FLOAT64;
+    DebugOnly<bool> floatOutput = arrayType == TypedArray::TYPE_FLOAT32 ||
+                                  arrayType == TypedArray::TYPE_FLOAT64;
     JS_ASSERT_IF(!output().hasValue(), !floatOutput);
 
     Register tmpReg = output().scratchReg().gpr();
     JS_ASSERT(tmpReg != InvalidReg);
 
     // Check that the typed array is of the same type as the current object
     // because load size differ in function of the typed array data width.
     masm.branchTestObjClass(Assembler::NotEqual, object(), tmpReg, obj->getClass(), &failures);
--- a/js/src/ion/MoveResolver.cpp
+++ b/js/src/ion/MoveResolver.cpp
@@ -2,16 +2,18 @@
  * vim: set ts=4 sw=4 et tw=99:
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MoveResolver.h"
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 MoveResolver::MoveResolver()
   : hasCycles_(false)
 {
 }
 
--- a/js/src/ion/shared/IonFrames-x86-shared.cpp
+++ b/js/src/ion/shared/IonFrames-x86-shared.cpp
@@ -3,16 +3,18 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ion/Ion.h"
 #include "ion/IonFrames.h"
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 IonJSFrameLayout *
 InvalidationBailoutStack::fp() const
 {
     return (IonJSFrameLayout *) (sp() + ionScript_->frameSize());
 }
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -324,17 +324,17 @@ JSCompartment::wrap(JSContext *cx, Mutab
     }
 
     RootedValue key(cx, vp);
 
     /* If we already have a wrapper for this value, use it. */
     if (WrapperMap::Ptr p = crossCompartmentWrappers.lookup(key)) {
         vp.set(p->value);
         if (vp.isObject()) {
-            RawObject obj = &vp.toObject();
+            DebugOnly<RawObject> obj = &vp.toObject();
             JS_ASSERT(obj->isCrossCompartmentWrapper());
             JS_ASSERT(obj->getParent() == global);
         }
         return true;
     }
 
     if (vp.isString()) {
         Rooted<JSLinearString *> str(cx, vp.toString()->ensureLinear(cx));