@@ -2145,14 +2145,12 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2145
2145
2146
2146
arg.AbiInfo.SetSplit(true);
2147
2147
arg.AbiInfo.ByteOffset = 0;
2148
- arg.AbiInfo.ByteSize = 0;
2149
2148
unsigned regNumIndex = 0;
2150
2149
for (unsigned i = 0; i < abiInfo.NumSegments; i++)
2151
2150
{
2152
2151
const ABIPassingSegment& segment = abiInfo.Segments[i];
2153
2152
if (segment.IsPassedInRegister())
2154
2153
{
2155
- arg.AbiInfo.ByteSize += segment.Size;
2156
2154
if (regNumIndex < MAX_ARG_REG_COUNT)
2157
2155
{
2158
2156
arg.AbiInfo.SetRegNum(regNumIndex, segment.GetRegister());
@@ -2163,7 +2161,6 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2163
2161
}
2164
2162
else
2165
2163
{
2166
- arg.AbiInfo.ByteSize += roundUp(segment.Size, TARGET_POINTER_SIZE);
2167
2164
assert(segment.GetStackOffset() == 0);
2168
2165
}
2169
2166
}
@@ -2173,7 +2170,6 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2173
2170
// This is a register argument
2174
2171
m_hasRegArgs = true;
2175
2172
2176
- arg.AbiInfo.ByteSize = 0;
2177
2173
unsigned regNumIndex = 0;
2178
2174
for (unsigned i = 0; i < abiInfo.NumSegments; i++)
2179
2175
{
@@ -2185,7 +2181,6 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2185
2181
regNumIndex++;
2186
2182
}
2187
2183
2188
- arg.AbiInfo.ByteSize += segment.Size;
2189
2184
arg.AbiInfo.NumRegs++;
2190
2185
2191
2186
#ifdef TARGET_ARM
@@ -2216,7 +2211,6 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2216
2211
m_hasStackArgs = true;
2217
2212
const ABIPassingSegment& segment = abiInfo.Segments[0];
2218
2213
arg.AbiInfo.SetRegNum(0, REG_STK);
2219
- arg.AbiInfo.ByteSize = roundUp(segment.Size, TARGET_POINTER_SIZE);
2220
2214
arg.AbiInfo.ByteOffset = segment.GetStackOffset();
2221
2215
}
2222
2216
@@ -2249,6 +2243,28 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
2249
2243
}
2250
2244
}
2251
2245
2246
+ if (arg.AbiInfo.PassedByRef)
2247
+ {
2248
+ arg.AbiInfo.ByteSize = TARGET_POINTER_SIZE;
2249
+ }
2250
+ else
2251
+ {
2252
+ unsigned size = argLayout != nullptr ? argLayout->GetSize() : genTypeSize(argSigType);
2253
+
2254
+ // Apple arm64 reuses the same stack slot for multiple args in some
2255
+ // cases; old ABI info reflects that in the size.
2256
+ // Primitives and float HFAs do not necessarily take up full stack
2257
+ // slots.
2258
+ if (compAppleArm64Abi() && (!varTypeIsStruct(argSigType) || (isHfaArg && (hfaType == TYP_FLOAT))))
2259
+ {
2260
+ arg.AbiInfo.ByteSize = size;
2261
+ }
2262
+ else
2263
+ {
2264
+ arg.AbiInfo.ByteSize = roundUp(size, TARGET_POINTER_SIZE);
2265
+ }
2266
+ }
2267
+
2252
2268
if (isHfaArg)
2253
2269
{
2254
2270
arg.AbiInfo.SetHfaType(hfaType, hfaSlots);
@@ -4607,9 +4623,6 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee, const char** failReason)
4607
4623
unsigned calleeArgStackSize = callee->gtArgs.OutgoingArgsStackSize();
4608
4624
unsigned callerArgStackSize = roundUp(lvaParameterStackSize, TARGET_POINTER_SIZE);
4609
4625
4610
- JITDUMP("Caller parameter stack size: %u\n", callerArgStackSize);
4611
- JITDUMP("Callee arguments stack size: %u", calleeArgStackSize);
4612
-
4613
4626
auto reportFastTailCallDecision = [&](const char* thisFailReason) {
4614
4627
if (failReason != nullptr)
4615
4628
{
0 commit comments