Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,14 @@ struct fgArgTabEntry
// Note that on ARM, if we have a double hfa, this reflects the number
// of DOUBLE registers.

#if defined(UNIX_AMD64_ABI)
// Unix amd64 will split floating point types and integer types in structs
// between floating point and general purpose registers. Keep track of that
// information so we do not need to recompute it later.
unsigned structIntRegs;
unsigned structFloatRegs;
Comment thread
jashook marked this conversation as resolved.
#endif // UNIX_AMD64_ABI

// A slot is a pointer sized region in the OutArg area.
unsigned slotNum; // When an argument is passed in the OutArg area this is the slot number in the OutArg area
unsigned numSlots; // Count of number of slots that this argument uses
Expand Down Expand Up @@ -1453,6 +1461,45 @@ struct fgArgTabEntry
#endif
}

unsigned intRegCount()
{
#if defined(UNIX_AMD64_ABI)
if (this->isStruct)
{
return this->structIntRegs;
}
#endif // defined(UNIX_AMD64_ABI)

if (!this->isPassedInFloatRegisters())
{
return this->numRegs;
}

return 0;
}

unsigned floatRegCount()
{
#if defined(UNIX_AMD64_ABI)
if (this->isStruct)
{
return this->structFloatRegs;
}
#endif // defined(UNIX_AMD64_ABI)

if (this->isPassedInFloatRegisters())
{
return this->numRegs;
}

return 0;
}

unsigned stackSize()
{
return (TARGET_POINTER_SIZE * this->numSlots);
}

__declspec(property(get = GetHfaType)) var_types hfaType;
var_types GetHfaType()
{
Expand Down Expand Up @@ -1728,6 +1775,8 @@ class fgArgInfo
const bool isStruct,
const bool isVararg,
const regNumber otherRegNum,
const unsigned structIntRegs,
const unsigned structFloatRegs,
Comment thread
jashook marked this conversation as resolved.
const SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* const structDescPtr = nullptr);
#endif // UNIX_AMD64_ABI

Expand Down
8 changes: 8 additions & 0 deletions src/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,15 @@ bool GenTreeCall::AreArgsComplete() const
assert((gtCallLateArgs != nullptr) || !fgArgInfo->HasRegArgs());
return true;
}

#if defined(FEATURE_FASTTAILCALL)
// If we have FEATURE_FASTTAILCALL, 'fgCanFastTailCall()' can call 'fgInitArgInfo()', and in that
// scenario it is valid to have 'fgArgInfo' be non-null when 'fgMorphArgs()' first queries this,
// when it hasn't yet morphed the arguments.
#else
assert(gtCallArgs == nullptr);
Comment thread
jashook marked this conversation as resolved.
#endif

return false;
}

Expand Down
1 change: 0 additions & 1 deletion src/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,6 @@ void Lowering::LowerFastTailCall(GenTreeCall* call)
fgArgTabEntry* argTabEntry = comp->gtArgEntryByNode(call, putArgStkNode);
assert(argTabEntry);
unsigned callerArgNum = argTabEntry->argNum - calleeNonStandardArgCount;
noway_assert(callerArgNum < comp->info.compArgsCount);

unsigned callerArgLclNum = callerArgNum;
LclVarDsc* callerArgDsc = comp->lvaTable + callerArgLclNum;
Expand Down
Loading