Skip to content

Commit

Permalink
Remove and fold calculateActualParameterOffset from Linkage
Browse files Browse the repository at this point in the history
The Power Linkage defines this function which is entirely short-circuited
on all implementations.  Remove it and fold code around it.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
  • Loading branch information
0xdaryl committed May 21, 2019
1 parent 1f17caa commit e83040a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
7 changes: 0 additions & 7 deletions compiler/p/codegen/OMRLinkage.hpp
Expand Up @@ -404,13 +404,6 @@ class OMR_EXTENSIBLE Linkage : public OMR::Linkage

virtual TR::Register *buildIndirectDispatch(TR::Node *callNode) = 0;

// Given an offset (generally into a stack frame) of the slot used
// to hold a parameter, compute the offset of the data itself.
// (in the case of 32-bit slots, the offset will be 3 for a char,
// 2 for a short, 0 for an int.)
//
virtual uintptr_t calculateActualParameterOffset(uintptr_t o, TR::ParameterSymbol& p) { return o; }

TR_ReturnInfo getReturnInfoFromReturnType(TR::DataType);
};
}
Expand Down
26 changes: 2 additions & 24 deletions compiler/p/codegen/PPCSystemLinkage.cpp
Expand Up @@ -436,28 +436,6 @@ TR::PPCSystemLinkage::hasToBeOnStack(TR::ParameterSymbol *parm)
}


uintptr_t
TR::PPCSystemLinkage::calculateActualParameterOffset(
uintptr_t o,
TR::ParameterSymbol& p)
{
TR::ResolvedMethodSymbol * bodySymbol = comp()->getJittedMethodSymbol();
#ifndef TR_TARGET_64BIT
uint32_t bound = sizeof(uint32_t);
#else
size_t bound = sizeof(uint64_t);
#endif
if (1 || (p.getDataType() == TR::Aggregate) || (p.getSize() >= bound))
{
return o;
}
else
{
return o + bound - p.getSize();
}
}


void
TR::PPCSystemLinkage::mapParameters(
TR::ResolvedMethodSymbol *method,
Expand Down Expand Up @@ -485,9 +463,9 @@ TR::PPCSystemLinkage::mapParameters(
while (parmCursor != NULL)
{
if (saveParmsInLocalArea)
parmCursor->setParameterOffset(calculateActualParameterOffset(offset_from_top + stackIndex, *parmCursor));
parmCursor->setParameterOffset(offset_from_top + stackIndex);
else
parmCursor->setParameterOffset(calculateActualParameterOffset(offset_from_top + offsetToFirstParm + stackIndex, *parmCursor));
parmCursor->setParameterOffset(offset_from_top + offsetToFirstParm + stackIndex);
offset_from_top += (parmCursor->getSize() + slot_size - 1) & (~(slot_size - 1));
parmCursor = parameterIterator.getNext();
}
Expand Down
1 change: 0 additions & 1 deletion compiler/p/codegen/PPCSystemLinkage.hpp
Expand Up @@ -50,7 +50,6 @@ class PPCSystemLinkage : public TR::Linkage
PPCSystemLinkage(TR::CodeGenerator *cg);

virtual const TR::PPCLinkageProperties& getProperties();
virtual uintptr_t calculateActualParameterOffset(uintptr_t, TR::ParameterSymbol&);

virtual uint32_t getRightToLeft();
virtual bool hasToBeOnStack(TR::ParameterSymbol *parm);
Expand Down

0 comments on commit e83040a

Please sign in to comment.