Bug 1011745 - Correctly distinguish loop header phis. r=h4writer, a=abillings
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 19 Jun 2014 02:01:03 -0700
changeset 207296 6a25264574f93c4db5e539a7c178b2a970c719f9
parent 207295 006afc4e12202a8892ddeec543c0fdd1eb74197e
child 207297 59fe7d610045a4ef157dc480f2d1dae68c0dbde3
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersh4writer, abillings
bugs1011745
milestone32.0a2
Bug 1011745 - Correctly distinguish loop header phis. r=h4writer, a=abillings
js/src/jit/MIRGraph.cpp
--- a/js/src/jit/MIRGraph.cpp
+++ b/js/src/jit/MIRGraph.cpp
@@ -1136,17 +1136,17 @@ MBasicBlock::removePredecessor(MBasicBlo
 void
 MBasicBlock::inheritPhis(MBasicBlock *header)
 {
     MResumePoint *headerRp = header->entryResumePoint();
     size_t stackDepth = headerRp->numOperands();
     for (size_t slot = 0; slot < stackDepth; slot++) {
         MDefinition *exitDef = getSlot(slot);
         MDefinition *loopDef = headerRp->getOperand(slot);
-        if (!loopDef->isPhi()) {
+        if (loopDef->block() != header) {
             MOZ_ASSERT(loopDef->block()->id() < header->id());
             MOZ_ASSERT(loopDef == exitDef);
             continue;
         }
 
         // Phis are allocated by NewPendingLoopHeader.
         MPhi *phi = loopDef->toPhi();
         MOZ_ASSERT(phi->numOperands() == 2);
@@ -1172,17 +1172,17 @@ MBasicBlock::inheritPhisFromBackedge(MBa
 
     size_t stackDepth = entryResumePoint()->numOperands();
     for (size_t slot = 0; slot < stackDepth; slot++) {
         // Get the value stack-slot of the back edge.
         MDefinition *exitDef = backedge->getSlot(slot);
 
         // Get the value of the loop header.
         MDefinition *loopDef = entryResumePoint()->getOperand(slot);
-        if (!loopDef->isPhi()) {
+        if (loopDef->block() != this) {
             // If we are finishing a pending loop header, then we need to ensure
             // that all operands are phis. This is usualy the case, except for
             // object/arrays build with generators, in which case we share the
             // same allocations across all blocks.
             MOZ_ASSERT(loopDef->block()->id() < id());
             MOZ_ASSERT(loopDef == exitDef);
             continue;
         }