summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/src/jit/BacktrackingAllocator.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp
index 73aceeccb..741ed1592 100644
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -1843,10 +1843,19 @@ BacktrackingAllocator::resolveControlFlow()
LiveRange* from = vreg(input).rangeFor(exitOf(predecessor), /* preferRegister = */ true);
MOZ_ASSERT(from);
- if (!alloc().ensureBallast())
- return false;
- if (!moveAtExit(predecessor, from, to, def->type()))
+ if (!alloc().ensureBallast()) {
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;
+ }
+ }
}
}
}