本文整理汇总了C++中tr::Node::mayKill方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::mayKill方法的具体用法?C++ Node::mayKill怎么用?C++ Node::mayKill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Node
的用法示例。
在下文中一共展示了Node::mayKill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isSafeToReplaceNode
//.........这里部分代码省略.........
return false;
bool mayBeVolatileReference = currentNode->mightHaveVolatileSymbolReference();
//if (mayBeVolatileReference)
// return false;
// Now scan forwards through the trees looking for the next use and checking
// to see if any symbols in the subtree are getting modified; if so it is not
// safe to replace the node at its next use.
//
comp->incVisitCount();
for (TR::TreeTop *treeTop = curTreeTop->getNextTreeTop(); treeTop; treeTop = treeTop->getNextTreeTop())
{
TR::Node *node = treeTop->getNode();
if(node->getOpCodeValue() == TR::treetop)
node = node->getFirstChild();
if (node->getOpCodeValue() == TR::BBStart &&
!node->getBlock()->isExtensionOfPreviousBlock())
return true;
if (cantMoveUnderBranch && (node->getOpCode().isBranch()
|| node->getOpCode().isJumpWithMultipleTargets()))
return false;
if (node->canGCandReturn() &&
seenInternalPointer)
return false;
int32_t tempHeight = 0;
int32_t maxHeight = 0;
bool canMoveIfVolatile = true;
if (containsNode(node, currentNode, visitCount, comp, &tempHeight, &maxHeight, canMoveIfVolatile))
{
// TEMPORARY
// Disable moving an unresolved reference down to the middle of a
// JNI call, until the resolve helper is fixed properly
//
if (isUnresolvedReference && node->getFirstChild()->getOpCode().isCall() &&
node->getFirstChild()->getSymbol()->castToMethodSymbol()->isJNI())
return false;
if (curTreeInfo)
{
OMR::TreeInfo *treeInfo = findOrCreateTreeInfo(treeTop, targetTrees, comp);
int32_t height = treeInfo->getHeight();
int32_t maxHeightUsed = maxHeight;
if (maxHeightUsed < curMaxHeight)
maxHeightUsed = curMaxHeight;
if (height < curTreeInfo->getHeight())
height = curTreeInfo->getHeight();
height++;
if ((height+maxHeightUsed) > MAX_ALLOWED_HEIGHT)
{
cannotBeEliminated = true;
return false;
}
treeInfo->setHeight(height);
}
return true;
}
if (mayBeVolatileReference && !canMoveIfVolatile)
return false;
if ((node->getOpCode().isBranch() &&
(node->getOpCodeValue() != TR::Goto)) ||
(node->getOpCode().isJumpWithMultipleTargets() && node->getOpCode().hasBranchChildren()))
*seenConditionalBranch = true;
if (node->getOpCodeValue() == TR::treetop ||
node->getOpCode().isNullCheck() ||
node->getOpCode().isResolveCheck() ||
node->getOpCodeValue() == TR::ArrayStoreCHK ||
node->getOpCode().isSpineCheck())
{
node = node->getFirstChild();
}
if (node->getOpCode().isStore())
{
// For a store, just the single symbol reference is killed.
// Resolution of the store symbol is handled by TR::ResolveCHK
//
if (symbolReferencesInNode.ValueAt(node->getSymbolReference()->getReferenceNumber()))
return false;
}
// Node Aliasing Changes
// Check if the definition modifies any symbol in the subtree
//
if (node->mayKill(true).containsAny(symbolReferencesInNode, comp))
return false;
}
return true;
}