Back out 79684dc64173 (bug 898936) for 10.7 debug M4 crashes
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 11 Aug 2013 17:34:20 -0700
changeset 142205 6db59b4778c0d053787c89cee5e510cb468a3fe0
parent 142204 85802e27349c7ddde3d0e15ffb21d05ccdc818f1
child 142206 31796ab06f396bad96165806fc78470493ad793b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs898936
milestone26.0a1
backs out79684dc64173647aa06b678a10422b86450938b1
Back out 79684dc64173 (bug 898936) for 10.7 debug M4 crashes
js/src/jit/BacktrackingAllocator.cpp
js/src/jit/PerfSpewer.cpp
js/src/jit/RegisterAllocator.cpp
js/src/jit/arm/Assembler-arm.h
js/src/jit/arm/CodeGenerator-arm.cpp
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
js/src/jsscript.cpp
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -1184,17 +1184,17 @@ BacktrackingAllocator::dumpLiveness()
 {
 #ifdef DEBUG
     printf("Virtual Registers:\n");
 
     for (size_t blockIndex = 0; blockIndex < graph.numBlocks(); blockIndex++) {
         LBlock *block = graph.getBlock(blockIndex);
         MBasicBlock *mir = block->mir();
 
-        printf("\nBlock %lu", static_cast<unsigned long>(blockIndex));
+        printf("\nBlock %lu", blockIndex);
         for (size_t i = 0; i < mir->numSuccessors(); i++)
             printf(" [successor %u]", mir->getSuccessor(i)->id());
         printf("\n");
 
         for (size_t i = 0; i < block->numPhis(); i++) {
             LPhi *phi = block->getPhi(i);
 
             printf("Phi v%u <-", phi->getDef(0)->virtualRegister());
@@ -1229,17 +1229,17 @@ BacktrackingAllocator::dumpLiveness()
     }
 
     printf("\nLive Ranges:\n\n");
 
     for (size_t i = 0; i < AnyRegister::Total; i++)
         printf("reg %s: %s\n", AnyRegister::FromCode(i).name(), IntervalString(fixedIntervals[i]));
 
     for (size_t i = 0; i < graph.numVirtualRegisters(); i++) {
-        printf("v%lu:", static_cast<unsigned long>(i));
+        printf("v%lu:", i);
         VirtualRegister &vreg = vregs[i];
         for (size_t j = 0; j < vreg.numIntervals(); j++) {
             if (j)
                 printf(" *");
             printf("%s", IntervalString(vreg.getInterval(j)));
         }
         printf("\n");
     }
@@ -1264,17 +1264,17 @@ struct BacktrackingAllocator::PrintLiveI
 
 void
 BacktrackingAllocator::dumpAllocations()
 {
 #ifdef DEBUG
     printf("Allocations:\n");
 
     for (size_t i = 0; i < graph.numVirtualRegisters(); i++) {
-        printf("v%lu:", static_cast<unsigned long>(i));
+        printf("v%lu:", i);
         VirtualRegister &vreg = vregs[i];
         for (size_t j = 0; j < vreg.numIntervals(); j++) {
             if (j)
                 printf(" *");
             LiveInterval *interval = vreg.getInterval(j);
             printf("%s :: %s", IntervalString(interval), interval->getAllocation()->toString());
         }
         printf("\n");
--- a/js/src/jit/PerfSpewer.cpp
+++ b/js/src/jit/PerfSpewer.cpp
@@ -144,17 +144,17 @@ PerfSpewer::writeProfile(JSScript *scrip
 
     uint32_t thisFunctionIndex = nextFunctionIndex++;
 
     if (PerfFuncEnabled()) {
         unsigned long size = (unsigned long) code->instructionsSize();
         if (size > 0) {
             fprintf(fp_,
                     "%lx %lx %s:%d: Func%02d\n",
-                    reinterpret_cast<unsigned long>(code->raw()),
+                    reinterpret_cast<uintptr_t>(code->raw()),
                     size,
                     script->filename(),
                     script->lineno,
                     thisFunctionIndex);
         }
     } else if (PerfBlockEnabled()) {
         uintptr_t funcStart = uintptr_t(code->raw());
         uintptr_t funcEnd = funcStart + code->instructionsSize();
@@ -165,42 +165,40 @@ PerfSpewer::writeProfile(JSScript *scrip
 
             uintptr_t blockStart = funcStart + masm.actualOffset(r.start.offset());
             uintptr_t blockEnd = funcStart + masm.actualOffset(r.end.offset());
 
             JS_ASSERT(cur <= blockStart);
             if (cur < blockStart) {
                 fprintf(fp_,
                         "%lx %lx %s:%d: Func%02d-Block?\n",
-                        static_cast<unsigned long>(cur),
-                        static_cast<unsigned long>(blockStart - cur),
+                        cur, blockStart - cur,
                         script->filename(), script->lineno,
                         thisFunctionIndex);
             }
             cur = blockEnd;
 
             unsigned long size = blockEnd - blockStart;
 
             if (size > 0) {
                 fprintf(fp_,
                         "%lx %lx %s:%d:%d: Func%02d-Block%d\n",
-                        static_cast<unsigned long>(blockStart), size,
+                        blockStart, size,
                         r.filename, r.lineNumber, r.columnNumber,
                         thisFunctionIndex, r.id);
             }
         }
 
         // Any stuff after the basic blocks is presumably OOL code,
         // which I do not currently categorize.
         JS_ASSERT(cur <= funcEnd);
         if (cur < funcEnd) {
             fprintf(fp_,
                     "%lx %lx %s:%d: Func%02d-OOL\n",
-                    static_cast<unsigned long>(cur),
-                    static_cast<unsigned long>(funcEnd - cur),
+                    cur, funcEnd - cur,
                     script->filename(), script->lineno,
                     thisFunctionIndex);
         }
     }
 }
 
 #if defined(JS_ION_PERF)
 void
--- a/js/src/jit/RegisterAllocator.cpp
+++ b/js/src/jit/RegisterAllocator.cpp
@@ -361,17 +361,17 @@ AllocationIntegrityState::dump()
 {
 #ifdef DEBUG
     printf("Register Allocation:\n");
 
     for (size_t blockIndex = 0; blockIndex < graph.numBlocks(); blockIndex++) {
         LBlock *block = graph.getBlock(blockIndex);
         MBasicBlock *mir = block->mir();
 
-        printf("\nBlock %lu", static_cast<unsigned long>(blockIndex));
+        printf("\nBlock %lu", blockIndex);
         for (size_t i = 0; i < mir->numSuccessors(); i++)
             printf(" [successor %u]", mir->getSuccessor(i)->id());
         printf("\n");
 
         for (size_t i = 0; i < block->numPhis(); i++) {
             InstructionInfo &info = blocks[blockIndex].phis[i];
             LPhi *phi = block->getPhi(i);
 
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -567,17 +567,17 @@ struct RIS
         return ShiftAmount;
     }
 
     RIS(uint32_t imm)
       : ShiftAmount(imm)
     {
         JS_ASSERT(ShiftAmount == imm);
     }
-    explicit RIS(Reg r) : ShiftAmount(r.ShiftAmount) {}
+    explicit RIS(Reg r) : ShiftAmount(ShiftAmount) { }
 };
 
 struct RRS
 {
     uint32_t MustZero : 1;
     // the register that holds the shift amount
     uint32_t RS : 4;
 
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -1035,17 +1035,17 @@ class js::ion::OutOfLineTableSwitch : pu
     }
 };
 
 bool
 CodeGeneratorARM::visitOutOfLineTableSwitch(OutOfLineTableSwitch *ool)
 {
     MTableSwitch *mir = ool->mir();
 
-    size_t numCases = mir->numCases();
+    int numCases = mir->numCases();
     for (size_t i = 0; i < numCases; i++) {
         LBlock *caseblock = mir->getCase(numCases - 1 - i)->lir();
         Label *caseheader = caseblock->label();
         uint32_t caseoffset = caseheader->offset();
 
         // The entries of the jump table need to be absolute addresses and thus
         // must be patched after codegen is finished.
         CodeLabel cl = ool->codeLabel(i);
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -3098,17 +3098,20 @@ MacroAssemblerARMCompat::setupUnalignedA
     ma_and(Imm32(~(StackAlignment - 1)), sp, sp);
     ma_push(scratch);
 }
 #ifdef JS_CPU_ARM_HARDFP
 void
 MacroAssemblerARMCompat::passABIArg(const MoveOperand &from)
 {
     MoveOperand to;
+    uint32_t increment = 1;
+    bool useResolver = true;
     ++passedArgs_;
+    Move::Kind kind = Move::GENERAL;
     if (!enoughMemory_)
         return;
     if (from.isDouble()) {
         FloatRegister fr;
         if (GetFloatArgReg(usedIntSlots_, usedFloatSlots_, &fr)) {
             if (!from.isFloatReg() || from.floatReg() != fr) {
                 enoughMemory_ = moveResolver_.addMove(from, MoveOperand(fr), Move::DOUBLE);
             }
--- a/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
+++ b/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
@@ -47,17 +47,17 @@ struct Pool
     // Lastly, it may be beneficial to interleave the pools.  I have absolutely no idea
     // how that will work, but my suspicions are that it will be difficult.
 
     BufferOffset limitingUser;
     int limitingUsee;
 
     Pool(int maxOffset_, int immSize_, int instSize_, int bias_, int alignment_, LifoAlloc &LifoAlloc_,
          bool isBackref_ = false, bool canDedup_ = false, Pool *other_ = NULL)
-        : maxOffset(maxOffset_), immSize(immSize_), instSize(instSize_),
+        : maxOffset(maxOffset_), immSize(immSize_), instSize(instSize),
           bias(bias_), alignment(alignment_),
           isBackref(isBackref_), canDedup(canDedup_), other(other_),
           poolData(static_cast<uint8_t *>(LifoAlloc_.alloc(8*immSize))), numEntries(0),
           buffSize(8), loadOffsets(), limitingUser(), limitingUsee(INT_MIN)
     {
     }
     static const int garbage=0xa5a5a5a5;
     Pool() : maxOffset(garbage), immSize(garbage), instSize(garbage), bias(garbage),
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -159,17 +159,17 @@ Bindings::switchToScriptStorage(Binding 
 bool
 Bindings::clone(JSContext *cx, InternalBindingsHandle self,
                 uint8_t *dstScriptData, HandleScript srcScript)
 {
     /* The clone has the same bindingArray_ offset as 'src'. */
     Bindings &src = srcScript->bindings;
     ptrdiff_t off = (uint8_t *)src.bindingArray() - srcScript->data;
     JS_ASSERT(off >= 0);
-    JS_ASSERT(size_t(off) <= srcScript->dataSize);
+    JS_ASSERT(off <= srcScript->dataSize);
     Binding *dstPackedBindings = (Binding *)(dstScriptData + off);
 
     /*
      * Since atoms are shareable throughout the runtime, we can simply copy
      * the source's bindingArray directly.
      */
     if (!initWithTemporaryStorage(cx, self, src.numArgs(), src.numVars(), src.bindingArray()))
         return false;