Bug 1172545 - Recover from OOM if Ion compilation is skipped due to not being able to allocate a 'this' object, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 11 Jun 2015 08:38:59 -0700
changeset 248340 953806f0cc142d6884c7fefcd6dce45783c245dd
parent 248339 dd39dc238ef15255e43ce2b93644f7b05d361725
child 248341 4013640cfeeafc44eda39ca70cb615c1f7160509
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1172545
milestone41.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 1172545 - Recover from OOM if Ion compilation is skipped due to not being able to allocate a 'this' object, r=jandem.
js/src/jit/Ion.cpp
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -2424,18 +2424,20 @@ jit::CanEnter(JSContext* cx, RunState& s
         }
 
         if (TooManyFormalArguments(invoke.args().callee().as<JSFunction>().nargs())) {
             TrackAndSpewIonAbort(cx, script, "too many args");
             ForbidCompilation(cx, script);
             return Method_CantCompile;
         }
 
-        if (!state.maybeCreateThisForConstructor(cx))
+        if (!state.maybeCreateThisForConstructor(cx)) {
+            cx->recoverFromOutOfMemory();
             return Method_Skipped;
+        }
     }
 
     // If --ion-eager is used, compile with Baseline first, so that we
     // can directly enter IonMonkey.
     if (js_JitOptions.eagerCompilation && !rscript->hasBaselineScript()) {
         MethodStatus status = CanEnterBaselineMethod(cx, state);
         if (status != Method_Compiled)
             return status;