Bug 1031877 - OdinMonkey: move some debug assertions on code positions until after they are converted to their actual position. r=luke
authorDouglas Crosher <dtc-moz@scieneer.com>
Sat, 05 Jul 2014 18:49:48 +1000
changeset 192673 37cfa5ad20646e1e893d45ba8757d0d00818aabe
parent 192672 14ab3f4d2526cad435814324118ac58e418a7faa
child 192674 c3c48c1861b1562594d2cc209b50e6545c77d80d
push id27093
push userkwierso@gmail.com
push dateMon, 07 Jul 2014 23:01:28 +0000
treeherdermozilla-central@7f9db2379b3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1031877
milestone33.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 1031877 - OdinMonkey: move some debug assertions on code positions until after they are converted to their actual position. r=luke
js/src/jit/AsmJSModule.cpp
js/src/jit/AsmJSModule.h
--- a/js/src/jit/AsmJSModule.cpp
+++ b/js/src/jit/AsmJSModule.cpp
@@ -332,16 +332,18 @@ AsmJSModule::finish(ExclusiveContext *cx
     for (size_t i = 0; i < callSites_.length(); i++) {
         CallSite &c = callSites_[i];
         c.setReturnAddressOffset(masm.actualOffset(c.returnAddressOffset()));
     }
     for (size_t i = 0; i < codeRanges_.length(); i++) {
         CodeRange &c = codeRanges_[i];
         c.begin_ = masm.actualOffset(c.begin_);
         c.end_ = masm.actualOffset(c.end_);
+        JS_ASSERT(c.begin_ <= c.end_);
+        JS_ASSERT_IF(i > 0, codeRanges_[i - 1].end_ <= c.begin_);
     }
 #endif
     JS_ASSERT(pod.functionBytes_ % AsmJSPageSize == 0);
 
     // Absolute link metadata: absolute addresses that refer to some fixed
     // address in the address space.
     for (size_t i = 0; i < masm.numAsmJSAbsoluteLinks(); i++) {
         AsmJSAbsoluteLink src = masm.asmJSAbsoluteLink(i);
--- a/js/src/jit/AsmJSModule.h
+++ b/js/src/jit/AsmJSModule.h
@@ -692,18 +692,16 @@ class AsmJSModule
     void requireHeapLengthToBeAtLeast(uint32_t len) {
         JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         if (len > pod.minHeapLength_)
             pod.minHeapLength_ = len;
     }
     bool addFunctionCodeRange(PropertyName *name, uint32_t begin, uint32_t end) {
         JS_ASSERT(isFinishedWithModulePrologue() && !isFinishedWithFunctionBodies());
         JS_ASSERT(name->isTenured());
-        JS_ASSERT(begin <= end);
-        JS_ASSERT_IF(!codeRanges_.empty(), codeRanges_.back().end() <= begin);
         if (functionNames_.length() >= UINT32_MAX)
             return false;
         CodeRange codeRange(CodeRange::Function, begin, end, functionNames_.length());
         return functionNames_.append(name) && codeRanges_.append(codeRange);
     }
     bool addEntryCodeRange(unsigned exportIndex, uint32_t end) {
         uint32_t begin = exports_[exportIndex].pod.codeOffset_;
         CodeRange codeRange(CodeRange::Entry, begin, end, UINT32_MAX);