Bug 874974. r=bhackett, a=lsblakk
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 22 Jun 2013 20:38:28 +0200
changeset 138785 dbd00c4596939537b1e58ee4e9bd3632556b4610
parent 138784 fa866cae8117597b9df84bcd02ea08272e71a0d1
child 138786 f5fab6506a97bf3288736b6a2bbb69f5766c24fe
push id3903
push userjandemooij@gmail.com
push dateSat, 22 Jun 2013 18:37:09 +0000
treeherdermozilla-aurora@dbd00c459693 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, lsblakk
bugs874974
milestone23.0a2
Bug 874974. r=bhackett, a=lsblakk
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -2921,16 +2921,25 @@ TypeZone::nukeTypes(FreeOp *fop)
 
 void
 TypeCompartment::addPendingRecompile(JSContext *cx, const RecompileInfo &info)
 {
     CompilerOutput *co = info.compilerOutput(cx);
     if (!co)
         return;
 
+    if (compiledInfo.outputIndex == info.outputIndex &&
+        (co->kind() == CompilerOutput::Ion || co->kind() == CompilerOutput::ParallelIon))
+    {
+        /* Tell Ion to discard generated code when it's done. */
+        JS_ASSERT(compiledInfo.outputIndex != RecompileInfo::NoCompilerRunning);
+        co->invalidate();
+        return;
+    }
+
     if (co->pendingRecompilation)
         return;
 
     if (co->isValid())
         CancelOffThreadIonCompile(cx->compartment, co->script);
 
     if (!co->isValid()) {
         JS_ASSERT(co->script == NULL);