Delete PROJECTN ifdefs from Corelib (dotnet/coreclr#26058)
authorStephen Toub <stoub@microsoft.com>
Thu, 8 Aug 2019 02:00:43 +0000 (22:00 -0400)
committerGitHub <noreply@github.com>
Thu, 8 Aug 2019 02:00:43 +0000 (22:00 -0400)
Commit migrated from https://github.com/dotnet/coreclr/commit/dfbd83657e46e43adead674585f6957409a7d47f

38 files changed:
src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.Construction.cs
src/libraries/System.Private.CoreLib/src/System/AppDomain.cs
src/libraries/System.Private.CoreLib/src/System/AppDomainSetup.cs
src/libraries/System.Private.CoreLib/src/System/Array.cs
src/libraries/System.Private.CoreLib/src/System/ByReference.cs
src/libraries/System.Private.CoreLib/src/System/CannotUnloadAppDomainException.cs
src/libraries/System.Private.CoreLib/src/System/Collections/ArrayList.cs
src/libraries/System.Private.CoreLib/src/System/Collections/IEnumerable.cs
src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebuggerStepThroughAttribute.cs
src/libraries/System.Private.CoreLib/src/System/Environment.SpecialFolder.cs
src/libraries/System.Private.CoreLib/src/System/Environment.SpecialFolderOption.cs
src/libraries/System.Private.CoreLib/src/System/EnvironmentVariableTarget.cs
src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
src/libraries/System.Private.CoreLib/src/System/LocalDataStoreSlot.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.tt
src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs
src/libraries/System.Private.CoreLib/src/System/PlatformID.cs
src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.Fast.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncIteratorMethodBuilder.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs
src/libraries/System.Private.CoreLib/src/System/Security/IPermission.cs
src/libraries/System.Private.CoreLib/src/System/Security/ISecurityEncodable.cs
src/libraries/System.Private.CoreLib/src/System/Security/IStackWalk.cs
src/libraries/System.Private.CoreLib/src/System/Security/PermissionSet.cs
src/libraries/System.Private.CoreLib/src/System/Security/Permissions/PermissionState.cs
src/libraries/System.Private.CoreLib/src/System/Security/Principal/IIdentity.cs
src/libraries/System.Private.CoreLib/src/System/Security/Principal/IPrincipal.cs
src/libraries/System.Private.CoreLib/src/System/Security/Principal/PrincipalPolicy.cs
src/libraries/System.Private.CoreLib/src/System/Security/SecurityElement.cs
src/libraries/System.Private.CoreLib/src/System/Span.Fast.cs
src/libraries/System.Private.CoreLib/src/System/SpanHelpers.cs
src/libraries/System.Private.CoreLib/src/System/String.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs

index 074cc600039f41ac04cf0f643f677c3b995629e8..2071690c144fa54644096bdec8ad32600d20cee5 100644 (file)
@@ -34,9 +34,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern Utf8String(ReadOnlySpan<byte> value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -62,9 +59,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern Utf8String(byte[]? value, int startIndex, int length);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -81,9 +75,6 @@ namespace System
         [CLSCompliant(false)]
         public unsafe extern Utf8String(byte* value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -107,9 +98,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern Utf8String(ReadOnlySpan<char> value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -137,9 +125,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern Utf8String(char[]? value, int startIndex, int length);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -156,9 +141,6 @@ namespace System
         [CLSCompliant(false)]
         public unsafe extern Utf8String(char* value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -182,9 +164,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern Utf8String(string? value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
index addef77035cf7c7c0cd1ffaa7ce7dea93e850a84..86f31b760110e324584271cb161288dbbd794989 100644 (file)
@@ -17,9 +17,6 @@ using System.Threading;
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public sealed partial class AppDomain : MarshalByRefObject
     {
         private static readonly AppDomain s_domain = new AppDomain();
index 4537dcdf94e5eafba65d187ee926a2dfee0cbc6e..925ef7404b20e6d6f54f8fa1a3ab33453d9cb290 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public sealed class AppDomainSetup
     {
         internal AppDomainSetup() { }
index 0613abeb0e61c8a73f39bbf919a3dc70480e78d3..a603640528b6dd21d58e8e47da887bcf765f2682 100644 (file)
@@ -1017,8 +1017,6 @@ namespace System
                 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
             }
 
-            // Hits a code generation bug on ProjectN
-#if !PROJECTN
             if (RuntimeHelpers.IsBitwiseEquatable<T>())
             {
                 if (Unsafe.SizeOf<T>() == sizeof(byte))
@@ -1054,7 +1052,6 @@ namespace System
                     return (result >= 0 ? startIndex : 0) + result;
                 }
             }
-#endif
 
 #if CORECLR
             return EqualityComparer<T>.Default.IndexOf(array, value, startIndex, count);
@@ -1221,8 +1218,6 @@ namespace System
                 ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
             }
 
-            // Hits a code generation bug on ProjectN
-#if !PROJECTN
             if (RuntimeHelpers.IsBitwiseEquatable<T>())
             {
                 if (Unsafe.SizeOf<T>() == sizeof(byte))
@@ -1266,8 +1261,6 @@ namespace System
                     return (result >= 0 ? endIndex : 0) + result;
                 }
             }
-            
-#endif
 
 #if CORECLR
             return EqualityComparer<T>.Default.LastIndexOf(array, value, startIndex, count);
index 5da3c99f41b157f0b742af66c10d1e59d34cbd8b..492979a2d75baa3e0f86e5fc1e83f1e6fdbabecd 100644 (file)
@@ -11,11 +11,7 @@ namespace System
     // around lack of first class support for byref fields in C# and IL. The JIT and 
     // type loader has special handling for it that turns it into a thin wrapper around ref T.
     [NonVersionable]
-    internal
-#if !PROJECTN // readonly breaks codegen contract and asserts UTC
-    readonly
-#endif
-    ref struct ByReference<T>
+    internal readonly ref struct ByReference<T>
     {
         // CS0169: The private field '{blah}' is never used
 #pragma warning disable 169
index 6d68f08c5c527d57896585d7e9074a7ad30c310d..865eb093e67b3d0d3b8a77f9d02d1fe23e5ed56b 100644 (file)
@@ -8,9 +8,6 @@ namespace System
 {
     [Serializable]
     [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public class CannotUnloadAppDomainException : SystemException
     {
         internal const int COR_E_CANNOTUNLOADAPPDOMAIN = unchecked((int)0x80131015); // corresponds to __HResults.COR_E_CANNOTUNLOADAPPDOMAIN in corelib
index 7fdfaa03da11ae1eca6b7a00adb8711064f63745..828f587f66259082a0e2516a7260b1296e96feaa 100644 (file)
@@ -28,9 +28,6 @@ namespace System.Collections
     [DebuggerDisplay("Count = {Count}")]
     [Serializable]
     [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public class ArrayList : IList, ICloneable
     {
         private object?[] _items = null!; // Do not rename (binary serialization)
index e787bde2ee6b6811392c5213ff07149169d4b416..e3b743173203f850fe6a0b4d6c5136243c307426 100644 (file)
@@ -6,10 +6,8 @@ using System.Runtime.InteropServices;
 
 namespace System.Collections
 {
-#if !PROJECTN // Hitting a bug in MCG, see VSO:743654
     [Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
     [ComVisible(true)]
-#endif
     public interface IEnumerable
     {
         // Returns an IEnumerator for this enumerable Object.  The enumerator provides
index 82a164771e8596b13a4ef20eab329535f6d7c4e1..1a62b922e071e8cd89011809dd592e0ead25b6cb 100644 (file)
@@ -4,10 +4,6 @@
 
 namespace System.Diagnostics
 {
-#if PROJECTN
-    // Used by the IL2IL toolchain to mark generated code to control debugger stepping policy
-    [System.Runtime.CompilerServices.DependencyReductionRoot]
-#endif
     [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
     public sealed class DebuggerStepThroughAttribute : Attribute
     {
index ae2add730d2bfa2b89f82ff8b0d4ad21ddf62340..a5a4d2abfde3a90e87e4e878f100498b041a905a 100644 (file)
@@ -6,9 +6,6 @@ namespace System
 {
     public static partial class Environment
     {
-#if PROJECTN
-        [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
         public enum SpecialFolder
         {
             ApplicationData = SpecialFolderValues.CSIDL_APPDATA,
index 929e3d9036a1dc16f9fc7bf2338cdb7e5a3580ca..cd0e5714ef0c0a4f6c8996412419e68e2e9b1ad5 100644 (file)
@@ -6,9 +6,6 @@ namespace System
 {
     public static partial class Environment
     {
-#if PROJECTN
-        [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
         public enum SpecialFolderOption
         {
             None = 0,
index 581c4aa30b1aa205b4b8a2356dc352e4266bea4c..42b93215697b7ee0bcde409e55454df26f8df6e5 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public enum EnvironmentVariableTarget
     {
         Process = 0,
index ee9da7ae78521e262872458cff87002e8509d67f..697599a8c457821503b696ded79e657563b94656 100644 (file)
@@ -217,9 +217,6 @@ namespace System
         [CLSCompliant(false)]
         [Intrinsic]
         [NonVersionable]
-#if PROJECTN
-        [System.Runtime.CompilerServices.DependencyReductionRootAttribute]
-#endif
         public unsafe void* ToPointer()
         {
             return _value;
index 41e384e90b22b262124f770a3228667ecf5da436..646487845818e6672cc4acd6971f458f5f21de86 100644 (file)
@@ -6,9 +6,6 @@ using System.Threading;
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Threading.Thread")]
-#endif
     public sealed class LocalDataStoreSlot
     {
         internal LocalDataStoreSlot(ThreadLocal<object?> data)
index e85b48f01acfb4f3fe5755f4e4f5fc92f26cfd7a..200681fac6fc5d132a5b7e57e8349b8605618132 100644 (file)
@@ -61,13 +61,7 @@ namespace System.Numerics
             get
             {
                 ThrowHelper.ThrowForUnsupportedVectorBaseType<T>();
-#if PROJECTN
-                // Hits an active bug in ProjectN (887908). This code path is actually only used rarely,
-                // since get_Count is an intrinsic.
-                throw new NotImplementedException();
-#else
                 return Unsafe.SizeOf<Vector<T>>() / Unsafe.SizeOf<T>();
-#endif
             }
         }
 
index 46824941fbf80341b90476a6665b7211ca64ec80..ed2b606e556e01bb36907200b9e6ea607ae032f7 100644 (file)
@@ -65,13 +65,7 @@ namespace System.Numerics
             get
             {
                 ThrowHelper.ThrowForUnsupportedVectorBaseType<T>();
-#if PROJECTN
-                // Hits an active bug in ProjectN (887908). This code path is actually only used rarely,
-                // since get_Count is an intrinsic.
-                throw new NotImplementedException();
-#else
                 return Unsafe.SizeOf<Vector<T>>() / Unsafe.SizeOf<T>();
-#endif
             }
         }
 
index 046ce263b40b72741da85351733012ffabb1914d..952c05b852f5121adebb78250b501d53832c6109 100644 (file)
@@ -7,9 +7,6 @@ using System.Runtime.Serialization;
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public sealed class OperatingSystem : ISerializable, ICloneable
     {
         private readonly Version _version;
index 2eda3c05f30e1c4daaea33d26b7bcca73e1cbdaa..1e0a688ba69079ce790832c7f9b2dd66cd5ae3d1 100644 (file)
@@ -6,9 +6,6 @@ using System.ComponentModel;
 
 namespace System
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public enum PlatformID
     {
         [EditorBrowsable(EditorBrowsableState.Never)] Win32S = 0,
index 8a5b7e7d972d25da8098ba4eb8da44a5449f0358..a1d554bdcdb2417657c147d97457f772328d4136 100644 (file)
@@ -30,9 +30,6 @@ namespace System
         /// <summary>A byref or a native ptr.</summary>
         internal readonly ByReference<T> _pointer;
         /// <summary>The number of elements this ReadOnlySpan contains.</summary>
-#if PROJECTN
-        [Bound]
-#endif
         private readonly int _length;
 
         /// <summary>
@@ -134,13 +131,6 @@ namespace System
         /// </exception>
         public ref readonly T this[int index]
         {
-#if PROJECTN
-            [BoundsChecking]
-            get
-            {
-                return ref Unsafe.Add(ref _pointer.Value, index);
-            }
-#else
             [Intrinsic]
             [MethodImpl(MethodImplOptions.AggressiveInlining)]
             [NonVersionable]
@@ -150,7 +140,6 @@ namespace System
                     ThrowHelper.ThrowIndexOutOfRangeException();
                 return ref Unsafe.Add(ref _pointer.Value, index);
             }
-#endif
         }
 
         /// <summary>
index 6fc5706897fe506096bbfbe42774c98702e58644..a18b685358b1742d9d0017818cb3dab5492a675e 100644 (file)
@@ -26,15 +26,9 @@ namespace System.Runtime.CompilerServices
         /// <summary>Creates an instance of the <see cref="AsyncIteratorMethodBuilder"/> struct.</summary>
         /// <returns>The initialized instance.</returns>
         public static AsyncIteratorMethodBuilder Create() =>
-#if PROJECTN
-            // ProjectN's AsyncTaskMethodBuilder.Create() currently does additional debugger-related
-            // work, so we need to delegate to it.
-            new AsyncIteratorMethodBuilder() { _methodBuilder = AsyncTaskMethodBuilder.Create() };
-#else
             // _methodBuilder should be initialized to AsyncTaskMethodBuilder.Create(), but on coreclr
             // that Create() is a nop, so we can just return the default here.
             default; 
-#endif
 
         /// <summary>Invokes <see cref="IAsyncStateMachine.MoveNext"/> on the state machine while guarding the <see cref="ExecutionContext"/>.</summary>
         /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
index 3af525e6f0f452faabfc9b77de1d6650b4e04cb1..f2d8379bfb6a62cce427e1677dd9daee546e01b7 100644 (file)
@@ -39,15 +39,10 @@ namespace System.Runtime.CompilerServices
         {
             SynchronizationContext? sc = SynchronizationContext.Current;
             sc?.OperationStarted();
-#if PROJECTN
-            // ProjectN's AsyncTaskMethodBuilder.Create() currently does additional debugger-related
-            // work, so we need to delegate to it.
-            return new AsyncVoidMethodBuilder() { _synchronizationContext = sc, _builder = AsyncTaskMethodBuilder.Create() };
-#else
+
             // _builder should be initialized to AsyncTaskMethodBuilder.Create(), but on coreclr
             // that Create() is a nop, so we can just return the default here.
             return new AsyncVoidMethodBuilder() { _synchronizationContext = sc };
-#endif
         }
 
         /// <summary>Initiates the builder's execution with the associated state machine.</summary>
@@ -192,11 +187,7 @@ namespace System.Runtime.CompilerServices
     public struct AsyncTaskMethodBuilder
     {
         /// <summary>A cached VoidTaskResult task used for builders that complete synchronously.</summary>
-#if PROJECTN
-        private static readonly Task<VoidTaskResult> s_cachedCompleted = AsyncTaskCache.CreateCacheableTask<VoidTaskResult>(default(VoidTaskResult));
-#else
         private static readonly Task<VoidTaskResult> s_cachedCompleted = AsyncTaskMethodBuilder<VoidTaskResult>.s_defaultResultTask;
-#endif
 
         /// <summary>The generic builder object to which this non-generic instance delegates.</summary>
         private AsyncTaskMethodBuilder<VoidTaskResult> m_builder; // mutable struct: must not be readonly. Debugger depends on the exact name of this field.
@@ -204,15 +195,9 @@ namespace System.Runtime.CompilerServices
         /// <summary>Initializes a new <see cref="AsyncTaskMethodBuilder"/>.</summary>
         /// <returns>The initialized <see cref="AsyncTaskMethodBuilder"/>.</returns>
         public static AsyncTaskMethodBuilder Create() =>
-#if PROJECTN
-            // ProjectN's AsyncTaskMethodBuilder<VoidTaskResult>.Create() currently does additional debugger-related
-            // work, so we need to delegate to it.
-            new AsyncTaskMethodBuilder { m_builder = AsyncTaskMethodBuilder<VoidTaskResult>.Create() };
-#else
             // m_builder should be initialized to AsyncTaskMethodBuilder<VoidTaskResult>.Create(), but on coreclr
             // that Create() is a nop, so we can just return the default here.
             default;
-#endif
 
         /// <summary>Initiates the builder's execution with the associated state machine.</summary>
         /// <typeparam name="TStateMachine">Specifies the type of the state machine.</typeparam>
@@ -313,10 +298,8 @@ namespace System.Runtime.CompilerServices
     /// </remarks>
     public struct AsyncTaskMethodBuilder<TResult>
     {
-#if !PROJECTN
         /// <summary>A cached task for default(TResult).</summary>
         internal static readonly Task<TResult> s_defaultResultTask = AsyncTaskCache.CreateCacheableTask<TResult>(default);
-#endif
 
         /// <summary>The lazily-initialized built task.</summary>
         private Task<TResult> m_task; // lazily-initialized: must not be readonly. Debugger depends on the exact name of this field.
@@ -325,20 +308,10 @@ namespace System.Runtime.CompilerServices
         /// <returns>The initialized <see cref="AsyncTaskMethodBuilder"/>.</returns>
         public static AsyncTaskMethodBuilder<TResult> Create()
         {
-#if PROJECTN
-            var result = new AsyncTaskMethodBuilder<TResult>();
-            if (System.Threading.Tasks.Task.s_asyncDebuggingEnabled)
-            {
-                // This allows the debugger to access m_task directly without evaluating ObjectIdForDebugger for ProjectN
-                result.InitializeTaskAsStateMachineBox();
-            }            
-            return result;
-#else
             // NOTE: If this method is ever updated to perform more initialization,
             //       other Create methods like AsyncTaskMethodBuilder.Create and
             //       AsyncValueTaskMethodBuilder.Create must be updated to call this.
             return default;
-#endif
         }
 
         /// <summary>Initiates the builder's execution with the associated state machine.</summary>
@@ -843,12 +816,6 @@ namespace System.Runtime.CompilerServices
         [MethodImpl(MethodImplOptions.AggressiveInlining)] // method looks long, but for a given TResult it results in a relatively small amount of asm
         internal static Task<TResult> GetTaskForResult(TResult result)
         {
-#if PROJECTN
-            // Currently NUTC does not perform the optimization needed by this method.  The result is that
-            // every call to this method results in quite a lot of work, including many allocations, which 
-            // is the opposite of the intent.  For now, let's just return a new Task each time.
-            // Bug 719350 tracks re-optimizing this in ProjectN.
-#else
             // The goal of this function is to be give back a cached task if possible,
             // or to otherwise give back a new task.  To give back a cached task,
             // we need to be able to evaluate the incoming result value, and we need
@@ -921,7 +888,6 @@ namespace System.Runtime.CompilerServices
             {
                 return s_defaultResultTask;
             }
-#endif
 
             // No cached task is available.  Manufacture a new one for this result.
             return new Task<TResult>(result);
@@ -931,7 +897,6 @@ namespace System.Runtime.CompilerServices
     /// <summary>Provides a cache of closed generic tasks for async methods.</summary>
     internal static class AsyncTaskCache
     {
-#if !PROJECTN
         // All static members are initialized inline to ensure type is beforefieldinit
 
         /// <summary>A cached Task{Boolean}.Result == true.</summary>
@@ -956,7 +921,6 @@ namespace System.Runtime.CompilerServices
             }
             return tasks;
         }
-#endif
 
         /// <summary>Creates a non-disposable task.</summary>
         /// <typeparam name="TResult">Specifies the result type.</typeparam>
@@ -1086,9 +1050,6 @@ namespace System.Runtime.CompilerServices
 
         /// <summary>This helper routine is targeted by the debugger. Its purpose is to remove any delegate wrappers introduced by
         /// the framework that the debugger doesn't want to see.</summary>
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
         internal static Action TryGetStateMachineForDebugger(Action action) // debugger depends on this exact name/signature
         {
             object? target = action.Target;
index 897de6e27db93ab29f60a685811ddc235362e791..7075110876e581d587cfb9315b25bc1bb6e1969b 100644 (file)
@@ -22,15 +22,9 @@ namespace System.Runtime.CompilerServices
         /// <summary>Creates an instance of the <see cref="AsyncValueTaskMethodBuilder"/> struct.</summary>
         /// <returns>The initialized instance.</returns>
         public static AsyncValueTaskMethodBuilder Create() =>
-#if PROJECTN
-            // ProjectN's AsyncTaskMethodBuilder.Create() currently does additional debugger-related
-            // work, so we need to delegate to it.
-            new AsyncValueTaskMethodBuilder() { _methodBuilder = AsyncTaskMethodBuilder.Create() };
-#else
             // _methodBuilder should be initialized to AsyncTaskMethodBuilder.Create(), but on coreclr
             // that Create() is a nop, so we can just return the default here.
             default;
-#endif
 
         /// <summary>Begins running the builder with the associated state machine.</summary>
         /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
@@ -122,15 +116,9 @@ namespace System.Runtime.CompilerServices
         /// <summary>Creates an instance of the <see cref="AsyncValueTaskMethodBuilder{TResult}"/> struct.</summary>
         /// <returns>The initialized instance.</returns>
         public static AsyncValueTaskMethodBuilder<TResult> Create() =>
-#if PROJECTN
-            // ProjectN's AsyncTaskMethodBuilder<TResult>.Create() currently does additional debugger-related
-            // work, so we need to delegate to it.
-            new AsyncValueTaskMethodBuilder<TResult>() { _methodBuilder = AsyncTaskMethodBuilder<TResult>.Create() };
-#else
             // _methodBuilder should be initialized to AsyncTaskMethodBuilder<TResult>.Create(), but on coreclr
             // that Create() is a nop, so we can just return the default here.
             default;
-#endif
 
         /// <summary>Begins running the builder with the associated state machine.</summary>
         /// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
index efb7e593c456c6752bb1b56fdb6c300297cf2067..f593b88d398150b1adfcd362909ef73bd412578a 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System.Security
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public partial interface IPermission : ISecurityEncodable
     {
         IPermission Copy();
index 64a9687566527be223542a948a963135baa242f7..2c4865ac10a76e76c5f623b07f770095a6ae436e 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System.Security
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public partial interface ISecurityEncodable
     {
         void FromXml(SecurityElement e);
index 9e6986a7520687fd20dadb0d7928ed390f27fa87..f8d472e1bf9fcfe2808c57373c982767ab7296ce 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System.Security
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public partial interface IStackWalk
     {
         void Assert();
index 0c1a2d2c8b8af9cd3a235d1ba6c9b5bf5b0427eb..fcf1f36c3b3b196b0920b4c21c77ad1e6054694f 100644 (file)
@@ -9,9 +9,6 @@ using System.Runtime.Serialization;
 
 namespace System.Security
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public partial class PermissionSet : ICollection, IEnumerable, IDeserializationCallback, ISecurityEncodable, IStackWalk
     {
         public PermissionSet(PermissionState state) { }
index 3ce1e703e074a7462fcba839ac2e1fa03e13fa1c..aace3dc6ada940596270acc38f1f5681abe2e408 100644 (file)
@@ -4,9 +4,6 @@
 
 namespace System.Security.Permissions
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public enum PermissionState
     {
         None = 0,
index cc6765c41f6e3698ca4bc9c58533f685c204bb80..c5b7042c70ea0996fdb3328c79c438a5d9e24a21 100644 (file)
@@ -10,9 +10,6 @@ using System;
 
 namespace System.Security.Principal
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Security.Principal")]
-#endif
     public interface IIdentity
     {
         // Access to the name string
index 03fffd6a41ab76331aafb930c62c37e1f16d0e0d..2540bff8024c630f8c320a5c2d2876ba7c648865 100644 (file)
@@ -10,9 +10,6 @@ using System;
 
 namespace System.Security.Principal
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Security.Principal")]
-#endif
     public interface IPrincipal
     {
         // Retrieve the identity object
index 3884b101a8be4010afaf2111d2cae339945acb7f..53a8ba7d2f2d23e4af41974a7614b9cd13e8bf45 100644 (file)
@@ -9,9 +9,6 @@
 
 namespace System.Security.Principal
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Security.Principal")]
-#endif
     public enum PrincipalPolicy 
     {
         // Note: it's important that the default policy has the value 0.
index a79616aa5e63a996bd1801fcc44a107bc28d19fa..9dfe8247b0d6205202bb0b55df5ca45dd2e58acc 100644 (file)
@@ -10,9 +10,6 @@ using System.Text;
 
 namespace System.Security
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     internal interface ISecurityElementFactory
     {
         SecurityElement CreateSecurityElement();
@@ -24,9 +21,6 @@ namespace System.Security
         string? Attribute(string attributeName);
     }
 
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
     public sealed class SecurityElement : ISecurityElementFactory
     {
         internal string _tag = null!;
index 75faa0780d3ed11946faec8be7a3e67188865e95..bff8d4cf559750836b4f4e19c8402f11fd98a480 100644 (file)
@@ -30,9 +30,6 @@ namespace System
         /// <summary>A byref or a native ptr.</summary>
         internal readonly ByReference<T> _pointer;
         /// <summary>The number of elements this Span contains.</summary>
-#if PROJECTN
-        [Bound]
-#endif
         private readonly int _length;
 
         /// <summary>
@@ -140,13 +137,6 @@ namespace System
         /// </exception>
         public ref T this[int index]
         {
-#if PROJECTN
-            [BoundsChecking]
-            get
-            {
-                return ref Unsafe.Add(ref _pointer.Value, index);
-            }
-#else
             [Intrinsic]
             [MethodImpl(MethodImplOptions.AggressiveInlining)]
             [NonVersionable]
@@ -156,7 +146,6 @@ namespace System
                     ThrowHelper.ThrowIndexOutOfRangeException();
                 return ref Unsafe.Add(ref _pointer.Value, index);
             }
-#endif
         }
 
         /// <summary>
index c919d6e6312654525264b4180a82786421ef83f5..acc68c55b5deff4a10699e4e350279f96e0cdcb3 100644 (file)
@@ -22,7 +22,7 @@ namespace System
             if (byteLength == 0)
                 return;
 
-#if !PROJECTN && (AMD64 || ARM64)
+#if AMD64 || ARM64
             // The exact matrix on when RhZeroMemory is faster than InitBlockUnaligned is very complex. The factors to consider include
             // type of hardware and memory aligment. This threshold was chosen as a good balance accross different configurations.
             if (byteLength > 768)
index e2b5cd4e857d8e105bf1fba35b4111b1d0966bdb..d3c7842c4931cef8fad62eaf4a73001446870d83 100644 (file)
@@ -44,9 +44,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern String(char[] value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -67,9 +64,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern String(char[] value, int startIndex, int length);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -103,9 +97,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern unsafe String(char* value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -128,9 +119,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern unsafe String(char* value, int startIndex, int length);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -164,9 +152,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern unsafe String(sbyte* value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -185,9 +170,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern unsafe String(sbyte* value, int startIndex, int length);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -247,9 +229,6 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -284,9 +263,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern String(char c, int count);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
@@ -336,9 +312,6 @@ namespace System
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         public extern String(ReadOnlySpan<char> value);
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
 #if !CORECLR
         static
 #endif
index 705f196fb7bd4e66d7d015ffdd31a321085da698..ea4c2a615ef153966ed7eb210d26c137c84f8dfa 100644 (file)
@@ -6204,9 +6204,6 @@ namespace System.Threading.Tasks
             return new UnwrapPromise<TResult>(outerTask, lookForOce);
         }
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
         internal virtual Delegate[]? GetDelegateContinuationsForDebugger()
         {
             //Avoid an infinite loop by making sure the continuation object is not a reference to istelf.
@@ -6268,9 +6265,6 @@ namespace System.Threading.Tasks
             return null;
         }
 
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
         //Do not remove: VS debugger calls this API directly using func-eval to populate data in the tasks window
         private static Task? GetActiveTaskFromId(int taskId)
         {
index 91ee4b853d16c4062dcbf128f841f4afcd49cedf..a3c010751f9b96856d7410628319100c71efb009 100644 (file)
@@ -253,9 +253,6 @@ namespace System.Threading.Tasks
         //
         // This helper routine is targeted by the debugger.
         //
-#if PROJECTN
-        [DependencyReductionRoot]
-#endif
         internal abstract Delegate[]? GetDelegateContinuationsForDebugger();
     }
 
index 28b2e6eb8f5a072cc149db6d632341c58df05020..9b7abbf9fbb03260e6a3f30041c8127905bbccd0 100644 (file)
@@ -11,9 +11,6 @@ using System.Security.Principal;
 
 namespace System.Threading
 {
-#if PROJECTN
-    [Internal.Runtime.CompilerServices.RelocatedType("System.Threading.Thread")]
-#endif
     public sealed partial class Thread : CriticalFinalizerObject
     {
         private static AsyncLocal<IPrincipal?>? s_asyncLocalPrincipal;
index 28d7ffb15f8d3d3cb9350d832c16176e5cf359d6..4d33029c1d636d2a771bc37c2e226bb44ac0f40f 100644 (file)
@@ -208,9 +208,6 @@ namespace System
 
         [Intrinsic]
         [NonVersionable]
-#if PROJECTN
-        [System.Runtime.CompilerServices.DependencyReductionRootAttribute]
-#endif
         public unsafe void* ToPointer()
         {
             return _value;