Bug 1310155 - IonMonkey, part 0.1: Make sure to report the out of memory during IonBuilder, r=nbp
authorHannes Verschore <hv1989@gmail.com>
Thu, 08 Dec 2016 13:53:00 -1000
changeset 325456 a0625815bdd078d2a2519ecac5a21691f3772538
parent 325455 28d3c72eaecdc719fa4a01d5bb2d345b216070a9
child 325457 1e24f4d1c415a49452226305d1304ce6b5dc5a97
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersnbp
bugs1310155
milestone53.0a1
Bug 1310155 - IonMonkey, part 0.1: Make sure to report the out of memory during IonBuilder, r=nbp
js/src/jit/IonAnalysis.cpp
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -4181,20 +4181,20 @@ jit::AnalyzeNewScriptDefiniteProperties(
 
     BaselineInspector inspector(script);
     const JitCompileOptions options(cx);
 
     IonBuilder builder(cx, CompileCompartment::get(cx->compartment()), options, &temp, &graph, constraints,
                        &inspector, &info, optimizationInfo, /* baselineFrame = */ nullptr);
 
     if (!builder.build()) {
-        if (cx->isThrowingOverRecursed() ||
-            cx->isThrowingOutOfMemory() ||
-            builder.abortReason() == AbortReason_Alloc)
-        {
+        if (cx->isThrowingOverRecursed() || cx->isThrowingOutOfMemory())
+            return false;
+        if (builder.abortReason() == AbortReason_Alloc) {
+            ReportOutOfMemory(cx);
             return false;
         }
         MOZ_ASSERT(!cx->isExceptionPending());
         return true;
     }
 
     FinishDefinitePropertiesAnalysis(cx, constraints);
 
@@ -4416,18 +4416,22 @@ jit::AnalyzeArgumentsUsage(JSContext* cx
 
     BaselineInspector inspector(script);
     const JitCompileOptions options(cx);
 
     IonBuilder builder(nullptr, CompileCompartment::get(cx->compartment()), options, &temp, &graph, constraints,
                        &inspector, &info, optimizationInfo, /* baselineFrame = */ nullptr);
 
     if (!builder.build()) {
-        if (cx->isThrowingOverRecursed() || builder.abortReason() == AbortReason_Alloc)
+        if (cx->isThrowingOverRecursed() || cx->isThrowingOutOfMemory())
             return false;
+        if (builder.abortReason() == AbortReason_Alloc) {
+            ReportOutOfMemory(cx);
+            return false;
+        }
         MOZ_ASSERT(!cx->isExceptionPending());
         return true;
     }
 
     if (!SplitCriticalEdges(graph)) {
         ReportOutOfMemory(cx);
         return false;
     }