Bug 1036781 - Part 8: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/*Allocator.* code. r=jandem
authorChris Peterson <cpeterson@mozilla.com>
Tue, 26 Aug 2014 22:55:24 -0700
changeset 223552 66e350a413a6790c12c5394e4c63049e71e25c5f
parent 223551 1b883c7911746e30bb61791a46dcda69c9331cbd
child 223553 a2a10e38f42d1193b357af480918e206887cc1af
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1036781
milestone34.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 1036781 - Part 8: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/*Allocator.* code. r=jandem
js/src/jit/BacktrackingAllocator.cpp
js/src/jit/ExecutableAllocator.h
js/src/jit/LiveRangeAllocator.cpp
js/src/jit/LiveRangeAllocator.h
js/src/jit/StackSlotAllocator.h
js/src/jit/StupidAllocator.cpp
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -1261,17 +1261,17 @@ BacktrackingAllocator::populateSafepoint
                     safepoint->addNunboxPayload(i, *a);
                     break;
 #else
                   case LDefinition::BOX:
                     safepoint->addBoxedValue(*a);
                     break;
 #endif
                   default:
-                    MOZ_ASSUME_UNREACHABLE("Bad register type");
+                    MOZ_CRASH("Bad register type");
                 }
             }
         }
     }
 
     return true;
 }
 
@@ -1500,17 +1500,17 @@ BacktrackingAllocator::computeSpillWeigh
             usesTotal += 2000;
             break;
 
           case LUse::KEEPALIVE:
             break;
 
           default:
             // Note: RECOVERED_INPUT will not appear in UsePositionIterator.
-            MOZ_ASSUME_UNREACHABLE("Bad use");
+            MOZ_CRASH("Bad use");
         }
     }
 
     // Intervals for registers in groups get higher weights.
     if (interval->hint()->kind() != Requirement::NONE)
         usesTotal += 2000;
 
     // Compute spill weight as a use density, lowering the weight for long
--- a/js/src/jit/ExecutableAllocator.h
+++ b/js/src/jit/ExecutableAllocator.h
@@ -121,17 +121,17 @@ public:
             m_regexpCodeBytes -= n;
             MOZ_ASSERT(m_regexpCodeBytes < m_allocation.size);
             break;
           case OTHER_CODE:
             m_otherCodeBytes -= n;
             MOZ_ASSERT(m_otherCodeBytes < m_allocation.size);
             break;
           default:
-            MOZ_ASSUME_UNREACHABLE("bad code kind");
+            MOZ_CRASH("bad code kind");
         }
 
         release();
     }
 
     ExecutablePool(ExecutableAllocator* allocator, Allocation a)
       : m_allocator(allocator), m_freePtr(a.pages), m_end(m_freePtr + a.size), m_allocation(a),
         m_refCount(1), m_ionCodeBytes(0), m_baselineCodeBytes(0), m_regexpCodeBytes(0),
@@ -156,17 +156,17 @@ private:
         void *result = m_freePtr;
         m_freePtr += n;
 
         switch (kind) {
           case ION_CODE:      m_ionCodeBytes      += n;        break;
           case BASELINE_CODE: m_baselineCodeBytes += n;        break;
           case REGEXP_CODE:   m_regexpCodeBytes   += n;        break;
           case OTHER_CODE:    m_otherCodeBytes    += n;        break;
-          default:            MOZ_ASSUME_UNREACHABLE("bad code kind");
+          default:            MOZ_CRASH("bad code kind");
         }
         return result;
     }
 
     size_t available() const {
         JS_ASSERT(m_end >= m_freePtr);
         return m_end - m_freePtr;
     }
--- a/js/src/jit/LiveRangeAllocator.cpp
+++ b/js/src/jit/LiveRangeAllocator.cpp
@@ -28,17 +28,17 @@ Requirement::priority() const
 
       case Requirement::REGISTER:
         return 1;
 
       case Requirement::NONE:
         return 2;
 
       default:
-        MOZ_ASSUME_UNREACHABLE("Unknown requirement kind.");
+        MOZ_CRASH("Unknown requirement kind.");
     }
 }
 
 const char *
 Requirement::toString() const
 {
 #ifdef DEBUG
     // Not reentrant!
--- a/js/src/jit/LiveRangeAllocator.h
+++ b/js/src/jit/LiveRangeAllocator.h
@@ -154,17 +154,17 @@ UseCompatibleWith(const LUse *use, LAllo
         return alloc.isRegister() || alloc.isMemory();
       case LUse::REGISTER:
         return alloc.isRegister();
       case LUse::FIXED:
           // Fixed uses are handled using fixed intervals. The
           // UsePosition is only used as hint.
         return alloc.isRegister();
       default:
-        MOZ_ASSUME_UNREACHABLE("Unknown use policy");
+        MOZ_CRASH("Unknown use policy");
     }
 }
 
 #ifdef DEBUG
 
 static inline bool
 DefinitionCompatibleWith(LInstruction *ins, const LDefinition *def, LAllocation alloc)
 {
@@ -181,17 +181,17 @@ DefinitionCompatibleWith(LInstruction *i
         return alloc.isFloatReg() == def->isFloatReg();
       case LDefinition::FIXED:
         return alloc == *def->output();
       case LDefinition::MUST_REUSE_INPUT:
         if (!alloc.isRegister() || !ins->numOperands())
             return false;
         return alloc == *ins->getOperand(def->getReusedInput());
       default:
-        MOZ_ASSUME_UNREACHABLE("Unknown definition policy");
+        MOZ_CRASH("Unknown definition policy");
     }
 }
 
 #endif // DEBUG
 
 static inline LDefinition *
 FindReusingDefinition(LInstruction *ins, LAllocation *alloc)
 {
--- a/js/src/jit/StackSlotAllocator.h
+++ b/js/src/jit/StackSlotAllocator.h
@@ -95,17 +95,17 @@ class StackSlotAllocator
 #ifdef JS_NUNBOX32
           case LDefinition::TYPE:
           case LDefinition::PAYLOAD:
 #endif
           case LDefinition::DOUBLE:    return freeDoubleSlot(index);
           case LDefinition::FLOAT32X4:
           case LDefinition::INT32X4:   return freeQuadSlot(index);
         }
-        MOZ_ASSUME_UNREACHABLE("Unknown slot type");
+        MOZ_CRASH("Unknown slot type");
     }
 
     uint32_t allocateSlot(LDefinition::Type type) {
         switch (type) {
 #if JS_BITS_PER_WORD == 32
           case LDefinition::GENERAL:
           case LDefinition::OBJECT:
           case LDefinition::SLOTS:
@@ -123,17 +123,17 @@ class StackSlotAllocator
 #ifdef JS_NUNBOX32
           case LDefinition::TYPE:
           case LDefinition::PAYLOAD:
 #endif
           case LDefinition::DOUBLE:    return allocateDoubleSlot();
           case LDefinition::FLOAT32X4:
           case LDefinition::INT32X4:   return allocateQuadSlot();
         }
-        MOZ_ASSUME_UNREACHABLE("Unknown slot type");
+        MOZ_CRASH("Unknown slot type");
     }
 
     uint32_t stackHeight() const {
         return height_;
     }
 };
 
 } // namespace jit
--- a/js/src/jit/StupidAllocator.cpp
+++ b/js/src/jit/StupidAllocator.cpp
@@ -29,17 +29,17 @@ StupidAllocator::stackLocation(uint32_t 
 
 StupidAllocator::RegisterIndex
 StupidAllocator::registerIndex(AnyRegister reg)
 {
     for (size_t i = 0; i < registerCount; i++) {
         if (reg == registers[i].reg)
             return i;
     }
-    MOZ_ASSUME_UNREACHABLE("Bad register");
+    MOZ_CRASH("Bad register");
 }
 
 bool
 StupidAllocator::init()
 {
     if (!RegisterAllocator::init())
         return false;