本文整理汇总了C++中tr::Compilation类的典型用法代码示例。如果您正苦于以下问题:C++ Compilation类的具体用法?C++ Compilation怎么用?C++ Compilation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Compilation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RematSafetyInformation
RematSafetyInformation(TR::Compilation *comp) :
dependentSymRefs(getTypedAllocator<TR::SparseBitVector>(comp->allocator())),
argumentTreeTops(getTypedAllocator<TR::TreeTop*>(comp->allocator())),
rematTreeTops(getTypedAllocator<TR::TreeTop*>(comp->allocator())),
comp(comp)
{
}
示例2: sizeof
void
OMR::IlValue::storeToAuto()
{
if (_symRefThatCanBeUsedInOtherBlocks == NULL)
{
TR::Compilation *comp = TR::comp();
// first use from another block, need to create symref and insert store tree where node was computed
TR::SymbolReference *symRef = comp->getSymRefTab()->createTemporary(_methodBuilder->methodSymbol(), _nodeThatComputesValue->getDataType());
symRef->getSymbol()->setNotCollected();
char *name = (char *) comp->trMemory()->allocateHeapMemory((2+10+1) * sizeof(char)); // 2 ("_T") + max 10 digits + trailing zero
sprintf(name, "_T%u", symRef->getCPIndex());
symRef->getSymbol()->getAutoSymbol()->setName(name);
_methodBuilder->defineSymbol(name, symRef);
// create store and its treetop
TR::Node *storeNode = TR::Node::createStore(symRef, _nodeThatComputesValue);
TR::TreeTop *prevTreeTop = _treeTopThatAnchorsValue->getPrevTreeTop();
TR::TreeTop *newTree = TR::TreeTop::create(comp, storeNode);
newTree->insertNewTreeTop(prevTreeTop, _treeTopThatAnchorsValue);
_treeTopThatAnchorsValue->unlink(true);
_treeTopThatAnchorsValue = newTree;
_symRefThatCanBeUsedInOtherBlocks = symRef;
}
}
示例3: getUpdateLocation
void TR::ExternalRelocation::apply(TR::CodeGenerator *codeGen)
{
TR::Compilation *comp = codeGen->comp();
AOTcgDiag1(comp, "TR::ExternalRelocation::apply updateLocation=" POINTER_PRINTF_FORMAT " \n", getUpdateLocation());
uint8_t * relocatableMethodCodeStart = (uint8_t *)comp->getRelocatableMethodCodeStart();
getRelocationRecord()->addRelocationEntry((uint32_t)(getUpdateLocation() - relocatableMethodCodeStart));
}
示例4: getTargetKind
uint8_t TR::ExternalOrderedPair32BitRelocation::collectModifier()
{
TR::Compilation *comp = TR::comp();
uint8_t * relocatableMethodCodeStart = (uint8_t *)comp->getRelocatableMethodCodeStart();
uint8_t * updateLocation;
uint8_t * updateLocation2;
TR_ExternalRelocationTargetKind kind = getTargetKind();
if (TR::Compiler->target.cpu.isPower() &&
(kind == TR_ArrayCopyHelper || kind == TR_ArrayCopyToc || kind == TR_RamMethod || kind == TR_GlobalValue || kind == TR_BodyInfoAddressLoad || kind == TR_DataAddress || kind == TR_DebugCounter))
{
TR::Instruction *instr = (TR::Instruction *)getUpdateLocation();
TR::Instruction *instr2 = (TR::Instruction *)getLocation2();
updateLocation = instr->getBinaryEncoding();
updateLocation2 = instr2->getBinaryEncoding();
}
else
{
updateLocation = getUpdateLocation();
updateLocation2 = getLocation2();
}
int32_t iLoc = updateLocation - relocatableMethodCodeStart;
int32_t iLoc2 = updateLocation2 - relocatableMethodCodeStart;
AOTcgDiag0(comp, "TR::ExternalOrderedPair32BitRelocation::collectModifier\n");
if ( (iLoc < MIN_SHORT_OFFSET || iLoc > MAX_SHORT_OFFSET ) || (iLoc2 < MIN_SHORT_OFFSET || iLoc2 > MAX_SHORT_OFFSET ) )
return RELOCATION_TYPE_WIDE_OFFSET | RELOCATION_TYPE_ORDERED_PAIR;
return RELOCATION_TYPE_ORDERED_PAIR;
}
示例5: if
TR_RuntimeHelper TR::S390CallSnippet::getInterpretedDispatchHelper(
TR::SymbolReference *methodSymRef,
TR::DataType type)
{
TR::Compilation *comp = cg()->comp();
TR::MethodSymbol * methodSymbol = methodSymRef->getSymbol()->castToMethodSymbol();
bool isJitInduceOSRCall = false;
if (methodSymbol->isHelper() &&
methodSymRef->isOSRInductionHelper())
{
isJitInduceOSRCall = true;
}
if (methodSymRef->isUnresolved() || comp->compileRelocatableCode())
{
TR_ASSERT(!isJitInduceOSRCall || !comp->compileRelocatableCode(), "calling jitInduceOSR is not supported yet under AOT\n");
if (methodSymbol->isSpecial())
return TR_S390interpreterUnresolvedSpecialGlue;
else if (methodSymbol->isStatic())
return TR_S390interpreterUnresolvedStaticGlue;
else
return TR_S390interpreterUnresolvedDirectVirtualGlue;
}
else if (isJitInduceOSRCall)
return (TR_RuntimeHelper) methodSymRef->getReferenceNumber();
else
return getHelper(methodSymbol, type, cg());
}
示例6:
void
OMR::CodeGenPhase::performInliningReportPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)
{
TR::Compilation * comp = cg->comp();
if (comp->getOptions()->insertDebuggingCounters()>1)
TR_DebuggingCounters::inliningReportForMethod(comp);
}
示例7: switch
void
TR::PPCImmInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
{
if (needsAOTRelocation())
{
switch(getReloKind())
{
case TR_AbsoluteHelperAddress:
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor, (uint8_t *)getSymbolReference(), TR_AbsoluteHelperAddress, cg()), __FILE__, __LINE__, getNode());
break;
case TR_RamMethod:
if (comp()->getOption(TR_UseSymbolValidationManager))
{
cg()->addExternalRelocation(
new (comp()->trHeapMemory()) TR::ExternalRelocation(
cursor,
(uint8_t *)comp()->getJittedMethodSymbol()->getResolvedMethod()->resolvedMethodAddress(),
(uint8_t *)TR::SymbolType::typeMethod,
TR_SymbolFromManager,
cg()),
__FILE__,
__LINE__,
getNode());
}
else
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor, NULL, TR_RamMethod, cg()), __FILE__, __LINE__, getNode());
}
break;
case TR_BodyInfoAddress:
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor, 0, TR_BodyInfoAddress, cg()), __FILE__, __LINE__, getNode());
break;
default:
TR_ASSERT(false, "Unsupported AOT relocation type specified.");
}
}
TR::Compilation *comp = cg()->comp();
if (std::find(comp->getStaticPICSites()->begin(), comp->getStaticPICSites()->end(), this) != comp->getStaticPICSites()->end())
{
// none-HCR: low-tag to invalidate -- BE or LE is relevant
//
void *valueToHash = *(void**)(cursor - (TR::Compiler->target.is64Bit()?4:0));
void *addressToPatch = TR::Compiler->target.is64Bit()?
(TR::Compiler->target.cpu.isBigEndian()?cursor:(cursor-4)) : cursor;
cg()->jitAddPicToPatchOnClassUnload(valueToHash, addressToPatch);
}
if (std::find(comp->getStaticHCRPICSites()->begin(), comp->getStaticHCRPICSites()->end(), this) != comp->getStaticHCRPICSites()->end())
{
// HCR: whole pointer replacement.
//
void **locationToPatch = (void**)(cursor - (TR::Compiler->target.is64Bit()?4:0));
cg()->jitAddPicToPatchOnClassRedefinition(*locationToPatch, locationToPatch);
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation((uint8_t *)locationToPatch, (uint8_t *)*locationToPatch, TR_HCR, cg()), __FILE__,__LINE__, getNode());
}
}
示例8: mp
void
OMR::CodeGenPhase::performRemoveUnusedLocalsPhase(TR::CodeGenerator * cg, TR::CodeGenPhase * phase)
{
TR::Compilation *comp = cg->comp();
phase->reportPhase(RemoveUnusedLocalsPhase);
TR::LexicalMemProfiler mp(phase->getName(), comp->phaseMemProfiler());
LexicalTimer pt(phase->getName(), comp->phaseTimer());
cg->removeUnusedLocals();
}
示例9: self
bool
OMR::SymbolReference::storeCanBeRemoved()
{
TR::Compilation *comp = TR::comp();
TR::Symbol * s = self()->getSymbol();
return !s->isVolatile() &&
(((s->getDataType() != TR::Double) && (s->getDataType() != TR::Float)) ||
comp->cg()->getSupportsJavaFloatSemantics() ||
(self()->isTemporary(comp) && !s->behaveLikeNonTemp()));
}
示例10: if
bool
OMR::SymbolReference::sharesSymbol(bool includingGCSafePoint)
{
TR::Compilation * c = TR::comp();
if (self()->reallySharesSymbol(c))
return true;
// At this point, we'd like to call getUseDefAliases(c, false) and return
// true iff that is non-NULL. However, doing so caused floatSanity
// (specifically CompactNullChecks) to consume immense amounts (1GB+) of
// memory and run for a long, long time (half an hour or more in some
// cases), so we need to copy some of that logic in here as a short-circuit.
//
// !!! NOTE !!!
// THERE IS A COPY OF THIS LOGIC IN getUseDefAliases
//
int32_t kind = _symbol->getKind();
TR::SymbolReferenceTable * symRefTab = c->getSymRefTab();
switch (kind)
{
case TR::Symbol::IsShadow:
case TR::Symbol::IsStatic:
{
// For unresolved constant dynamic, we need to invoke a Java bootstrap method,
// which can have arbitrary side effects, so the aliasing should be conservative here.
// isConstObjectRef now returns true for condy, so we add an explicit condition,
// more like a short-circuit, to say if we are unresolved and not isConstObjectRef
// (this is the same as before), or if we are unresolved and condy
// (this is the extra condition added), we would return conservative aliases.
if ((self()->isUnresolved() && (_symbol->isConstantDynamic() || !_symbol->isConstObjectRef())) ||
_symbol->isVolatile() || self()->isLiteralPoolAddress() ||
self()->isFromLiteralPool() || _symbol->isUnsafeShadowSymbol() ||
(_symbol->isArrayShadowSymbol() && c->getMethodSymbol()->hasVeryRefinedAliasSets()))
{
// getUseDefAliases might not return NULL
}
else if (!symRefTab->aliasBuilder.mutableGenericIntShadowHasBeenCreated())
{
// getUseDefAliases must return NULL
return false;
}
else if (kind == TR::Symbol::IsStatic && !symRefTab->aliasBuilder.litPoolGenericIntShadowHasBeenCreated())
{
// getUseDefAliases must return NULL
return false;
}
break;
}
}
return !self()->getUseDefAliases(false, includingGCSafePoint).isZero(c);
}
示例11: self
OMR::LabelSymbol::LabelSymbol(TR::CodeGenerator *codeGen, TR::Block *labb) :
TR::Symbol(),
_instruction(NULL),
_codeLocation(NULL),
_estimatedCodeLocation(0),
_snippet(NULL)
{
self()->setIsLabel();
TR::Compilation *comp = TR::comp();
if (comp && comp->getDebug())
comp->getDebug()->newLabelSymbol(self());
}
示例12: cg
void
TR::PPCTrg1Src1ImmInstruction::addMetaDataForCodeAddress(uint8_t *cursor)
{
TR::Compilation *comp = cg()->comp();
if (std::find(comp->getStaticPICSites()->begin(), comp->getStaticPICSites()->end(), this) != comp->getStaticPICSites()->end())
{
cg()->jitAddPicToPatchOnClassUnload((void *)(getSourceImmPtr()), (void *)cursor);
}
if (std::find(comp->getStaticMethodPICSites()->begin(), comp->getStaticMethodPICSites()->end(), this) != comp->getStaticMethodPICSites()->end())
{
cg()->jitAddPicToPatchOnClassUnload((void *) (cg()->fe()->createResolvedMethod(cg()->trMemory(), (TR_OpaqueMethodBlock *) (getSourceImmPtr()), comp->getCurrentMethod())->classOfMethod()), (void *)cursor);
}
}
示例13: findAndMarkBranchTargets
/// called to identify the branches and their targets in the method
/// causes the _blocks array to be filled in with the basic blocks of the method
void findAndMarkBranchTargets()
{
TR::Compilation *comp = this->comp();
if (debug("branchTargets"))
diagnostic("findAndMarkBranchTargets for %s\n", comp->signature());
aboutToFindBranchTargets();
for (ByteCode bc = this->first(); bc != BCunknown; bc = this->next())
{
if (_printByteCodes)
this->printByteCode();
int32_t i = this->bcIndex();
if (this->isBranch())
markTarget(i, this->branchDestination(i) - i);
markAnySpecialBranchTargets(bc);
}
finishedFindingBranchTargets();
}
示例14: getRelocationRecord
void TR::ExternalOrderedPair32BitRelocation::apply(TR::CodeGenerator *codeGen)
{
TR::Compilation *comp = codeGen->comp();
AOTcgDiag0(comp, "TR::ExternalOrderedPair32BitRelocation::apply\n");
TR::IteratedExternalRelocation *rec = getRelocationRecord();
uint8_t *codeStart = (uint8_t *)comp->getRelocatableMethodCodeStart();
TR_ExternalRelocationTargetKind kind = getRelocationRecord()->getTargetKind();
if (TR::Compiler->target.cpu.isPower() &&
(kind == TR_ArrayCopyHelper || kind == TR_ArrayCopyToc || kind == TR_RamMethodSequence || kind == TR_GlobalValue || kind == TR_BodyInfoAddressLoad || kind == TR_DataAddress || kind == TR_DebugCounter))
{
TR::Instruction *instr = (TR::Instruction *)getUpdateLocation();
TR::Instruction *instr2 = (TR::Instruction *)getLocation2();
rec->addRelocationEntry((uint32_t)(instr->getBinaryEncoding() - codeStart));
rec->addRelocationEntry((uint32_t)(instr2->getBinaryEncoding() - codeStart));
}
else
{
rec->addRelocationEntry(getUpdateLocation() - codeStart);
rec->addRelocationEntry(getLocation2() - codeStart);
}
}
示例15: feGetEnv
void
TestCompiler::FrontEnd::generateBinaryEncodingPrologue(
TR_BinaryEncodingData *beData,
TR::CodeGenerator *cg)
{
TR::Compilation* comp = cg->comp();
TR_S390BinaryEncodingData *data = (TR_S390BinaryEncodingData *)beData;
data->cursorInstruction = comp->getFirstInstruction();
data->estimate = 0;
data->preProcInstruction = data->cursorInstruction;
data->jitTojitStart = data->cursorInstruction;
data->cursorInstruction = NULL;
TR::Instruction * preLoadArgs, * endLoadArgs;
preLoadArgs = data->preProcInstruction;
endLoadArgs = preLoadArgs;
TR::Instruction * oldFirstInstruction = data->cursorInstruction;
data->cursorInstruction = comp->getFirstInstruction();
static char *disableAlignJITEP = feGetEnv("TR_DisableAlignJITEP");
// Padding for JIT Entry Point
if (!disableAlignJITEP)
{
data->estimate += 256;
}
while (data->cursorInstruction && data->cursorInstruction->getOpCodeValue() != TR::InstOpCode::PROC)
{
data->estimate = data->cursorInstruction->estimateBinaryLength(data->estimate);
data->cursorInstruction = data->cursorInstruction->getNext();
}
cg->getLinkage()->createPrologue(data->cursorInstruction);
//cg->getLinkage()->analyzePrologue();
}