From 3e6918c03f38a14e1cd42bb3b54aa87fd47978cb Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 12 Mar 2014 19:30:50 +0100 Subject: [PATCH] Bug 977674: IonMonkey - Only clear recompiling flag if sequentially compiling, r=jandem --- js/src/jit-test/tests/ion/bug977674.js | 39 ++++++++++++++++++++++++++ js/src/jit/Ion.cpp | 5 ++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 js/src/jit-test/tests/ion/bug977674.js diff --git a/js/src/jit-test/tests/ion/bug977674.js b/js/src/jit-test/tests/ion/bug977674.js new file mode 100644 index 000000000000..ddc8636b75ca --- /dev/null +++ b/js/src/jit-test/tests/ion/bug977674.js @@ -0,0 +1,39 @@ + +function testReduce() { + function sum(a, b) { + var r = a + b; + } + var array = build(8 * 0X0aaec , function() { return 1; }); + var parResult = array.reducePar(sum); +} +for (var ix = 0; ix < 3; ++ix) { + testReduce(); +} +function build(n, f) { + var result = []; + for (var i = 0; i < n; i++) + result.push(f(i)); + return result; +} +function seq_scan(array, f) { + for (var i = 1; i < array.length; i++) { + } +} +function assertAlmostEq(v1, v2) { + if (e1 instanceof Array && e2 instanceof Array) { + for (prop in e1) { + if (e1.hasOwnProperty(prop)) { } + } + } +} +function assertEqArray(a, b) { + for (var i = 0, l = a.length; i < l; i++) { + try { } catch (e) { } + } +} +function assertParallelExecWillRecover(opFunction) { +assertParallelExecSucceeds( + function(m) {}, + function(r) {} +); +} diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 9b476a1e860d..777729448e18 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -506,8 +506,9 @@ jit::FinishOffThreadBuilder(IonBuilder *builder) { ExecutionMode executionMode = builder->info().executionMode(); - // Clear the recompiling flag if it would have failed. - if (builder->script()->hasIonScript()) + // Clear the recompiling flag of the old ionScript, since we continue to + // use the old ionScript if recompiling fails. + if (executionMode == SequentialExecution && builder->script()->hasIonScript()) builder->script()->ionScript()->clearRecompiling(); // Clean up if compilation did not succeed.