本文整理汇总了C++中tr::SymbolReference::isUnresolved方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolReference::isUnresolved方法的具体用法?C++ SymbolReference::isUnresolved怎么用?C++ SymbolReference::isUnresolved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::SymbolReference
的用法示例。
在下文中一共展示了SymbolReference::isUnresolved方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// resolved casts that are not to abstract, interface, or array need a super test
bool OMR::TreeEvaluator::instanceOfOrCheckCastNeedSuperTest(TR::Node * node, TR::CodeGenerator *cg)
{
TR::Node *castClassNode = node->getSecondChild();
TR::MethodSymbol *helperSym = node->getSymbol()->castToMethodSymbol();
TR::SymbolReference *castClassSymRef = castClassNode->getSymbolReference();
if (!TR::TreeEvaluator::isStaticClassSymRef(castClassSymRef))
{
// We could theoretically do a super test on something with no sym, but it would require significant
// changes to platform code. The benefit is little at this point (shows up from reference arraycopy reductions)
if (cg->supportsInliningOfIsInstance() &&
node->getOpCodeValue() == TR::instanceof &&
node->getSecondChild()->getOpCodeValue() != TR::loadaddr)
return true;
else
return false;
}
TR::StaticSymbol *castClassSym = castClassSymRef->getSymbol()->getStaticSymbol();
if (castClassSymRef->isUnresolved())
{
return false;
}
else
{
TR_OpaqueClassBlock * clazz;
// If the class is a regular class (i.e., not an interface nor an array) and
// not known to be a final class, an inline superclass test can be generated.
// If the helper does not preserve all the registers there will not be
// enough registers to do the superclass test inline.
// Also, don't generate the superclass test if optimizing for space.
//
if (castClassSym &&
(clazz = (TR_OpaqueClassBlock *) castClassSym->getStaticAddress()) &&
!TR::Compiler->cls.isClassArray(cg->comp(), clazz) &&
!TR::Compiler->cls.isInterfaceClass(cg->comp(), clazz) &&
!TR::Compiler->cls.isClassFinal(cg->comp(), clazz) &&
helperSym->preservesAllRegisters() &&
!cg->comp()->getOption(TR_OptimizeForSpace))
return true;
}
return false;
}
示例2: if
void
TR_Debug::print(TR::FILE *pOutFile, TR::S390CallSnippet * snippet)
{
uint8_t * bufferPos = snippet->getSnippetLabel()->getCodeLocation();
TR::Node * callNode = snippet->getNode();
TR::SymbolReference * methodSymRef = snippet->getRealMethodSymbolReference();
if(!methodSymRef)
methodSymRef = callNode->getSymbolReference();
TR::MethodSymbol * methodSymbol = methodSymRef->getSymbol()->castToMethodSymbol();
TR::SymbolReference * glueRef;
int8_t padbytes = snippet->getPadBytes();
printSnippetLabel(pOutFile, snippet->getSnippetLabel(), bufferPos,
methodSymRef->isUnresolved() ? "Unresolved Call Snippet" : "Call Snippet");
bufferPos = printS390ArgumentsFlush(pOutFile, callNode, bufferPos, snippet->getSizeOfArguments());
if (methodSymRef->isUnresolved() || _comp->compileRelocatableCode())
{
if (methodSymbol->isSpecial())
{
glueRef = _cg->getSymRef(TR_S390interpreterUnresolvedSpecialGlue);
}
else if (methodSymbol->isStatic())
{
glueRef = _cg->getSymRef(TR_S390interpreterUnresolvedStaticGlue);
}
else
{
glueRef = _cg->getSymRef(TR_S390interpreterUnresolvedDirectVirtualGlue);
}
}
else
{
bool synchronised = methodSymbol->isSynchronised();
if ((methodSymbol->isVMInternalNative() || methodSymbol->isJITInternalNative()))
{
glueRef = _cg->getSymRef(TR_S390nativeStaticHelper);
}
else
{
switch (callNode->getDataType())
{
case TR::NoType:
if (synchronised)
{
glueRef = _cg->getSymRef(TR_S390interpreterSyncVoidStaticGlue);
}
else
{
glueRef = _cg->getSymRef(TR_S390interpreterVoidStaticGlue);
}
break;
case TR::Int8:
case TR::Int16:
case TR::Int32:
if (synchronised)
{
glueRef = _cg->getSymRef(TR_S390interpreterSyncIntStaticGlue);
}
else
{
glueRef = _cg->getSymRef(TR_S390interpreterIntStaticGlue);
}
break;
case TR::Address:
if (TR::Compiler->target.is64Bit())
{
if (synchronised)
{
glueRef = _cg->getSymRef(TR_S390interpreterSyncLongStaticGlue);
}
else
{
glueRef = _cg->getSymRef(TR_S390interpreterLongStaticGlue);
}
}
else
{
if (synchronised)
{
glueRef = _cg->getSymRef(TR_S390interpreterSyncIntStaticGlue);
}
else
{
glueRef = _cg->getSymRef(TR_S390interpreterIntStaticGlue);
}
}
break;
case TR::Int64:
if (synchronised)
{
glueRef = _cg->getSymRef(TR_S390interpreterSyncLongStaticGlue);
}
else
{
//.........这里部分代码省略.........
示例3: if
TR::Register *IA32LinkageUtils::pushIntegerWordArg(
TR::Node *child,
TR::CodeGenerator *cg)
{
TR::Register *pushRegister;
if (child->getRegister() == NULL)
{
if (child->getOpCode().isLoadConst())
{
int32_t value = child->getInt();
TR_X86OpCodes pushOp;
if (value >= -128 && value <= 127)
{
pushOp = PUSHImms;
}
else
{
pushOp = PUSHImm4;
}
generateImmInstruction(pushOp, child, value, cg);
cg->decReferenceCount(child);
return NULL;
}
else if (child->getOpCodeValue() == TR::loadaddr)
{
TR::SymbolReference * symRef = child->getSymbolReference();
TR::StaticSymbol *sym = symRef->getSymbol()->getStaticSymbol();
if (sym)
{
TR_ASSERT(!symRef->isUnresolved(), "pushIntegerWordArg loadaddr expecting resolved symbol");
generateImmSymInstruction(PUSHImm4, child, (uintptrj_t)sym->getStaticAddress(), symRef, cg);
cg->decReferenceCount(child);
return NULL;
}
}
else if (child->getOpCodeValue() == TR::fbits2i &&
!child->normalizeNanValues() &&
child->getReferenceCount() == 1)
{
pushRegister = pushFloatArg(child->getFirstChild(), cg);
cg->decReferenceCount(child);
return pushRegister;
}
else if (child->getOpCode().isMemoryReference() &&
(child->getReferenceCount() == 1) &&
(child->getSymbolReference() != cg->comp()->getSymRefTab()->findVftSymbolRef()))
{
TR::MemoryReference *tempMR = generateX86MemoryReference(child, cg);
generateMemInstruction(PUSHMem, child, tempMR, cg);
tempMR->decNodeReferenceCounts(cg);
cg->decReferenceCount(child);
return NULL;
}
}
pushRegister = cg->evaluate(child);
generateRegInstruction(PUSHReg, child, pushRegister, cg);
cg->decReferenceCount(child);
return pushRegister;
}