From e8555b91b51fd4fbd00f3a5c99e029b09d535ee1 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 16 Jun 2013 18:12:35 -0700 Subject: [PATCH] Bug 883691 - Fix some simple clang warnings in SpiderMonkey. r=bhackett. --HG-- extra : rebase_source : 168fe0710a42ebf3f90c14ecb12de32305987586 --- js/src/frontend/Parser.cpp | 3 --- js/src/ion/Lowering.cpp | 2 +- js/src/ion/ParallelFunctions.cpp | 4 ++-- js/src/ion/shared/CodeGenerator-x86-shared.cpp | 2 +- js/src/vm/RegExpObject.cpp | 2 ++ 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index bd9a20930127..88ecb4d22433 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -3505,7 +3505,6 @@ Parser::switchStatement() while ((tt = tokenStream.getToken()) != TOK_RC) { uint32_t caseBegin = tokenStream.currentToken().pos.begin; - ParseNodeKind caseKind; Node caseExpr; switch (tt) { case TOK_DEFAULT: @@ -3514,12 +3513,10 @@ Parser::switchStatement() return null(); } seenDefault = true; - caseKind = PNK_DEFAULT; caseExpr = null(); break; case TOK_CASE: - caseKind = PNK_CASE; caseExpr = expr(); if (!caseExpr) return null(); diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index d5ef296fe055..0c5797160bf3 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1395,7 +1395,7 @@ bool LIRGenerator::visitToDouble(MToDouble *convert) { MDefinition *opd = convert->input(); - MToDouble::ConversionKind conversion = convert->conversion(); + mozilla::DebugOnly conversion = convert->conversion(); switch (opd->type()) { case MIRType_Value: diff --git a/js/src/ion/ParallelFunctions.cpp b/js/src/ion/ParallelFunctions.cpp index f05894ac1490..22f7310c3639 100644 --- a/js/src/ion/ParallelFunctions.cpp +++ b/js/src/ion/ParallelFunctions.cpp @@ -425,11 +425,11 @@ ion::PropagateParallelAbort(JSScript *outermostScript, void ion::ParCallToUncompiledScript(JSFunction *func) { - static const int max_bound_function_unrolling = 5; - JS_ASSERT(InParallelSection()); #ifdef DEBUG + static const int max_bound_function_unrolling = 5; + if (func->hasScript()) { JSScript *script = func->nonLazyScript(); Spew(SpewBailouts, "Call to uncompiled script: %p:%s:%d", diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.cpp b/js/src/ion/shared/CodeGenerator-x86-shared.cpp index f75e02808f70..1c74bcaae480 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-x86-shared.cpp @@ -684,7 +684,7 @@ CodeGeneratorX86Shared::visitDivPowTwoI(LDivPowTwoI *ins) { Register lhs = ToRegister(ins->numerator()); Register lhsCopy = ToRegister(ins->numeratorCopy()); - Register output = ToRegister(ins->output()); + mozilla::DebugOnly output = ToRegister(ins->output()); int32_t shift = ins->shift(); // We use defineReuseInput so these should always be the same, which is diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index b46fb9205f82..087ec0ddaef0 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -581,7 +581,9 @@ RegExpShared::executeMatchOnly(JSContext *cx, const jschar *chars, size_t length if (!compileMatchOnlyIfNecessary(cx)) return RegExpRunStatus_Error; +#ifdef DEBUG const size_t origLength = length; +#endif size_t start = *lastIndex; size_t displacement = 0;