Bug 1315901 - make MIPS simulators compile + reduce warnings a little. r=hev
authorLars T Hansen <lhansen@mozilla.com>
Tue, 08 Nov 2016 10:16:04 +0100
changeset 321926 560a32f9d49fe46e9d64d77b8efd7f69ef0ead64
parent 321925 7625f17309bf6bb28d8ae9adb61c031e965c8247
child 321927 788c788561b43fc079572b32d75e7f2f1f13cd41
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewershev
bugs1315901
milestone52.0a1
Bug 1315901 - make MIPS simulators compile + reduce warnings a little. r=hev
js/src/jit/mips-shared/Assembler-mips-shared.h
js/src/jit/mips32/Simulator-mips32.cpp
js/src/jit/mips64/Simulator-mips64.cpp
js/src/jit/mips64/Trampoline-mips64.cpp
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -489,17 +489,17 @@ class BOffImm16
 
     explicit BOffImm16(int offset)
       : data ((offset - 4) >> 2 & Imm16Mask)
     {
         MOZ_ASSERT((offset & 0x3) == 0);
         MOZ_ASSERT(IsInRange(offset));
     }
     static bool IsInRange(int offset) {
-        if ((offset - 4) < (INT16_MIN << 2))
+        if ((offset - 4) < int(unsigned(INT16_MIN) << 2))
             return false;
         if ((offset - 4) > (INT16_MAX << 2))
             return false;
         return true;
     }
     static const uint32_t INVALID = 0x00020000;
     BOffImm16()
       : data(INVALID)
@@ -631,17 +631,17 @@ class GSImm13
     }
     int32_t decodeSigned() {
         return value;
     }
     uint32_t decodeUnsigned() {
         return value;
     }
     static bool IsInRange(int32_t imm) {
-        return imm >= (-256 << 4) && imm <= (255 << 4);
+        return imm >= int32_t(uint32_t(-256) << 4) && imm <= (255 << 4);
     }
 };
 
 class Operand
 {
   public:
     enum Tag {
         REG,
--- a/js/src/jit/mips32/Simulator-mips32.cpp
+++ b/js/src/jit/mips32/Simulator-mips32.cpp
@@ -1611,130 +1611,130 @@ Simulator::get_pc() const
 // executed in the simulator.  Since the host is typically IA32 we will not
 // get the correct MIPS-like behaviour on unaligned accesses.
 
 int
 Simulator::readW(uint32_t addr, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory read from bad address: 0x%08x, pc=0x%08x\n",
+        printf("Memory read from bad address: 0x%08x, pc=0x%08" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & kPointerAlignmentMask) == 0) {
         intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned read at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned read at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeW(uint32_t addr, int value, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory write to bad address: 0x%08x, pc=0x%08x\n",
+        printf("Memory write to bad address: 0x%08x, pc=0x%08" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & kPointerAlignmentMask) == 0) {
         intptr_t* ptr = reinterpret_cast<intptr_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned write at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned write at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 double
 Simulator::readD(uint32_t addr, SimInstruction* instr)
 {
     if ((addr & kDoubleAlignmentMask) == 0) {
         double* ptr = reinterpret_cast<double*>(addr);
         return *ptr;
     }
-    printf("Unaligned (double) read at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned (double) read at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeD(uint32_t addr, double value, SimInstruction* instr)
 {
     if ((addr & kDoubleAlignmentMask) == 0) {
         double* ptr = reinterpret_cast<double*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned (double) write at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned (double) write at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 uint16_t
 Simulator::readHU(uint32_t addr, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned unsigned halfword read at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned unsigned halfword read at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 int16_t
 Simulator::readH(uint32_t addr, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         int16_t* ptr = reinterpret_cast<int16_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned signed halfword read at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned signed halfword read at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeH(uint32_t addr, uint16_t value, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned unsigned halfword write at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned unsigned halfword write at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 void
 Simulator::writeH(uint32_t addr, int16_t value, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         int16_t* ptr = reinterpret_cast<int16_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned halfword write at 0x%08x, pc=0x%08x\n",
+    printf("Unaligned halfword write at 0x%08x, pc=0x%08" PRIxPTR "\n",
            addr,
            reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 uint32_t
 Simulator::readBU(uint32_t addr)
 {
@@ -1789,17 +1789,17 @@ Simulator::overRecursedWithExtra(uint32_
     uintptr_t newsp = getRegister(sp) - extra;
     return newsp <= stackLimit();
 }
 
 // Unsupported instructions use format to print an error and stop execution.
 void
 Simulator::format(SimInstruction* instr, const char* format)
 {
-    printf("Simulator found unsupported instruction:\n 0x%08x: %s\n",
+    printf("Simulator found unsupported instruction:\n 0x%08" PRIxPTR ": %s\n",
            reinterpret_cast<intptr_t>(instr), format);
     MOZ_CRASH();
 }
 
 // Note: With the code below we assume that all runtime calls return a 64 bits
 // result. If they don't, the v1 result register contains a bogus value, which
 // is fine because it is caller-saved.
 typedef int64_t (*Prototype_General0)();
--- a/js/src/jit/mips64/Simulator-mips64.cpp
+++ b/js/src/jit/mips64/Simulator-mips64.cpp
@@ -26,16 +26,17 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "jit/mips64/Simulator-mips64.h"
 
 #include "mozilla/Casting.h"
 #include "mozilla/FloatingPoint.h"
+#include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MathAlgorithms.h"
 
 #include <float.h>
 
 #include "jit/mips64/Assembler-mips64.h"
 #include "threading/LockGuard.h"
 #include "vm/Runtime.h"
@@ -567,18 +568,18 @@ Simulator::Create(JSContext* cx)
         return nullptr;
     }
 
     if (getenv("MIPS_SIM_ICACHE_CHECKS"))
         Simulator::ICacheCheckingEnabled = true;
 
     int64_t stopAt;
     char* stopAtStr = getenv("MIPS_SIM_STOP_AT");
-    if (stopAtStr && sscanf(stopAtStr, "%ld", &stopAt) == 1) {
-        fprintf(stderr, "\nStopping simulation at icount %ld\n", stopAt);
+    if (stopAtStr && sscanf(stopAtStr, "%" PRIi64, &stopAt) == 1) {
+        fprintf(stderr, "\nStopping simulation at icount %" PRIi64 "\n", stopAt);
         Simulator::StopSimAt = stopAt;
     }
 
     return sim;
 }
 
 void
 Simulator::Destroy(Simulator* sim)
@@ -680,18 +681,18 @@ MipsDebugger::getValue(const char* desc,
 {
     Register reg = Register::FromName(desc);
     if (reg != InvalidReg) {
         *value = getRegisterValue(reg.code());
         return true;
     }
 
     if (strncmp(desc, "0x", 2) == 0)
-        return sscanf(desc, "%lx", reinterpret_cast<uint64_t*>(value)) == 1;
-    return sscanf(desc, "%li", value) == 1;
+        return sscanf(desc, "%" PRIu64, reinterpret_cast<uint64_t*>(value)) == 1;
+    return sscanf(desc, "%" PRIi64, value) == 1;
 }
 
 bool
 MipsDebugger::setBreakpoint(SimInstruction* breakpc)
 {
     // Check if a breakpoint can be set. If not return without any side-effects.
     if (sim_->break_pc_ != nullptr)
         return false;
@@ -731,40 +732,40 @@ MipsDebugger::redoBreakpoints()
 }
 
 void
 MipsDebugger::printAllRegs()
 {
     int64_t value;
     for (uint32_t i = 0; i < Registers::Total; i++) {
         value = getRegisterValue(i);
-        printf("%3s: 0x%016lx %20ld   ", Registers::GetName(i), value, value);
+        printf("%3s: 0x%016" PRIx64 " %20" PRIi64 "   ", Registers::GetName(i), value, value);
 
         if (i % 2)
             printf("\n");
     }
     printf("\n");
 
     value = getRegisterValue(Simulator::LO);
-    printf(" LO: 0x%016lx %20ld   ", value, value);
+    printf(" LO: 0x%016" PRIx64 " %20" PRIi64 "   ", value, value);
     value = getRegisterValue(Simulator::HI);
-    printf(" HI: 0x%016lx %20ld\n", value, value);
+    printf(" HI: 0x%016" PRIx64 " %20" PRIi64 "\n", value, value);
     value = getRegisterValue(Simulator::pc);
-    printf(" pc: 0x%016lx\n", value);
+    printf(" pc: 0x%016" PRIx64 "\n", value);
 }
 
 void
 MipsDebugger::printAllRegsIncludingFPU()
 {
     printAllRegs();
 
     printf("\n\n");
     // f0, f1, f2, ... f31.
     for (uint32_t i = 0; i < FloatRegisters::TotalPhys; i++) {
-        printf("%3s: 0x%016lx\tflt: %-8.4g\tdbl: %-16.4g\n",
+        printf("%3s: 0x%016" PRIi64 "\tflt: %-8.4g\tdbl: %-16.4g\n",
                FloatRegisters::GetName(i),
                getFPURegisterValueLong(i),
                getFPURegisterValueFloat(i),
                getFPURegisterValueDouble(i));
     }
 }
 
 static char*
@@ -902,19 +903,19 @@ MipsDebugger::debug()
                         printAllRegs();
                     } else if (strcmp(arg1, "allf") == 0) {
                         printAllRegsIncludingFPU();
                     } else {
                         Register reg = Register::FromName(arg1);
                         FloatRegisters::Encoding fReg = FloatRegisters::FromName(arg1);
                         if (reg != InvalidReg) {
                             value = getRegisterValue(reg.code());
-                            printf("%s: 0x%016lx %20ld \n", arg1, value, value);
+                            printf("%s: 0x%016" PRIi64 " %20" PRIi64 " \n", arg1, value, value);
                         } else if (fReg != FloatRegisters::Invalid) {
-                            printf("%3s: 0x%016lx\tflt: %-8.4g\tdbl: %-16.4g\n",
+                            printf("%3s: 0x%016" PRIi64 "\tflt: %-8.4g\tdbl: %-16.4g\n",
                                    FloatRegisters::GetName(fReg),
                                    getFPURegisterValueLong(fReg),
                                    getFPURegisterValueFloat(fReg),
                                    getFPURegisterValueDouble(fReg));
                         } else {
                             printf("%s unrecognized\n", arg1);
                         }
                     }
@@ -944,17 +945,17 @@ MipsDebugger::debug()
                 } else {
                     if (!getValue(argv[next_arg], &words)) {
                         words = 10;
                     }
                 }
                 end = cur + words;
 
                 while (cur < end) {
-                    printf("  %p:  0x%016lx %20ld", cur, *cur, *cur);
+                    printf("  %p:  0x%016" PRIx64 " %20" PRIi64, cur, *cur, *cur);
                     printf("\n");
                     cur++;
                 }
 
             } else if ((strcmp(cmd, "disasm") == 0) ||
                        (strcmp(cmd, "dpc") == 0) ||
                        (strcmp(cmd, "di") == 0)) {
                 uint8_t* cur = nullptr;
@@ -1633,197 +1634,197 @@ Simulator::writeB(uint64_t addr, int8_t 
 
 uint16_t
 Simulator::readHU(uint64_t addr, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned unsigned halfword read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned unsigned halfword read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 int16_t
 Simulator::readH(uint64_t addr, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         int16_t* ptr = reinterpret_cast<int16_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned signed halfword read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned signed halfword read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeH(uint64_t addr, uint16_t value, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         uint16_t* ptr = reinterpret_cast<uint16_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned unsigned halfword write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned unsigned halfword write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 void
 Simulator::writeH(uint64_t addr, int16_t value, SimInstruction* instr)
 {
     if ((addr & 1) == 0) {
         int16_t* ptr = reinterpret_cast<int16_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned halfword write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned halfword write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 uint32_t
 Simulator::readWU(uint64_t addr, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory read from bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory read from bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & 3) == 0) {
         uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 int32_t
 Simulator::readW(uint64_t addr, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory read from bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory read from bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & 3) == 0) {
         int32_t* ptr = reinterpret_cast<int32_t*>(addr);
         return *ptr;
     }
-    printf("Unaligned read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeW(uint64_t addr, uint32_t value, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory write to bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory write to bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & 3) == 0) {
         uint32_t* ptr = reinterpret_cast<uint32_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 void
 Simulator::writeW(uint64_t addr, int32_t value, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory write to bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory write to bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & 3) == 0) {
         int32_t* ptr = reinterpret_cast<int32_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 int64_t
 Simulator::readDW(uint64_t addr, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory read from bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory read from bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & kPointerAlignmentMask) == 0) {
         int64_t* ptr = reinterpret_cast<int64_t*>(addr);
         return* ptr;
     }
-    printf("Unaligned read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeDW(uint64_t addr, int64_t value, SimInstruction* instr)
 {
     if (addr < 0x400) {
         // This has to be a NULL-dereference, drop into debugger.
-        printf("Memory write to bad address: 0x%016lx, pc=0x%016lx\n",
+        printf("Memory write to bad address: 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
                addr, reinterpret_cast<intptr_t>(instr));
         MOZ_CRASH();
     }
     if ((addr & kPointerAlignmentMask) == 0) {
         int64_t* ptr = reinterpret_cast<int64_t*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 double
 Simulator::readD(uint64_t addr, SimInstruction* instr)
 {
     if ((addr & kDoubleAlignmentMask) == 0) {
         double* ptr = reinterpret_cast<double*>(addr);
         return *ptr;
     }
-    printf("Unaligned (double) read at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned (double) read at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
     return 0;
 }
 
 void
 Simulator::writeD(uint64_t addr, double value, SimInstruction* instr)
 {
     if ((addr & kDoubleAlignmentMask) == 0) {
         double* ptr = reinterpret_cast<double*>(addr);
         *ptr = value;
         return;
     }
-    printf("Unaligned (double) write at 0x%016lx, pc=0x%016lx\n",
+    printf("Unaligned (double) write at 0x%016" PRIx64 ", pc=0x%016" PRIxPTR "\n",
            addr, reinterpret_cast<intptr_t>(instr));
     MOZ_CRASH();
 }
 
 uintptr_t
 Simulator::stackLimit() const
 {
     return stackLimit_;
@@ -2116,17 +2117,17 @@ Simulator::isWatchpoint(uint32_t code)
     return (code <= kMaxWatchpointCode);
 }
 
 void
 Simulator::printWatchpoint(uint32_t code)
 {
     MipsDebugger dbg(this);
     ++break_count_;
-    printf("\n---- break %d marker: %20ld  (instr count: %20ld) ----\n",
+    printf("\n---- break %d marker: %20" PRIi64 "  (instr count: %20" PRIi64 ") ----\n",
            code, break_count_, icount_);
     dbg.printAllRegs();  // Print registers and continue running.
 }
 
 void
 Simulator::handleStop(uint32_t code, SimInstruction* instr)
 {
     // Stop if it is enabled, otherwise go on jumping over the stop
--- a/js/src/jit/mips64/Trampoline-mips64.cpp
+++ b/js/src/jit/mips64/Trampoline-mips64.cpp
@@ -458,17 +458,17 @@ JitRuntime::generateArgumentsRectifier(J
     // arguments to push to the stack.  Then we push a JitFrameLayout.  We
     // compute the padding expressed in the number of extra |undefined| values
     // to push on the stack.
     static_assert(sizeof(JitFrameLayout) % JitStackAlignment == 0,
       "No need to consider the JitFrameLayout for aligning the stack");
     static_assert(JitStackAlignment % sizeof(Value) == 0,
       "Ensure that we can pad the stack by pushing extra UndefinedValue");
 
-    MOZ_ASSERT(IsPowerOfTwo(JitStackValueAlignment));
+    MOZ_ASSERT(mozilla::IsPowerOfTwo(JitStackValueAlignment));
     masm.add32(Imm32(JitStackValueAlignment - 1 /* for padding */ + 1 /* for |this| */), numArgsReg);
     masm.add32(t2, numArgsReg);
     masm.and32(Imm32(~(JitStackValueAlignment - 1)), numArgsReg);
 
     // Load the number of |undefined|s to push into t1.
     masm.as_dsubu(t1, numArgsReg, s3);
 
     // Caller: