Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode)
if (treeNode->putInIncomingArgArea())
{
varNumOut = getFirstArgWithStackSlot();
argOffsetMax = compiler->compArgSize;
argOffsetMax = compiler->lvaParameterStackSize;
#if FEATURE_FASTTAILCALL
// This must be a fast tail call.
assert(treeNode->gtCall->IsFastTailCall());
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4589,21 +4589,6 @@ void CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegZeroed
}
else
{
if (isFramePointerUsed())
{
#if defined(TARGET_ARM)
// GetStackOffset() is always valid for incoming stack-arguments, even if the argument
// will become enregistered.
// On Arm compiler->compArgSize doesn't include r11 and lr sizes and hence we need to add 2*REGSIZE_BYTES
noway_assert((2 * REGSIZE_BYTES <= varDsc->GetStackOffset()) &&
(size_t(varDsc->GetStackOffset()) < compiler->compArgSize + 2 * REGSIZE_BYTES));
#else
// GetStackOffset() is always valid for incoming stack-arguments, even if the argument
// will become enregistered.
noway_assert((0 < varDsc->GetStackOffset()) && (size_t(varDsc->GetStackOffset()) < compiler->compArgSize));
#endif
}
Comment on lines -4592 to -4605
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could replace compArgSize here as well, but the assert did not look useful to me.


// We will just use the initReg since it is an available register
// and we are probably done using it anyway...
reg = initReg;
Expand Down
6 changes: 2 additions & 4 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10752,10 +10752,8 @@ void CodeGen::genFnEpilog(BasicBlock* block)

if (fCalleePop)
{
noway_assert(compiler->compArgSize >= intRegState.rsCalleeRegArgCount * REGSIZE_BYTES);
stkArgSize = compiler->compArgSize - intRegState.rsCalleeRegArgCount * REGSIZE_BYTES;

noway_assert(compiler->compArgSize < 0x10000); // "ret" only has 2 byte operand
stkArgSize = compiler->lvaParameterStackSize;
noway_assert(stkArgSize < 0x10000); // "ret" only has 2 byte operand
}

#ifdef UNIX_X86_ABI
Expand Down
7 changes: 3 additions & 4 deletions src/coreclr/jit/gcencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1588,10 +1588,9 @@ size_t GCInfo::gcInfoBlockHdrSave(
assert(header->revPInvokeOffset != INVALID_REV_PINVOKE_OFFSET);
}

assert((compiler->compArgSize & 0x3) == 0);

size_t argCount =
(compiler->compArgSize - (compiler->codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES)) / REGSIZE_BYTES;
assert(compiler->lvaParameterStackSize ==
(compiler->compArgSize - compiler->codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES));
size_t argCount = compiler->lvaParameterStackSize / REGSIZE_BYTES;
assert(argCount <= MAX_USHORT_SIZE_T);
header->argCount = static_cast<unsigned short>(argCount);

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void Compiler::lvaInitArgs(InitVarDscInfo* varDscInfo)
instruction can only pop 2^16 arguments. Could be handled correctly
but it will be very difficult for fully interruptible code */

if (compArgSize != (size_t)(unsigned short)compArgSize)
if (lvaParameterStackSize != (size_t)(unsigned short)lvaParameterStackSize)
IMPL_LIMITATION("Too many arguments for the \"ret\" instruction to pop");
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5864,9 +5864,9 @@ void Compiler::fgMorphTailCallViaJitHelper(GenTreeCall* call)
call->gtArgs.Remove(thisArg);
}

unsigned nOldStkArgsWords =
(compArgSize - (codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES)) / REGSIZE_BYTES;
GenTree* arg3Node = gtNewIconNode((ssize_t)nOldStkArgsWords, TYP_I_IMPL);
assert(lvaParameterStackSize == (compArgSize - codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES));
unsigned nOldStkArgsWords = lvaParameterStackSize / REGSIZE_BYTES;
GenTree* arg3Node = gtNewIconNode((ssize_t)nOldStkArgsWords, TYP_I_IMPL);
CallArg* arg3 =
call->gtArgs.PushBack(this, NewCallArg::Primitive(arg3Node).WellKnown(WellKnownArg::X86TailCallSpecialArg));
// Inject a placeholder for the count of outgoing stack arguments that the Lowering phase will generate.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/scopeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ void CodeGen::genSetScopeInfo(unsigned which,

noway_assert(cookieOffset < varOffset);
unsigned offset = varOffset - cookieOffset;
unsigned stkArgSize = compiler->compArgSize - intRegState.rsCalleeRegArgCount * REGSIZE_BYTES;
unsigned stkArgSize = compiler->lvaParameterStackSize;
noway_assert(offset < stkArgSize);
offset = stkArgSize - offset;

Expand Down
Loading