@@ -235,17 +235,6 @@ void Compiler::lvaInitTypeRef()
235235
236236 lvaInitArgs (&varDscInfo);
237237
238- #if FEATURE_FASTTAILCALL
239- // -------------------------------------------------------------------------
240- // Save the register usage information and stack size.
241- // -------------------------------------------------------------------------
242-
243- info.compArgRegCount = varDscInfo.intRegArgNum ;
244- info.compFloatArgRegCount = varDscInfo.floatRegArgNum ;
245- info.compArgStackSize = varDscInfo.stackArgSize ;
246-
247- #endif // FEATURE_FASTTAILCALL
248-
249238 // -------------------------------------------------------------------------
250239 // Finally the local variables
251240 // -------------------------------------------------------------------------
@@ -367,6 +356,13 @@ void Compiler::lvaInitArgs(InitVarDscInfo* varDscInfo)
367356 codeGen->floatRegState .rsCalleeRegArgCount = varDscInfo->floatRegArgNum ;
368357#endif // FEATURE_STACK_FP_X87
369358
359+ #if FEATURE_FASTTAILCALL
360+ // Save the stack usage information
361+ // We can get register usage information using codeGen->intRegState and
362+ // codeGen->floatRegState
363+ info.compArgStackSize = varDscInfo->stackArgSize ;
364+ #endif // FEATURE_FASTTAILCALL
365+
370366 // The total argument size must be aligned.
371367 noway_assert ((compArgSize % sizeof (void *)) == 0 );
372368
@@ -951,7 +947,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo)
951947
952948#endif // _TARGET_XXX_
953949
954- #ifdef FEATURE_FASTTAILCALL
950+ #if FEATURE_FASTTAILCALL
955951 varDscInfo->stackArgSize += (unsigned )roundUp (argSize, TARGET_POINTER_SIZE);
956952#endif // FEATURE_FASTTAILCALL
957953 }
@@ -1050,9 +1046,9 @@ void Compiler::lvaInitGenericsCtxt(InitVarDscInfo* varDscInfo)
10501046 // For the RyuJIT backend, we need to mark these as being on the stack,
10511047 // as this is not done elsewhere in the case that canEnreg returns false.
10521048 varDsc->lvOnFrame = true ;
1053- #ifdef FEATURE_FASTTAILCALL
1049+ #if FEATURE_FASTTAILCALL
10541050 varDscInfo->stackArgSize += TARGET_POINTER_SIZE;
1055- #endif
1051+ #endif // FEATURE_FASTTAILCALL
10561052 }
10571053#endif // !LEGACY_BACKEND
10581054
@@ -1126,9 +1122,9 @@ void Compiler::lvaInitVarArgsHandle(InitVarDscInfo* varDscInfo)
11261122 // For the RyuJIT backend, we need to mark these as being on the stack,
11271123 // as this is not done elsewhere in the case that canEnreg returns false.
11281124 varDsc->lvOnFrame = true ;
1129- #ifdef FEATURE_FASTTAILCALL
1125+ #if FEATURE_FASTTAILCALL
11301126 varDscInfo->stackArgSize += TARGET_POINTER_SIZE;
1131- #endif
1127+ #endif // FEATURE_FASTTAILCALL
11321128 }
11331129#endif // !LEGACY_BACKEND
11341130
0 commit comments