Bug 977674: IonMonkey - Only clear recompiling flag if sequentially compiling, r=jandem
authorHannes Verschore <hv1989@gmail.com>
Wed, 12 Mar 2014 19:30:50 +0100
changeset 191421 d45173c0e33894969475262b32a71359164d25f4
parent 191420 5e03967817fab89135cf9f92d768bf50675357bc
child 191422 e8036c3e0a7b242a3dbaa51d9308973635d83a2a
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs977674
milestone30.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 977674: IonMonkey - Only clear recompiling flag if sequentially compiling, r=jandem
js/src/jit-test/tests/ion/bug977674.js
js/src/jit/Ion.cpp
new file mode 100644
--- /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) {}
+);
+}
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -501,18 +501,19 @@ JitCompartment::ensureIonStubsExist(JSCo
     return true;
 }
 
 void
 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.
     if (CompilingOffThread(builder->script(), executionMode))
         SetIonScript(builder->script(), executionMode, nullptr);
 
     // The builder is allocated into its LifoAlloc, so destroying that will
     // destroy the builder and all other data accumulated during compilation,