本文整理汇总了C++中tr::Block::getFirstRealTreeTop方法的典型用法代码示例。如果您正苦于以下问题:C++ Block::getFirstRealTreeTop方法的具体用法?C++ Block::getFirstRealTreeTop怎么用?C++ Block::getFirstRealTreeTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Block
的用法示例。
在下文中一共展示了Block::getFirstRealTreeTop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collectColdPathLoads
/**
* Search for direct loads in the taken side of a guard
*
* @param firstBlock The guard's branch destination
* @param coldPathLoads BitVector of symbol reference numbers for any direct loads seen until the merge back to mainline
*/
static void collectColdPathLoads(TR::Block* firstBlock, TR_BitVector &coldPathLoads)
{
TR_Stack<TR::Block*> blocksToCheck(TR::comp()->trMemory(), 8, false, stackAlloc);
blocksToCheck.push(firstBlock);
TR::NodeChecklist checklist(TR::comp());
coldPathLoads.empty();
while (!blocksToCheck.isEmpty())
{
TR::Block *block = blocksToCheck.pop();
for (TR::TreeTop *tt = block->getFirstRealTreeTop(); tt->getNode()->getOpCodeValue() != TR::BBEnd; tt = tt->getNextTreeTop())
collectDirectLoads(tt->getNode(), coldPathLoads, checklist);
// Search for any successors that have not merged with the mainline
for (auto itr = block->getSuccessors().begin(), end = block->getSuccessors().end(); itr != end; ++itr)
{
TR::Block *dest = (*itr)->getTo()->asBlock();
if (dest != TR::comp()->getFlowGraph()->getEnd() && dest->getPredecessors().size() == 1)
blocksToCheck.push(dest);
}
}
}
示例2: perform
//.........这里部分代码省略.........
// +-------+ <-- runtimeIns +-------+
// | | | | Guard'|
// | | V +-------+ <-- runtimeIns
// +-------+ +-------+ |
// | Guard | | Guard | V
// +-------+ +-------+ <-- HCRIns +-------+
// | ===> | ===> | Guard |
// V V +-------+ <-- HCRIns
// +-------+ +-------+ |
// | | | | V
// | | | | +-------+
//
// Note we always split the block - this may create an empty block but preserves the incoming
// control flow we leave the rest to block extension to fix later
block = block->split(block->getLastRealTreeTop(), cfg, true, false);
TR::Block *privargIns = block->getPrevBlock();
TR::Block *runtimeIns = block->getPrevBlock();
TR::Block *HCRIns = block;
// New outer guard so cold paths must be evaluated
evaluatedColdPathLoads = false;
// scan for candidate guards to merge with guard1 identified above
for (TR::Block *nextBlock = block->getNextBlock(); nextBlock; nextBlock = nextBlock->getNextBlock())
{
if (!(nextBlock->getPredecessors().size() == 1) ||
!nextBlock->hasPredecessor(block))
{
break;
}
TR::TreeTop *guard2Tree = NULL;
if (isMergeableGuard(nextBlock->getFirstRealTreeTop()->getNode()))
{
guard2Tree = nextBlock->getFirstRealTreeTop();
}
else if (isMergeableGuard(nextBlock->getLastRealTreeTop()->getNode()))
{
guard2Tree = nextBlock->getLastRealTreeTop();
}
else
break;
TR::Node *guard2 = guard2Tree->getNode();
TR::Block *guard2Block = nextBlock;
// It is not possible to shift an OSR guard unless the destination is already an OSR point
// as the necessary OSR state will not be available
if (guard2->isOSRGuard() && !guard1->isOSRGuard())
break;
TR::Block *insertPoint = isStopTheWorldGuard(guard2) ? HCRIns : runtimeIns;
if (!safeToMoveGuard(insertPoint, guard2Tree, guard1->getBranchDestination(), privArgSymRefs))
break;
// now we figure out if we can redirect guard2 to guard1's cold block
// ie can we do the head merge
TR::Block *cold2 = guard2->getBranchDestination()->getEnclosingBlock();
if (guard1->getInlinedSiteIndex() == guard2->getInlinedSiteIndex())
{
if (trace())
traceMsg(comp(), " Guard1 [%p] is guarding the same call as Guard2 [%p] - proceeding with guard merging\n", guard1, guard2);
}
else if (guard2->getInlinedSiteIndex() > -1 &&
guard1->getInlinedSiteIndex() == TR::comp()->getInlinedCallSite(guard2->getInlinedSiteIndex())._byteCodeInfo.getCallerIndex())