From f0b829c1ca27ea42c2a8cd56a8dbb6147b83ffe6 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Wed, 16 Dec 2015 17:07:23 -0800 Subject: [PATCH] Bug 1231925 - Correctly recover if allocating tracked optimizations go OOM. (r=jonco) --- js/src/jit-test/tests/profiler/bug1231925.js | 7 +++++++ js/src/jit/CodeGenerator.cpp | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 js/src/jit-test/tests/profiler/bug1231925.js diff --git a/js/src/jit-test/tests/profiler/bug1231925.js b/js/src/jit-test/tests/profiler/bug1231925.js new file mode 100644 index 000000000000..344202ea17a3 --- /dev/null +++ b/js/src/jit-test/tests/profiler/bug1231925.js @@ -0,0 +1,7 @@ +if (!('oomTest' in this)) + quit(); + +enableSPSProfiling(); +oomTest(function() { + eval("(function() {})()") +}); diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 9061f98cdb63..5999fa98d895 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -8217,6 +8217,8 @@ CodeGenerator::link(JSContext* cx, CompilerConstraintList* constraints) (const IonTrackedOptimizationsAttemptsTable*) optsAttemptsTableAddr; entry.initTrackedOptimizations(optsRegionTable, optsTypesTable, optsAttemptsTable, allTypes); + } else { + cx->recoverFromOutOfMemory(); } }