Bug 1299108 - IonMonkey - Make sure we don't compile the same script twice at the same time, r=jandem a=ritu
authorHannes Verschore <hv1989@gmail.com>
Mon, 10 Oct 2016 13:53:35 -0700
changeset 356041 0d808f4fa330c9e9a5b55be52a3bdf6968a5e928
parent 356040 944f5e3f8f87b09eeed9804cd9cf8283a93df213
child 356042 3e11e42465cccc18b08a71b9968dfa97af042568
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, ritu
bugs1299108
milestone51.0a2
Bug 1299108 - IonMonkey - Make sure we don't compile the same script twice at the same time, r=jandem a=ritu
js/src/jit/Ion.cpp
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -2574,16 +2574,21 @@ jit::CanEnter(JSContext* cx, RunState& s
     // If --ion-eager is used, compile with Baseline first, so that we
     // can directly enter IonMonkey.
     if (JitOptions.eagerCompilation && !rscript->hasBaselineScript()) {
         MethodStatus status = CanEnterBaselineMethod(cx, state);
         if (status != Method_Compiled)
             return status;
     }
 
+    // Skip if the script is being compiled off thread (again).
+    // The above lines (invoke) could have started an ion compilation.
+    if (rscript->isIonCompilingOffThread())
+        return Method_Skipped;
+
     // Attempt compilation. Returns Method_Compiled if already compiled.
     bool constructing = state.isInvoke() && state.asInvoke()->constructing();
     MethodStatus status = Compile(cx, rscript, nullptr, nullptr, constructing);
     if (status != Method_Compiled) {
         if (status == Method_CantCompile)
             ForbidCompilation(cx, rscript);
         return status;
     }