Skip to content

Commit 9f40866

Browse files
committed
Disable stackalloc for arrays and delegates
1 parent ada0890 commit 9f40866

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/coreclr/jit/objectalloc.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -1014,17 +1014,17 @@ bool ObjectAllocator::CanLclVarEscapeViaParentStack(ArrayStack<GenTree*>* parent
10141014
canLclVarEscapeViaParentStack =
10151015
!Compiler::s_helperCallProperties.IsNoEscape(comp->eeGetHelperNum(call->gtCallMethHnd));
10161016
}
1017-
else if (call->gtCallType == CT_USER_FUNC)
1018-
{
1019-
// Delegate invoke won't escape the delegate which is passed as "this"
1020-
// And gets expanded inline later.
1021-
//
1022-
if ((call->gtCallMoreFlags & GTF_CALL_M_DELEGATE_INV) != 0)
1023-
{
1024-
GenTree* const thisArg = call->gtArgs.GetThisArg()->GetNode();
1025-
canLclVarEscapeViaParentStack = thisArg != tree;
1026-
}
1027-
}
1017+
//else if (call->gtCallType == CT_USER_FUNC)
1018+
//{
1019+
// // Delegate invoke won't escape the delegate which is passed as "this"
1020+
// // And gets expanded inline later.
1021+
// //
1022+
// if ((call->gtCallMoreFlags & GTF_CALL_M_DELEGATE_INV) != 0)
1023+
// {
1024+
// GenTree* const thisArg = call->gtArgs.GetThisArg()->GetNode();
1025+
// canLclVarEscapeViaParentStack = thisArg != tree;
1026+
// }
1027+
//}
10281028
break;
10291029
}
10301030

src/coreclr/jit/objectalloc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ inline bool ObjectAllocator::CanAllocateLclVarOnStack(unsigned int lclNu
148148

149149
bool enableBoxedValueClasses = true;
150150
bool enableRefClasses = true;
151-
bool enableArrays = true;
151+
bool enableArrays = false;
152152
*reason = "[ok]";
153153

154154
#ifdef DEBUG

0 commit comments

Comments
 (0)