未验证 提交 d5ab93c4 编写于 作者: J Jan Vorlicek 提交者: GitHub

Fix ArgIterator::GetNextOffset for macOS arm64 (#48632)

* Fix ArgIterator::GetNextOffset for macOS arm64

The ArgIterator::GetNextOffset method was not aligning offsets it returns
for reference types and some others. That was causing coreclr test failures
with GCStress mode 3.

This change fixes it by properly aligning the returned offsets.

* Fix indentation
上级 c9fe433e
......@@ -1437,7 +1437,8 @@ int ArgIteratorTemplate<ARGITERATOR_BASE>::GetNextOffset()
break;
}
const bool isValueType = (argType == ELEMENT_TYPE_VALUETYPE);
const int cbArg = StackElemSize(argSize, isValueType, thValueType.IsFloatHfa());
const bool isFloatHfa = thValueType.IsFloatHfa();
const int cbArg = StackElemSize(argSize, isValueType, isFloatHfa);
if (cFPRegs>0 && !this->IsVarArg())
{
if (cFPRegs + m_idxFPReg <= 8)
......@@ -1495,6 +1496,24 @@ int ArgIteratorTemplate<ARGITERATOR_BASE>::GetNextOffset()
}
}
#ifdef OSX_ARM64_ABI
int alignment;
if (!isValueType)
{
_ASSERTE((cbArg & (cbArg - 1)) == 0);
alignment = cbArg;
}
else if (isFloatHfa)
{
alignment = 4;
}
else
{
alignment = 8;
}
m_ofsStack = (int)ALIGN_UP(m_ofsStack, alignment);
#endif // OSX_ARM64_ABI
int argOfs = TransitionBlock::GetOffsetOfArgs() + m_ofsStack;
m_ofsStack += cbArg;
return argOfs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册