unsigned compArgsCount; // Number of arguments (incl. implicit and hidden)
#if FEATURE_FASTTAILCALL
- unsigned compArgRegCount; // Number of incoming integer argument registers used for incoming arguments
- unsigned compFloatArgRegCount; // Number of incoming floating argument registers used for incoming arguments
- size_t compArgStackSize; // Incoming argument stack size in bytes
-#endif // FEATURE_FASTTAILCALL
+ size_t compArgStackSize; // Incoming argument stack size in bytes
+#endif // FEATURE_FASTTAILCALL
unsigned compRetBuffArg; // position of hidden return param var (0, 1) (BAD_VAR_NUM means not present);
int compTypeCtxtArg; // position of hidden param for type context for generic code (CORINFO_CALLCONV_PARAMTYPE)
lvaInitArgs(&varDscInfo);
-#if FEATURE_FASTTAILCALL
- //-------------------------------------------------------------------------
- // Save the register usage information and stack size.
- //-------------------------------------------------------------------------
-
- info.compArgRegCount = varDscInfo.intRegArgNum;
- info.compFloatArgRegCount = varDscInfo.floatRegArgNum;
- info.compArgStackSize = varDscInfo.stackArgSize;
-
-#endif // FEATURE_FASTTAILCALL
-
//-------------------------------------------------------------------------
// Finally the local variables
//-------------------------------------------------------------------------
codeGen->floatRegState.rsCalleeRegArgCount = varDscInfo->floatRegArgNum;
#endif // FEATURE_STACK_FP_X87
+#if FEATURE_FASTTAILCALL
+ // Save the stack usage information
+ // We can get register usage information using codeGen->intRegState and
+ // codeGen->floatRegState
+ info.compArgStackSize = varDscInfo->stackArgSize;
+#endif // FEATURE_FASTTAILCALL
+
// The total argument size must be aligned.
noway_assert((compArgSize % sizeof(void*)) == 0);
#endif // _TARGET_XXX_
-#ifdef FEATURE_FASTTAILCALL
+#if FEATURE_FASTTAILCALL
varDscInfo->stackArgSize += (unsigned)roundUp(argSize, TARGET_POINTER_SIZE);
#endif // FEATURE_FASTTAILCALL
}
// For the RyuJIT backend, we need to mark these as being on the stack,
// as this is not done elsewhere in the case that canEnreg returns false.
varDsc->lvOnFrame = true;
-#ifdef FEATURE_FASTTAILCALL
+#if FEATURE_FASTTAILCALL
varDscInfo->stackArgSize += TARGET_POINTER_SIZE;
-#endif
+#endif // FEATURE_FASTTAILCALL
}
#endif // !LEGACY_BACKEND
// For the RyuJIT backend, we need to mark these as being on the stack,
// as this is not done elsewhere in the case that canEnreg returns false.
varDsc->lvOnFrame = true;
-#ifdef FEATURE_FASTTAILCALL
+#if FEATURE_FASTTAILCALL
varDscInfo->stackArgSize += TARGET_POINTER_SIZE;
-#endif
+#endif // FEATURE_FASTTAILCALL
}
#endif // !LEGACY_BACKEND
// Note that callee being a vararg method is not a problem since we can account the params being passed.
unsigned nCallerArgs = info.compArgsCount;
- size_t callerArgRegCount = info.compArgRegCount;
- size_t callerFloatArgRegCount = info.compFloatArgRegCount;
+ size_t callerArgRegCount = codeGen->intRegState.rsCalleeRegArgCount;
+ size_t callerFloatArgRegCount = codeGen->floatRegState.rsCalleeRegArgCount;
// Count the callee args including implicit and hidden.
// Note that GenericContext and VarargCookie are added by importer while