Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Fix crossgen and ilc
  • Loading branch information
MichalStrehovsky committed Jul 19, 2024
commit 2674bfcd6e7c2471d2816e4a104aa8ae1c5773fb
12 changes: 6 additions & 6 deletions src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ private static MethodIL TryGetIntrinsicMethodIL(MethodDesc method)

switch (owningType.Name)
{
case "Interlocked":
{
if (owningType.Namespace == "System.Threading")
return InterlockedIntrinsics.EmitIL(method);
}
break;
case "Unsafe":
{
if (owningType.Namespace == "System.Runtime.CompilerServices")
Expand Down Expand Up @@ -108,6 +102,12 @@ private static MethodIL TryGetPerInstantiationIntrinsicMethodIL(MethodDesc metho

switch (owningType.Name)
{
case "Interlocked":
{
if (owningType.Namespace == "System.Threading")
return InterlockedIntrinsics.EmitIL(method);
}
break;
case "Activator":
{
TypeSystemContext context = owningType.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static MethodIL EmitIL(
MethodDesc method)
{
Debug.Assert(((MetadataType)method.OwningType).Name == "Interlocked");
Debug.Assert(!method.IsGenericMethodDefinition);

if (method.HasInstantiation && method.Name == "CompareExchange")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ private MethodIL TryGetIntrinsicMethodIL(MethodDesc method)
return UnsafeIntrinsics.EmitIL(method);
}

if (mdType.Name == "Interlocked" && mdType.Namespace == "System.Threading")
{
return InterlockedIntrinsics.EmitIL(_compilationModuleGroup, method);
}

return null;
}

Expand All @@ -114,6 +109,11 @@ private MethodIL TryGetPerInstantiationIntrinsicMethodIL(MethodDesc method)
return TryGetIntrinsicMethodILForActivator(method);
}

if (mdType.Name == "Interlocked" && mdType.Namespace == "System.Threading")
{
return InterlockedIntrinsics.EmitIL(_compilationModuleGroup, method);
}

return null;
}

Expand Down