[MethodImpl(MethodImplOptions.InternalCall)]
public extern Utf8String(ReadOnlySpan<byte> value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Utf8String(byte[]? value, int startIndex, int length);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[CLSCompliant(false)]
public unsafe extern Utf8String(byte* value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Utf8String(ReadOnlySpan<char> value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Utf8String(char[]? value, int startIndex, int length);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[CLSCompliant(false)]
public unsafe extern Utf8String(char* value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Utf8String(string? value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
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();
namespace System
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public sealed class AppDomainSetup
{
internal AppDomainSetup() { }
ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
}
- // Hits a code generation bug on ProjectN
-#if !PROJECTN
if (RuntimeHelpers.IsBitwiseEquatable<T>())
{
if (Unsafe.SizeOf<T>() == sizeof(byte))
return (result >= 0 ? startIndex : 0) + result;
}
}
-#endif
#if CORECLR
return EqualityComparer<T>.Default.IndexOf(array, value, startIndex, count);
ThrowHelper.ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count();
}
- // Hits a code generation bug on ProjectN
-#if !PROJECTN
if (RuntimeHelpers.IsBitwiseEquatable<T>())
{
if (Unsafe.SizeOf<T>() == sizeof(byte))
return (result >= 0 ? endIndex : 0) + result;
}
}
-
-#endif
#if CORECLR
return EqualityComparer<T>.Default.LastIndexOf(array, value, startIndex, count);
// 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
{
[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
[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)
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
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
{
{
public static partial class Environment
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public enum SpecialFolder
{
ApplicationData = SpecialFolderValues.CSIDL_APPDATA,
{
public static partial class Environment
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public enum SpecialFolderOption
{
None = 0,
namespace System
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public enum EnvironmentVariableTarget
{
Process = 0,
[CLSCompliant(false)]
[Intrinsic]
[NonVersionable]
-#if PROJECTN
- [System.Runtime.CompilerServices.DependencyReductionRootAttribute]
-#endif
public unsafe void* ToPointer()
{
return _value;
namespace System
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Threading.Thread")]
-#endif
public sealed class LocalDataStoreSlot
{
internal LocalDataStoreSlot(ThreadLocal<object?> data)
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
}
}
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
}
}
namespace System
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public sealed class OperatingSystem : ISerializable, ICloneable
{
private readonly Version _version;
namespace System
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public enum PlatformID
{
[EditorBrowsable(EditorBrowsableState.Never)] Win32S = 0,
/// <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>
/// </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]
ThrowHelper.ThrowIndexOutOfRangeException();
return ref Unsafe.Add(ref _pointer.Value, index);
}
-#endif
}
/// <summary>
/// <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>
{
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>
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.
/// <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>
/// </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.
/// <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>
[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
{
return s_defaultResultTask;
}
-#endif
// No cached task is available. Manufacture a new one for this result.
return new Task<TResult>(result);
/// <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>
}
return tasks;
}
-#endif
/// <summary>Creates a non-disposable task.</summary>
/// <typeparam name="TResult">Specifies the result type.</typeparam>
/// <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;
/// <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>
/// <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>
namespace System.Security
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public partial interface IPermission : ISecurityEncodable
{
IPermission Copy();
namespace System.Security
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public partial interface ISecurityEncodable
{
void FromXml(SecurityElement e);
namespace System.Security
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public partial interface IStackWalk
{
void Assert();
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) { }
namespace System.Security.Permissions
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public enum PermissionState
{
None = 0,
namespace System.Security.Principal
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Security.Principal")]
-#endif
public interface IIdentity
{
// Access to the name string
namespace System.Security.Principal
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Security.Principal")]
-#endif
public interface IPrincipal
{
// Retrieve the identity object
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.
namespace System.Security
{
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
internal interface ISecurityElementFactory
{
SecurityElement CreateSecurityElement();
string? Attribute(string attributeName);
}
-#if PROJECTN
- [Internal.Runtime.CompilerServices.RelocatedType("System.Runtime.Extensions")]
-#endif
public sealed class SecurityElement : ISecurityElementFactory
{
internal string _tag = null!;
/// <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>
/// </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]
ThrowHelper.ThrowIndexOutOfRangeException();
return ref Unsafe.Add(ref _pointer.Value, index);
}
-#endif
}
/// <summary>
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)
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern String(char[] value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern String(char[] value, int startIndex, int length);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern unsafe String(char* value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern unsafe String(char* value, int startIndex, int length);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern unsafe String(sbyte* value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern unsafe String(sbyte* value, int startIndex, int length);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImpl(MethodImplOptions.InternalCall)]
public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern String(char c, int count);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern String(ReadOnlySpan<char> value);
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
#if !CORECLR
static
#endif
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.
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)
{
//
// This helper routine is targeted by the debugger.
//
-#if PROJECTN
- [DependencyReductionRoot]
-#endif
internal abstract Delegate[]? GetDelegateContinuationsForDebugger();
}
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;
[Intrinsic]
[NonVersionable]
-#if PROJECTN
- [System.Runtime.CompilerServices.DependencyReductionRootAttribute]
-#endif
public unsafe void* ToPointer()
{
return _value;