Skip to content

Commit

Permalink
Don't use needRelocationsForStatics query when redundant
Browse files Browse the repository at this point in the history
In some situations, this query was being used in addition
to another query that would also return the same answer. Since
it doesn't make sense to use this query anymore (as the other
one is more appropriate given the data type), this commit
removes uses of such queries.

Additionally, use of the new needRelocationsForCurrentMethodPC
query is added for symbol->isCompiledMethod data types.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
  • Loading branch information
dchopra001 committed Dec 4, 2019
1 parent b3b5d92 commit c80bd8c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions compiler/p/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,19 +1587,19 @@ void OMR::Power::MemoryReference::accessStaticItem(TR::Node *node, TR::SymbolRef
loadAddressConstant(cg, true, nodeForSymbol, 1, reg, NULL, false, TR_DebugCounter);
return;
}
if (symbol->isCountForRecompile() && (cg->needRelocationsForPersistentInfoData() || cg->needRelocationsForStatics()))
if (symbol->isCountForRecompile() && cg->needRelocationsForPersistentInfoData())
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, true, nodeForSymbol, TR_CountForRecompile, reg, NULL, false, TR_GlobalValue);
return;
}
else if (symbol->isRecompilationCounter() && (cg->needRelocationsForBodyInfoData() || cg->needRelocationsForStatics()))
else if (symbol->isRecompilationCounter() && cg->needRelocationsForBodyInfoData())
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, true, nodeForSymbol, 1, reg, NULL, false, TR_BodyInfoAddressLoad);
return;
}
else if (symbol->isCompiledMethod() && (cg->comp()->compileRelocatableCode() || cg->comp()->isOutOfProcessCompilation()))
else if (symbol->isCompiledMethod() && cg->needRelocationsForCurrentMethodPC())
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, true, nodeForSymbol, 1, reg, NULL, false, TR_RamMethodSequence);
Expand Down Expand Up @@ -1685,22 +1685,22 @@ void OMR::Power::MemoryReference::accessStaticItem(TR::Node *node, TR::SymbolRef
loadAddressConstant(cg, comp->compileRelocatableCode(), nodeForSymbol, 1, reg, NULL, false, TR_DebugCounter);
return;
}
else if ((refIsUnresolved || cg->needRelocationsForPersistentInfoData() || cg->needRelocationsForStatics()) && symbol->isCountForRecompile())
else if ((refIsUnresolved || cg->needRelocationsForPersistentInfoData()) && symbol->isCountForRecompile())
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, cg->needRelocationsForPersistentInfoData() || cg->needRelocationsForStatics(), nodeForSymbol, TR_CountForRecompile, reg, NULL, false, TR_GlobalValue);
loadAddressConstant(cg, cg->needRelocationsForPersistentInfoData(), nodeForSymbol, TR_CountForRecompile, reg, NULL, false, TR_GlobalValue);
return;
}
else if ((refIsUnresolved || cg->needRelocationsForBodyInfoData() || cg->needRelocationsForStatics()) && symbol->isRecompilationCounter())
else if ((refIsUnresolved || cg->needRelocationsForBodyInfoData()) && symbol->isRecompilationCounter())
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, cg->needRelocationsForBodyInfoData() || cg->needRelocationsForStatics(), nodeForSymbol, 0, reg, NULL, false, TR_BodyInfoAddressLoad);
loadAddressConstant(cg, cg->needRelocationsForBodyInfoData(), nodeForSymbol, 0, reg, NULL, false, TR_BodyInfoAddressLoad);
return;
}
else if (symbol->isCompiledMethod() && (ref->isUnresolved() || comp->compileRelocatableCode() || comp->isOutOfProcessCompilation()))
else if (symbol->isCompiledMethod() && (ref->isUnresolved() || cg->needRelocationsForCurrentMethodPC()))
{
TR::Register *reg = _baseRegister = cg->allocateRegister();
loadAddressConstant(cg, comp->compileRelocatableCode() || comp->isOutOfProcessCompilation(), nodeForSymbol, 0, reg, NULL, false, TR_RamMethodSequence);
loadAddressConstant(cg, cg->needRelocationsForCurrentMethodPC(), nodeForSymbol, 0, reg, NULL, false, TR_RamMethodSequence);
return;
}
else if (symbol->isStartPC() && (ref->isUnresolved() || cg->needRelocationsForCurrentMethodPC()))
Expand Down

0 comments on commit c80bd8c

Please sign in to comment.