Skip to content

Commit

Permalink
Disable stackalloc for arrays and delegates
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Jul 20, 2024
1 parent ada0890 commit 9f40866
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/coreclr/jit/objectalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,17 +1014,17 @@ bool ObjectAllocator::CanLclVarEscapeViaParentStack(ArrayStack<GenTree*>* parent
canLclVarEscapeViaParentStack =
!Compiler::s_helperCallProperties.IsNoEscape(comp->eeGetHelperNum(call->gtCallMethHnd));
}
else if (call->gtCallType == CT_USER_FUNC)
{
// Delegate invoke won't escape the delegate which is passed as "this"
// And gets expanded inline later.
//
if ((call->gtCallMoreFlags & GTF_CALL_M_DELEGATE_INV) != 0)
{
GenTree* const thisArg = call->gtArgs.GetThisArg()->GetNode();
canLclVarEscapeViaParentStack = thisArg != tree;
}
}
//else if (call->gtCallType == CT_USER_FUNC)
//{
// // Delegate invoke won't escape the delegate which is passed as "this"
// // And gets expanded inline later.
// //
// if ((call->gtCallMoreFlags & GTF_CALL_M_DELEGATE_INV) != 0)
// {
// GenTree* const thisArg = call->gtArgs.GetThisArg()->GetNode();
// canLclVarEscapeViaParentStack = thisArg != tree;
// }
//}
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/objectalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ inline bool ObjectAllocator::CanAllocateLclVarOnStack(unsigned int lclNu

bool enableBoxedValueClasses = true;
bool enableRefClasses = true;
bool enableArrays = true;
bool enableArrays = false;
*reason = "[ok]";

#ifdef DEBUG
Expand Down

0 comments on commit 9f40866

Please sign in to comment.