Bug 1493900. r=bhackett,sunfish
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 25 Sep 2018 12:14:11 +0200
changeset 494700 33454859eab6fbeff45442d9e7e12fbe815f6da1
parent 494699 54252d2fdeee59b40f33fe3847f40bd973a8a315
child 494701 65e444ed5c8cb00d4940f955ed7b7f8403434806
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, sunfish
bugs1493900
milestone64.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 1493900. r=bhackett,sunfish
js/src/jit/BacktrackingAllocator.cpp
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -2065,18 +2065,25 @@ BacktrackingAllocator::resolveControlFlo
 
                 LAllocation* input = phi->getOperand(k);
                 LiveRange* from = vreg(input).rangeFor(exitOf(predecessor), /* preferRegister = */ true);
                 MOZ_ASSERT(from);
 
                 if (!alloc().ensureBallast()) {
                     return false;
                 }
-                if (!moveAtExit(predecessor, from, to, def->type())) {
-                    return false;
+                if (mSuccessor->numPredecessors() > 1) {
+                    MOZ_ASSERT(predecessor->mir()->numSuccessors() == 1);
+                    if (!moveAtExit(predecessor, from, to, def->type())) {
+                        return false;
+                    }
+                } else {
+                    if (!moveAtEntry(successor, from, to, def->type())) {
+                        return false;
+                    }
                 }
             }
         }
     }
 
     // Add moves to resolve graph edges with different allocations at their
     // source and target.
     for (size_t i = 1; i < graph.numVirtualRegisters(); i++) {