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 350621 29d25f5224ad918470c049f1991628853e1831cd
parent 350620 b35318b86b335200340aad6893828b99c187ad84
child 350622 6b1a3f769aa6d826bd404750e7af66702ff01214
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, ritu
bugs1299108
milestone50.0
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
@@ -2560,16 +2560,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;
     }