Bug 1443727 : [MIPS] Fix miscellaneous build warnings r=bbouvier
authorDragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
Tue, 06 Mar 2018 23:13:00 +0200
changeset 407215 cba4601c84f0
parent 407214 1504df1d9c9e
child 407216 eb84980f64f2
push id33596
push userncsoregi@mozilla.com
push dateFri, 09 Mar 2018 00:18:11 +0000
treeherdermozilla-central@31a33fc61956 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1443727
milestone60.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 1443727 : [MIPS] Fix miscellaneous build warnings r=bbouvier
js/src/jit/mips-shared/Architecture-mips-shared.cpp
js/src/jit/mips-shared/Assembler-mips-shared.h
js/src/jit/mips32/CodeGenerator-mips32.cpp
js/src/jit/mips32/Trampoline-mips32.cpp
--- a/js/src/jit/mips-shared/Architecture-mips-shared.cpp
+++ b/js/src/jit/mips-shared/Architecture-mips-shared.cpp
@@ -30,17 +30,17 @@ get_mips_flags()
 #else
 # ifdef __linux__
     FILE* fp = fopen("/proc/cpuinfo", "r");
     if (!fp)
         return flags;
 
     char buf[1024];
     memset(buf, 0, sizeof(buf));
-    fread(buf, sizeof(char), sizeof(buf) - 1, fp);
+    (void)fread(buf, sizeof(char), sizeof(buf) - 1, fp);
     fclose(fp);
     if (strstr(buf, "FPU"))
         flags |= HWCAP_FPU;
     if (strstr(buf, "Loongson"))
         flags |= HWCAP_LOONGSON;
     if (strstr(buf, "mips32r2") || strstr(buf, "mips64r2"))
         flags |= HWCAP_R2;
 # endif
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -762,19 +762,16 @@ class MIPSBufferWithExecutableCopy : pub
         }
         this->putBytes(numBytes, code);
         return !this->oom();
     }
 };
 
 class AssemblerMIPSShared : public AssemblerShared
 {
-#ifdef JS_JITSPEW
-   Sprinter* printer;
-#endif
   public:
 
     enum Condition {
         Equal,
         NotEqual,
         Above,
         AboveOrEqual,
         Below,
@@ -890,16 +887,20 @@ class AssemblerMIPSShared : public Assem
 
     js::Vector<RelativePatch, 8, SystemAllocPolicy> jumps_;
 
     CompactBufferWriter jumpRelocations_;
     CompactBufferWriter dataRelocations_;
 
     MIPSBufferWithExecutableCopy m_buffer;
 
+#ifdef JS_JITSPEW
+   Sprinter* printer;
+#endif
+
   public:
     AssemblerMIPSShared()
       : m_buffer(),
 #ifdef JS_JITSPEW
        printer(nullptr),
 #endif
        isFinished(false)
     { }
--- a/js/src/jit/mips32/CodeGenerator-mips32.cpp
+++ b/js/src/jit/mips32/CodeGenerator-mips32.cpp
@@ -544,21 +544,16 @@ void
 CodeGeneratorMIPS::visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir)
 {
     Register64 input = ToRegister64(lir->getInt64Operand(0));
     mozilla::DebugOnly<FloatRegister> output = ToFloatRegister(lir->output());
 
     MInt64ToFloatingPoint* mir = lir->mir();
     MIRType toType = mir->type();
 
-    AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
-    regs.take(input.low);
-    regs.take(input.high);
-    Register temp = regs.takeAny();
-
     masm.setupWasmABICall();
     masm.passABIArg(input.high);
     masm.passABIArg(input.low);
 
     if (lir->mir()->isUnsigned())
         if (toType == MIRType::Double)
             masm.callWithABI(mir->bytecodeOffset(), wasm::SymbolicAddress::Uint64ToDouble, MoveOp::DOUBLE);
         else
--- a/js/src/jit/mips32/Trampoline-mips32.cpp
+++ b/js/src/jit/mips32/Trampoline-mips32.cpp
@@ -714,16 +714,17 @@ JitRuntime::generateVMWrapper(JSContext*
             masm.PushEmptyRooted(f.outParamRootType);
             outParamSize = masm.framePushed() - pushed;
         }
         break;
 
       case Type_Bool:
       case Type_Int32:
         MOZ_ASSERT(sizeof(uintptr_t) == sizeof(uint32_t));
+        MOZ_FALLTHROUGH;
       case Type_Pointer:
         outParamSize = sizeof(uintptr_t);
         masm.reserveStack(outParamSize);
         break;
 
       case Type_Double:
         outParamSize = sizeof(double);
         masm.reserveStack(outParamSize);
@@ -826,16 +827,17 @@ JitRuntime::generateVMWrapper(JSContext*
 
       case Type_Value:
         masm.loadValue(Address(StackPointer, 0), JSReturnOperand);
         masm.freeStack(sizeof(Value));
         break;
 
       case Type_Int32:
         MOZ_ASSERT(sizeof(uintptr_t) == sizeof(uint32_t));
+        MOZ_FALLTHROUGH;
       case Type_Pointer:
         masm.load32(Address(StackPointer, 0), ReturnReg);
         masm.freeStack(sizeof(uintptr_t));
         break;
 
       case Type_Bool:
         masm.load8ZeroExtend(Address(StackPointer, 0), ReturnReg);
         masm.freeStack(sizeof(uintptr_t));