Bug 1322724: IonMonkey - Add the hit count information on the extra false branch blocks, r=jandem

This commit is contained in:
Hannes Verschore 2016-12-09 14:14:37 -10:00
Родитель c103851dcd
Коммит 9c4380dcbb
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -1505,6 +1505,11 @@ IonBuilder::visitBlock(const CFGBlock* cfgblock, MBasicBlock* mblock)
if (mblock->pc() && script()->hasScriptCounts()) if (mblock->pc() && script()->hasScriptCounts())
mblock->setHitCount(script()->getHitCount(mblock->pc())); mblock->setHitCount(script()->getHitCount(mblock->pc()));
// Optimization to move a predecessor that only has this block as successor
// just before this block.
if (mblock->numPredecessors() == 1 && mblock->getPredecessor(0)->numSuccessors() == 1)
graph().moveBlockToEnd(mblock->getPredecessor(0));
if (!setCurrentAndSpecializePhis(mblock)) if (!setCurrentAndSpecializePhis(mblock))
return false; return false;
graph().addBlock(mblock); graph().addBlock(mblock);
@ -2846,6 +2851,9 @@ IonBuilder::visitTest(CFGTest* test)
return false; return false;
filterBlock->end(MGoto::New(alloc(), ifFalse)); filterBlock->end(MGoto::New(alloc(), ifFalse));
if (filterBlock->pc() && script()->hasScriptCounts())
filterBlock->setHitCount(script()->getHitCount(filterBlock->pc()));
blockWorklist[test->falseBranch()->id()] = ifFalse; blockWorklist[test->falseBranch()->id()] = ifFalse;
current = nullptr; current = nullptr;
@ -3079,6 +3087,9 @@ IonBuilder::visitTableSwitch(CFGTableSwitch* cfgIns)
} }
graph().addBlock(caseBlock); graph().addBlock(caseBlock);
if (caseBlock->pc() && script()->hasScriptCounts())
caseBlock->setHitCount(script()->getHitCount(caseBlock->pc()));
MBasicBlock* merge = newBlock(caseBlock, cfgblock->startPc()); MBasicBlock* merge = newBlock(caseBlock, cfgblock->startPc());
if (!merge) if (!merge)
return false; return false;