[System.Private.CoreLib] Cleanup intrinsic tracking (#17884)
commitadcd62248d8956ab4d512c5b970c867b7432887f
authorMarek Safar <marek.safar@gmail.com>
Tue, 7 Jan 2020 10:17:06 +0000 (7 11:17 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Jan 2020 10:17:06 +0000 (7 11:17 +0100)
treee317e489c96071301890524f5c95953fc44bcc7e
parent487dacce79f0191dd7275c40756e9ccb42fa7ff0
[System.Private.CoreLib] Cleanup intrinsic tracking (#17884)

* [System.Private.CoreLib] Cleanup intrinsic tracking

1. Removed icalls where intrinsic version for the method exists

2. Add [Intrinsic] attribute to methods which have runtime intrinsic
   to make them easier to track and to tell linker not to analyze them

3. Use recursive syntax for any intrinsic which can be called via
   reflection to correctly apply the intrinsic when invoked.

```c#
public static bool IsSupported { get => IsSupported; }
```

When one calls X86.IsSupported, the call gets replaced by an
intrinsics. When one calls it with an Invoke, the body of IsSupported
gets replaced by intrinsics. It's just a hack to get Invoke support for free.

* [interp] implement System.Type::op_Equality

* Undo changes which are not yet supported by interpreter

* [interp] Implement System.Runtime.CompilerServices.RuntimeHelpers::OffsetToStringData

Co-authored-by: Bernhard Urban-Forster <bernhard.urban@xamarin.com>
14 files changed:
mono/metadata/icall-def-netcore.h
mono/metadata/icall.c
mono/metadata/monitor.c
mono/mini/interp/transform.c
netcore/System.Private.CoreLib/src/System/Array.Mono.cs
netcore/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs
netcore/System.Private.CoreLib/src/System/Object.Mono.cs
netcore/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.Mono.cs
netcore/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs
netcore/System.Private.CoreLib/src/System/String.Mono.cs
netcore/System.Private.CoreLib/src/System/Threading/Interlocked.cs
netcore/System.Private.CoreLib/src/System/Threading/Monitor.cs
netcore/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs
netcore/System.Private.CoreLib/src/System/Type.Mono.cs