unsigned stkLevel; // Stack depth when we make this call (for x86)
unsigned argTableSize; // size of argTable array (equal to the argCount when done with fgMorphArgs)
+ bool hasRegArgs; // true if we have one or more register arguments
+ bool hasStackArgs; // true if we have one or more stack arguments
bool argsComplete; // marker for state
bool argsSorted; // marker for state
fgArgTabEntryPtr * argTable; // variable sized array of per argument descrption: (i.e. argTable[argTableSize])
unsigned ArgCount () { return argCount; }
fgArgTabEntryPtr * ArgTable () { return argTable; }
unsigned GetNextSlotNum() { return nextSlotNum; }
+ bool HasRegArgs() { return hasRegArgs; }
+ bool HasStackArgs() { return hasStackArgs; }
};
nextSlotNum = INIT_ARG_STACK_SLOT;
stkLevel = 0;
argTableSize = numArgs; // the allocated table size
+
+ hasRegArgs = false;
+ hasStackArgs = false;
argsComplete = false;
argsSorted = false;
curArgTabEntry->isBackFilled = false;
curArgTabEntry->isNonStandard = false;
+ hasRegArgs = true;
AddArg(curArgTabEntry);
return curArgTabEntry;
}
curArgTabEntry->isBackFilled = false;
curArgTabEntry->isNonStandard = false;
+ hasStackArgs = true;
AddArg(curArgTabEntry);
nextSlotNum += numSlots;
bool callIsVararg = call->IsVarargs();
#endif
- bool hasNonStandardArg = false;
#ifndef LEGACY_BACKEND
// data structure for keeping track of non-standard args we insert
// (args that have a special meaning and are not passed following the normal
bool nonStandardFound = false;
for (int i=0; i<nonStandardArgs.Height(); i++)
{
- hasNonStandardArg = true;
if (argx == nonStandardArgs.Index(i).node)
{
fgArgTabEntry* argEntry = call->fgArgInfo->AddRegArg(argIndex,
call->gtFlags |= (flagsSummary & GTF_ALL_EFFECT);
// If the register arguments have already been determined
- // or we have no register arguments then we are done.
-
- bool needEvalArgsToTemps = true;
-
- if (lateArgsComputed || (intArgRegNum == 0 && fltArgRegNum == 0 && !hasNonStandardArg && !hasStructArgument))
- {
- needEvalArgsToTemps = false;
- }
-
- if (needEvalArgsToTemps)
+ // or we have no register arguments then we don't need to
+ // call SortArgs() and EvalArgsToTemps()
+ //
+ // Note that we do this for UNIX_AMD64 when we have a struct argument
+ //
+ if (!lateArgsComputed && (call->fgArgInfo->HasRegArgs()
+#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING
+ || hasStructArgument
+#endif // FEATURE_UNIX_AMD64_STRUCT_PASSING
+ ))
{
// This is the first time that we morph this call AND it has register arguments.
// Follow into the code below and do the 'defer or eval to temp' analysis.