Bug 973574 - Fix AutoDebugModeInvalidation to not call FinishDiscardJitCode if it didn't discard JIT code. r=shu
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 18 Feb 2014 10:13:48 +0100
changeset 169605 e007e58149c53e2f0b3ad82c6ee21d1f60cf66fc
parent 169604 3a3f154feea8945ec96ab23c5e220865ca6ae1b1
child 169606 148794d81e95d621050a7b442000e3e678d2cc1d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersshu
bugs973574
milestone30.0a1
Bug 973574 - Fix AutoDebugModeInvalidation to not call FinishDiscardJitCode if it didn't discard JIT code. r=shu
js/src/jit/Ion.cpp
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -2874,12 +2874,14 @@ AutoDebugModeInvalidation::~AutoDebugMod
         } else if (script->hasBaselineScript()) {
             script->baselineScript()->resetActive();
         }
     }
 
     if (comp_) {
         FinishDiscardJitCode(fop, comp_);
     } else {
-        for (CompartmentsInZoneIter comp(zone_); !comp.done(); comp.next())
-            FinishDiscardJitCode(fop, comp);
+        for (CompartmentsInZoneIter comp(zone_); !comp.done(); comp.next()) {
+            if (comp->principals)
+                FinishDiscardJitCode(fop, comp);
+        }
     }
 }