Bug 1264948 - Weaken infallible allocator assertion for jsapi-tests. r=sunfish
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 01 Jun 2016 14:43:32 +0000
changeset 340984 8cac3360b8c7438b635d98d6e0ff77437453af46
parent 340983 73c9c54ef08fe1395843aa2ef49ae29ec9149e1c
child 340985 f77dcc75a1295c0caff5bb9fd6698185a1355d23
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssunfish
bugs1264948
milestone49.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 1264948 - Weaken infallible allocator assertion for jsapi-tests. r=sunfish
js/src/jsapi-tests/testJitMinimalFunc.h
js/src/jsapi-tests/testJitRangeAnalysis.cpp
--- a/js/src/jsapi-tests/testJitMinimalFunc.h
+++ b/js/src/jsapi-tests/testJitMinimalFunc.h
@@ -15,20 +15,25 @@
 
 namespace js {
 namespace jit {
 
 struct MinimalAlloc {
     LifoAlloc lifo;
     TempAllocator alloc;
 
+    // We are not testing the fallible allocator in these test cases, thus make
+    // the lifo alloc chunk extremely large for our test cases.
     MinimalAlloc()
-      : lifo(4096),
+      : lifo(128 * 1024),
         alloc(&lifo)
-    { }
+    {
+        if (!alloc.ensureBallast())
+            MOZ_CRASH("[OOM] Not enough RAM for the test.");
+    }
 };
 
 struct MinimalFunc : MinimalAlloc
 {
     JitCompileOptions options;
     CompileInfo info;
     MIRGraph graph;
     MIRGenerator mir;
--- a/js/src/jsapi-tests/testJitRangeAnalysis.cpp
+++ b/js/src/jsapi-tests/testJitRangeAnalysis.cpp
@@ -303,16 +303,19 @@ checkShiftRightRange(int32_t lhsLow, int
     MinimalAlloc func;
     int64_t lhsLower, lhsUpper, rhsLower, rhsUpper;
 
     for (lhsLower = lhsLow; lhsLower <= lhsHigh; lhsLower += lhsInc) {
         for (lhsUpper = lhsLower; lhsUpper <= lhsHigh; lhsUpper += lhsInc) {
             Range* lhsRange = Range::NewInt32Range(func.alloc, lhsLower, lhsUpper);
             for (rhsLower = rhsLow; rhsLower <= rhsHigh; rhsLower += rhsInc) {
                 for (rhsUpper = rhsLower; rhsUpper <= rhsHigh; rhsUpper += rhsInc) {
+                    if (!func.alloc.ensureBallast())
+                        return false;
+
                     Range* rhsRange = Range::NewInt32Range(func.alloc, rhsLower, rhsUpper);
                     Range* result = Range::rsh(func.alloc, lhsRange, rhsRange);
                     int32_t min, max;
                     deriveShiftRightRange(lhsLower, lhsUpper,
                                           rhsLower, rhsUpper,
                                           &min, &max);
                     if (!result->isInt32() ||
                         result->lower() != min ||