Bug 1464829 - Ensure the recover instruction vector has the expected size. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@gmail.com>
Thu, 31 May 2018 14:22:14 +0200
changeset 802395 931f3ee17589096df1e87223362051c0aec26931
parent 802394 27650b5daf688c22de8a8388fd1c518528d95b59
child 802396 8c5a1c33a487761c2955b3effccdbf893d9dcaeb
child 802406 516d9db19be35ad65ab546e78508f86e29c92522
push id111873
push userrwood@mozilla.com
push dateThu, 31 May 2018 19:20:54 +0000
reviewersjandem
bugs1464829
milestone62.0a1
Bug 1464829 - Ensure the recover instruction vector has the expected size. r=jandem
js/src/jit/JSJitFrameIter.h
js/src/jit/JitFrames.cpp
--- a/js/src/jit/JSJitFrameIter.h
+++ b/js/src/jit/JSJitFrameIter.h
@@ -341,19 +341,17 @@ class RInstructionResults
     RInstructionResults(RInstructionResults&& src);
 
     RInstructionResults& operator=(RInstructionResults&& rhs);
 
     ~RInstructionResults();
 
     MOZ_MUST_USE bool init(JSContext* cx, uint32_t numResults);
     bool isInitialized() const;
-#ifdef DEBUG
     size_t length() const;
-#endif
 
     JitFrameLayout* frame() const;
 
     HeapPtr<Value>& operator[](size_t index);
 
     void trace(JSTracer* trc);
 };
 
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -1489,23 +1489,21 @@ RInstructionResults::init(JSContext* cx,
 }
 
 bool
 RInstructionResults::isInitialized() const
 {
     return initialized_;
 }
 
-#ifdef DEBUG
 size_t
 RInstructionResults::length() const
 {
     return results_->length();
 }
-#endif
 
 JitFrameLayout*
 RInstructionResults::frame() const
 {
     MOZ_ASSERT(fp_);
     return fp_;
 }
 
@@ -1948,17 +1946,17 @@ SnapshotIterator::initInstructionResults
             // If the evaluation failed because of OOMs, then we discard the
             // current set of result that we collected so far.
             fallback.activation->removeIonFrameRecovery(fp);
             return false;
         }
     }
 
     MOZ_ASSERT(results->isInitialized());
-    MOZ_ASSERT(results->length() == recover_.numInstructions() - 1);
+    MOZ_RELEASE_ASSERT(results->length() == recover_.numInstructions() - 1);
     instructionResults_ = results;
     return true;
 }
 
 bool
 SnapshotIterator::computeInstructionResults(JSContext* cx, RInstructionResults* results) const
 {
     MOZ_ASSERT(!results->isInitialized());