File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1139,6 +1139,25 @@ bool ObjectAllocator::CanLclVarEscapeViaParentStack(ArrayStack<GenTree*>* parent
1139
1139
canLclVarEscapeViaParentStack =
1140
1140
!Compiler::s_helperCallProperties.IsNoEscape (comp->eeGetHelperNum (asCall->gtCallMethHnd ));
1141
1141
}
1142
+ else if (asCall->IsSpecialIntrinsic ())
1143
+ {
1144
+ // Some known special intrinsics don't escape. At this moment, only the ones accepting byrefs
1145
+ // are supported. In order to support more intrinsics accepting objects, we need extra work
1146
+ // on the VM side which is not ready for that yet.
1147
+ //
1148
+ switch (comp->lookupNamedIntrinsic (asCall->gtCallMethHnd ))
1149
+ {
1150
+ case NI_System_SpanHelpers_ClearWithoutReferences:
1151
+ case NI_System_SpanHelpers_Fill:
1152
+ case NI_System_SpanHelpers_Memmove:
1153
+ case NI_System_SpanHelpers_SequenceEqual:
1154
+ canLclVarEscapeViaParentStack = false ;
1155
+ break ;
1156
+
1157
+ default :
1158
+ break ;
1159
+ }
1160
+ }
1142
1161
1143
1162
// Note there is nothing special here about the parent being a call. We could move all this processing
1144
1163
// up to the caller and handle any sort of tree that could lead to escapes this way.
Original file line number Diff line number Diff line change @@ -1669,6 +1669,13 @@ void HelperCallProperties::init()
1669
1669
isPure = true ;
1670
1670
break ;
1671
1671
1672
+ case CORINFO_HELP_MEMCPY:
1673
+ case CORINFO_HELP_MEMZERO:
1674
+ case CORINFO_HELP_MEMSET:
1675
+ case CORINFO_HELP_NATIVE_MEMSET:
1676
+ isNoEscape = true ;
1677
+ break ;
1678
+
1672
1679
case CORINFO_HELP_LDELEMA_REF:
1673
1680
isPure = true ;
1674
1681
break ;
You can’t perform that action at this time.
0 commit comments