Bug 990764 - Replace MOZ_ASSUME_UNREACHABLE in HTML parser. r=hsivonen
authorChris Peterson <cpeterson@mozilla.com>
Mon, 28 Apr 2014 20:28:54 -0700
changeset 183824 bc0860c0ba33e9f875ed36eaad51cf6710aca5e6
parent 183823 b5b77f70b817959818e8a1aa5692ce4313d308e7
child 183825 63986dce6ab2e3f4682bd380c7e652e2c66af0e8
push id26804
push usercbook@mozilla.com
push dateTue, 20 May 2014 13:27:22 +0000
treeherdermozilla-central@c4142e3c7a6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs990764
milestone32.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 990764 - Replace MOZ_ASSUME_UNREACHABLE in HTML parser. r=hsivonen
parser/html/nsHtml5TreeBuilderCppSupplement.h
--- a/parser/html/nsHtml5TreeBuilderCppSupplement.h
+++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h
@@ -803,17 +803,17 @@ nsHtml5TreeBuilder::accumulateCharacters
   memcpy(charBuffer + charBufferLen, aBuf + aStart, sizeof(char16_t) * aLength);
   charBufferLen = newFillLen;
 }
 
 nsIContentHandle*
 nsHtml5TreeBuilder::AllocateContentHandle()
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never allocate a handle with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never allocate a handle with builder.");
     return nullptr;
   }
   if (mHandlesUsed == NS_HTML5_TREE_BUILDER_HANDLE_ARRAY_LENGTH) {
     mOldHandles.AppendElement(mHandles.forget());
     mHandles = new nsIContent*[NS_HTML5_TREE_BUILDER_HANDLE_ARRAY_LENGTH];
     mHandlesUsed = 0;
   }
 #ifdef DEBUG
@@ -831,17 +831,17 @@ nsHtml5TreeBuilder::HasScript()
   }
   return mOpQueue.ElementAt(len - 1).IsRunScript();
 }
 
 bool
 nsHtml5TreeBuilder::Flush(bool aDiscretionary)
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never flush with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never flush with builder.");
     return false;
   }
   if (!aDiscretionary ||
       !(charBufferLen &&
         currentPtr >= 0 &&
         stack[currentPtr]->isFosterParenting())) {
     // Don't flush text on discretionary flushes if the current element on
     // the stack is a foster-parenting element and there's pending text,
@@ -861,17 +861,17 @@ nsHtml5TreeBuilder::Flush(bool aDiscreti
   mOpQueue.Clear();
   return false;
 }
 
 void
 nsHtml5TreeBuilder::FlushLoads()
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never flush loads with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never flush loads with builder.");
     return;
   }
   if (!mSpeculativeLoadQueue.IsEmpty()) {
     mSpeculativeLoadStage->MoveSpeculativeLoadsFrom(mSpeculativeLoadQueue);
   }
 }
 
 void
@@ -900,44 +900,44 @@ nsHtml5TreeBuilder::StreamEnded()
 }
 
 void
 nsHtml5TreeBuilder::NeedsCharsetSwitchTo(const nsACString& aCharset,
                                          int32_t aCharsetSource,
                                          int32_t aLineNumber)
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never switch charset with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never switch charset with builder.");
     return;
   }
   nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
   NS_ASSERTION(treeOp, "Tree op allocation failed.");
   treeOp->Init(eTreeOpNeedsCharsetSwitchTo,
                aCharset,
                aCharsetSource,
                aLineNumber);
 }
 
 void
 nsHtml5TreeBuilder::MaybeComplainAboutCharset(const char* aMsgId,
                                               bool aError,
                                               int32_t aLineNumber)
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never complain about charset with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never complain about charset with builder.");
     return;
   }
   mOpQueue.AppendElement()->Init(aMsgId, aError, aLineNumber);
 }
 
 void
 nsHtml5TreeBuilder::AddSnapshotToScript(nsAHtml5TreeBuilderState* aSnapshot, int32_t aLine)
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must never use snapshots with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must never use snapshots with builder.");
     return;
   }
   NS_PRECONDITION(HasScript(), "No script to add a snapshot to!");
   NS_PRECONDITION(aSnapshot, "Got null snapshot.");
   mOpQueue.ElementAt(mOpQueue.Length() - 1).SetSnapshot(aSnapshot, aLine);
 }
 
 void
@@ -947,17 +947,17 @@ nsHtml5TreeBuilder::DropHandles()
   mOldHandles.Clear();
   mHandlesUsed = 0;
 }
 
 void
 nsHtml5TreeBuilder::MarkAsBroken()
 {
   if (MOZ_UNLIKELY(mBuilder)) {
-    MOZ_ASSUME_UNREACHABLE("Must not call this with builder.");
+    MOZ_ASSERT_UNREACHABLE("Must not call this with builder.");
     return;
   }
   mOpQueue.Clear(); // Previous ops don't matter anymore
   mOpQueue.AppendElement()->Init(eTreeOpMarkAsBroken);
 }
 
 void
 nsHtml5TreeBuilder::StartPlainTextViewSource(const nsAutoString& aTitle)