From 400d171cae5491320470af921dbd0b49728f99dd Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 19 Apr 2022 07:51:48 -0700 Subject: [PATCH] Cleanup ProjectN references (#68201) --- .../System/Runtime/CachedInterfaceDispatch.cs | 2 +- .../src/System/Runtime/ExceptionHandling.cs | 12 ++--- .../src/System/Runtime/ThunkPool.cs | 4 +- .../nativeaot/Runtime/eventtracepriv.h | 3 +- .../Reflection/Augments/ReflectionAugments.cs | 2 +- .../NonPortable/CustomAttributeSearcher.cs | 4 +- .../src/System/Array.CoreRT.cs | 6 +-- .../src/System/Delegate.cs | 14 +----- .../src/System/RuntimeExceptionHelpers.cs | 17 +++---- .../Internal/Reflection/RuntimeTypeInfo.cs | 5 +- .../Core/Execution/ExecutionEnvironment.cs | 1 - .../RuntimeClsIdNullaryConstructorInfo.cs | 24 --------- .../Runtime/Modules/RuntimeModule.cs | 4 +- .../Runtime/TypeInfos/RuntimeTypeInfo.cs | 2 +- ...cutionEnvironmentImplementation.Interop.cs | 25 ---------- ...EnvironmentImplementation.MappingTables.cs | 2 +- .../ReflectionDomainSetupImplementation.cs | 2 +- ...System.Private.Reflection.Execution.csproj | 1 - .../Execution/AssemblyBinderImplementation.cs | 2 +- .../Runtime/TypeLoader/CallingConventions.cs | 4 +- .../Runtime/TypeLoader/EETypeCreator.cs | 2 - .../TypeLoaderEnvironment.Metadata.cs | 12 ++--- .../TypeLoaderEnvironment.NamedTypeLookup.cs | 2 +- .../src/System/RuntimeExceptionHelpers.cs | 5 +- .../NativeFormat/Generator/ReaderGen.cs | 2 +- .../DynamicInvokeThunkGenerationPolicy.cs | 3 +- .../ReadyToRun/ArgIterator.cs | 49 +------------------ .../ReadyToRun/TransitionBlock.cs | 21 -------- src/coreclr/vm/eventtracepriv.h | 3 +- .../AsyncTaskMethodBuilderT.cs | 4 +- .../src/System/ThrowHelper.cs | 4 +- .../System.Reflection/tests/GetTypeTests.cs | 8 +-- .../Marshal/GetNativeVariantForObjectTests.cs | 3 +- .../Reflection/BindingFlagsDoNotWrap.cs | 2 +- .../src/Data/PreferredCodePageNames.csv | 2 +- .../src/System/Text/EncodingNLS.cs | 7 ++- .../Common/CoreCLRTestLibrary/Utilities.cs | 3 +- .../GC/Stress/Tests/allocationwithpins.cs | 2 +- .../ReversePInvoke/Struct.cs | 2 +- .../DynamicGenerics/universal_generics.cs | 3 -- .../SmokeTests/UnitTests/Generics.cs | 1 - src/tests/readytorun/tests/generics.cs | 1 - 42 files changed, 65 insertions(+), 212 deletions(-) delete mode 100644 src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.Interop.cs diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/CachedInterfaceDispatch.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/CachedInterfaceDispatch.cs index 0467bad892948..8c36e8312e485 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/CachedInterfaceDispatch.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/CachedInterfaceDispatch.cs @@ -51,7 +51,7 @@ private static IntPtr RhpResolveInterfaceMethod(object pObject, IntPtr pCell) { if (pObject == null) { - // ProjectN Optimizer may perform code motion on dispatch such that it occurs independant of + // Optimizer may perform code motion on dispatch such that it occurs independant of // null check on "this" pointer. Allow for this case by returning back an invalid pointer. return IntPtr.Zero; } diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs index 28964186a0608..e98e0520a0b36 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs @@ -20,10 +20,8 @@ public enum RhFailFastReason UnhandledException_ExceptionDispatchNotAllowed = 2, // "Unhandled exception: no handler found before escaping a finally clause or other fail-fast scope." UnhandledException_CallerDidNotHandle = 3, // "Unhandled exception: no handler found in calling method." ClassLibDidNotTranslateExceptionID = 4, // "Unable to translate failure into a classlib-specific exception object." - - PN_UnhandledException = 5, // ProjectN: "unhandled exception" - PN_UnhandledExceptionFromPInvoke = 6, // ProjectN: "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." - Max + UnhandledException = 5, // "unhandled exception" + UnhandledExceptionFromPInvoke = 6, // "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." } internal static unsafe partial class EH @@ -648,7 +646,7 @@ private static void DispatchEx(ref StackFrameIterator frameIter, ref ExInfo exIn OnUnhandledExceptionViaClassLib(exceptionObj); UnhandledExceptionFailFastViaClasslib( - RhFailFastReason.PN_UnhandledException, + RhFailFastReason.UnhandledException, exceptionObj, (IntPtr)prevOriginalPC, // IP of the last frame that did not handle the exception ref exInfo); @@ -926,12 +924,12 @@ private static void InvokeSecondPass(ref ExInfo exInfo, uint idxStart, uint idxL [UnmanagedCallersOnly(EntryPoint = "RhpFailFastForPInvokeExceptionPreemp", CallConvs = new Type[] { typeof(CallConvCdecl) })] public static void RhpFailFastForPInvokeExceptionPreemp(IntPtr PInvokeCallsiteReturnAddr, void* pExceptionRecord, void* pContextRecord) { - FailFastViaClasslib(RhFailFastReason.PN_UnhandledExceptionFromPInvoke, null, PInvokeCallsiteReturnAddr); + FailFastViaClasslib(RhFailFastReason.UnhandledExceptionFromPInvoke, null, PInvokeCallsiteReturnAddr); } [RuntimeExport("RhpFailFastForPInvokeExceptionCoop")] public static void RhpFailFastForPInvokeExceptionCoop(IntPtr classlibBreadcrumb, void* pExceptionRecord, void* pContextRecord) { - FailFastViaClasslib(RhFailFastReason.PN_UnhandledExceptionFromPInvoke, null, classlibBreadcrumb); + FailFastViaClasslib(RhFailFastReason.UnhandledExceptionFromPInvoke, null, classlibBreadcrumb); } } // static class EH } diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ThunkPool.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ThunkPool.cs index aed8ea05e51dc..76234dde14e4d 100644 --- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ThunkPool.cs +++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ThunkPool.cs @@ -25,8 +25,8 @@ // // With FEATURE_RX_THUNKS, thunks are created by allocating new virtual memory space, where the first half of // that space is filled with thunk stubs, and gets RX permissions, and the second half is for the thunks data, -// and gets RW permissions. The thunk stubs and data blocks are not in groupped in pairs like in ProjectN: all -// the thunk stubs blocks are groupped at the begining of the allocated virtual memory space, and all the +// and gets RW permissions. The thunk stubs and data blocks are not in groupped in pairs: +// all the thunk stubs blocks are groupped at the begining of the allocated virtual memory space, and all the // thunk data blocks are groupped in the second half of the virtual space. // // Available thunks are tracked using a linked list. The first cell in the data block of each thunk is diff --git a/src/coreclr/nativeaot/Runtime/eventtracepriv.h b/src/coreclr/nativeaot/Runtime/eventtracepriv.h index 3e425cdd881a8..bfe76566c5dcf 100644 --- a/src/coreclr/nativeaot/Runtime/eventtracepriv.h +++ b/src/coreclr/nativeaot/Runtime/eventtracepriv.h @@ -125,8 +125,7 @@ class BulkTypeValue // This is really a denorm of the size already stored in rgTypeParameters, but we // need a persistent place to stash this away so EventDataDescCreate & EventWrite // have a reliable place to copy it from. This is filled in at the last minute, - // when sending the event. (On ProjectN, which doesn't have StackSArray, this is - // filled in earlier and used in more places.) + // when sending the event. ULONG cTypeParameters; #ifdef FEATURE_REDHAWK diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs index 7eaa4134426d8..1ee466feb53a3 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs @@ -115,7 +115,7 @@ internal static ReflectionCoreCallbacks ReflectionCoreCallbacks // // This class is implemented by Internal.Reflection.Core.dll and provides the actual implementation - // of Type.GetTypeInfo() and (on Project N) (Assembly.Load()). + // of Type.GetTypeInfo() and Assembly.Load(). // [System.Runtime.CompilerServices.ReflectionBlocked] public abstract class ReflectionCoreCallbacks diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Extensions/NonPortable/CustomAttributeSearcher.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Extensions/NonPortable/CustomAttributeSearcher.cs index bc9a9d770bc65..40db8b38ebff7 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Extensions/NonPortable/CustomAttributeSearcher.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Extensions/NonPortable/CustomAttributeSearcher.cs @@ -56,7 +56,7 @@ public IEnumerable GetMatchingCustomAttributes(E element, T // // Since "typeFilterKnownToBeSealed" is only used to enable an optimization, it's always safe to leave it "false". // - // Because the Project N toolchain removes any custom attribute that refuses to opt into metadata so at this point, + // Because the NativeAOT toolchain removes any custom attribute that refuses to opt into metadata so at this point, // we could simply return an empty enumeration and "be correct." However, the code paths following this already do that naturally. // (i.e. the "passFilter" will never return true, thus we will never attempt to query the custom attribute type for its // own AttributeUsage custom attribute.) If the toolchain behavior changes in the future, it's preferable that @@ -191,8 +191,6 @@ private static AttributeUsageAttribute GetAttributeUsage(Type attributeType) // // Legacy: Why aren't we checking the parent types? Answer: Although AttributeUsageAttribute is itself marked inheritable, desktop Reflection // treats it as *non*-inheritable for the purpose of deciding whether another attribute class is inheritable. - // This behavior goes all the way back to at least 3.5 (and perhaps earlier). For compat reasons, - // we won't-fixed this in 4.5 and we won't-fix this in Project N. // AttributeUsageAttribute? usage = attributeType.GetCustomAttribute(inherit: false); if (usage == null) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Array.CoreRT.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Array.CoreRT.cs index 4ce3f07f0e987..97cf9e2387665 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Array.CoreRT.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Array.CoreRT.cs @@ -109,9 +109,9 @@ private static void ValidateElementType(Type elementType) public void Initialize() { - // Project N port note: On the desktop, this api is a nop unless the array element type is a value type with - // an explicit nullary constructor. Such a type cannot be expressed in C# so Project N does not support this. - // The ILC toolchain fails the build if it encounters such a type. + // This api is a nop unless the array element type is a value type with an explicit nullary constructor. + // Such a type could not be expressed in C# up until recently. + // TODO: Implement this return; } diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs index 157505ffdb0e6..24fdd69e0d221 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs @@ -60,20 +60,8 @@ protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Al // If the thunk does not exist, the function will return IntPtr.Zero. private protected virtual IntPtr GetThunk(int whichThunk) { -#if PROJECTN - // The GetThunk function should be overriden on all delegate types, except for universal - // canonical delegates which use calling convention converter thunks to marshal arguments - // for the delegate call. If we execute this version of GetThunk, we can at least assert - // that the current delegate type is a generic type. - Debug.Assert(this.EETypePtr.IsGeneric); - return TypeLoaderExports.GetDelegateThunk(this, whichThunk); -#else - // CoreRT doesn't support Universal Shared Code right now, so let's make this method return null for now. - // When CoreRT adds USG support we'll probably want to do some level of IL switching here so that - // we don't have this static call into type loader when USG is not enabled at compile time. - // The static call hurts size in our minimal targets. + // NativeAOT doesn't support Universal Shared Code, so let's make this method return null. return IntPtr.Zero; -#endif } /// diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs index 3f21e4fb76e59..20564fe4b1815 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs @@ -125,9 +125,8 @@ public enum RhFailFastReason UnhandledException_ExceptionDispatchNotAllowed = 2, // "Unhandled exception: no handler found before escaping a finally clause or other fail-fast scope." UnhandledException_CallerDidNotHandle = 3, // "Unhandled exception: no handler found in calling method." ClassLibDidNotTranslateExceptionID = 4, // "Unable to translate failure into a classlib-specific exception object." - PN_UnhandledException = 5, // ProjectN: "Unhandled exception: a managed exception was not handled before reaching unmanaged code" - PN_UnhandledExceptionFromPInvoke = 6, // ProjectN: "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." - Max + UnhandledException = 5, // "Unhandled exception: a managed exception was not handled before reaching unmanaged code" + UnhandledExceptionFromPInvoke = 6, // "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." } private static string GetStringForFailFastReason(RhFailFastReason reason) @@ -142,9 +141,9 @@ private static string GetStringForFailFastReason(RhFailFastReason reason) return "Unhandled exception: no handler found in calling method."; case RhFailFastReason.ClassLibDidNotTranslateExceptionID: return "Unable to translate failure into a classlib-specific exception object."; - case RhFailFastReason.PN_UnhandledException: + case RhFailFastReason.UnhandledException: return "Unhandled exception: a managed exception was not handled before reaching unmanaged code."; - case RhFailFastReason.PN_UnhandledExceptionFromPInvoke: + case RhFailFastReason.UnhandledExceptionFromPInvoke: return "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition."; default: return "Unknown reason."; @@ -179,9 +178,9 @@ public static void ReportUnhandledException(Exception exception) // If possible report the exception to GEH, if not fail fast. WinRTInteropCallbacks callbacks = WinRTInterop.UnsafeCallbacks; if (callbacks == null || !callbacks.ReportUnhandledError(exception)) - FailFast(GetStringForFailFastReason(RhFailFastReason.PN_UnhandledException), exception); + FailFast(GetStringForFailFastReason(RhFailFastReason.UnhandledException), exception); #else - FailFast(GetStringForFailFastReason(RhFailFastReason.PN_UnhandledException), exception); + FailFast(GetStringForFailFastReason(RhFailFastReason.UnhandledException), exception); #endif } @@ -206,7 +205,7 @@ public static void RuntimeFailFast(RhFailFastReason reason, Exception? exception if (!minimalFailFast) { - if ((reason == RhFailFastReason.PN_UnhandledException) && (exception != null)) + if ((reason == RhFailFastReason.UnhandledException) && (exception != null)) { Debug.WriteLine("Unhandled Exception: " + exception.ToString()); } @@ -267,7 +266,7 @@ internal static void FailFast(string message, Exception? exception, RhFailFastRe // * RhFailFastReason, if it is one of the known reasons if (exception != null) { - if (reason == RhFailFastReason.PN_UnhandledException) + if (reason == RhFailFastReason.UnhandledException) errorCode = (uint)(exception.GetEETypePtr().GetHashCode()); else if (exception.HResult != 0) errorCode = (uint)exception.HResult; diff --git a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs index 07f9cd7143c96..24506863ab20b 100644 --- a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs +++ b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/Internal/Reflection/RuntimeTypeInfo.cs @@ -187,7 +187,10 @@ protected override bool IsByRefImpl() return RuntimeAugments.IsByRefType(_typeHandle); } - protected override bool IsCOMObjectImpl() => throw new NotSupportedException(SR.Reflection_Disabled); + protected override bool IsCOMObjectImpl() + { + return false; + } protected override bool IsPointerImpl() { diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs index 64942f3c0d082..7330b8f829985 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/Internal/Reflection/Core/Execution/ExecutionEnvironment.cs @@ -93,7 +93,6 @@ public abstract class ExecutionEnvironment //============================================================================================== // Other //============================================================================================== - public abstract bool IsCOMObject(Type type); public abstract FieldAccessor CreateLiteralFieldAccessor(object value, RuntimeTypeHandle fieldTypeHandle); public abstract EnumInfo GetEnumInfo(RuntimeTypeHandle typeHandle); diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs index 207fe4c68a8c3..7f5dde597cce8 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs @@ -52,31 +52,7 @@ public sealed override bool Equals(object obj) public sealed override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) { -#if PROJECTN - if (parameters != null && parameters.Length != 0) - throw new TargetParameterCountException(); - - Guid clsid = _declaringType.GUID; - string server = _declaringType.Server; - IntPtr pItf = IntPtr.Zero; - try - { - pItf = McgMarshal.CoCreateInstanceEx(clsid, server); - - // CoCreateInstanceEx will throw exception if it fails to - // create an instance. - Debug.Assert(pItf != IntPtr.Zero); - - return Marshal.GetObjectForIUnknown(pItf); - } - finally - { - if (pItf != IntPtr.Zero) - Marshal.Release(pItf); - } -#else throw new PlatformNotSupportedException(); -#endif } public sealed override MethodBase MetadataDefinitionMethod { get { throw new NotSupportedException(); } } diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Modules/RuntimeModule.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Modules/RuntimeModule.cs index 4efce9b9a1790..c799a3db28a5e 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Modules/RuntimeModule.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Modules/RuntimeModule.cs @@ -12,8 +12,8 @@ namespace System.Reflection.Runtime.Modules // // The runtime's implementation of a Module. // - // Modules are quite meaningless in ProjectN but we have to keep up the appearances since they still exist in Win8P's surface area. - // As far as ProjectN is concerned, each Assembly has one module. + // Modules are quite meaningless in .NET Core but we have to keep up the appearances since they still exist in surface area. + // Each Assembly has one (manifest) module. // internal abstract partial class RuntimeModule : Module { diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs index 66222d901baa6..bf946e99f1d26 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs @@ -610,7 +610,7 @@ protected sealed override TypeCode GetTypeCodeImpl() protected sealed override bool IsCOMObjectImpl() { - return ReflectionCoreExecution.ExecutionEnvironment.IsCOMObject(this); + return false; } protected sealed override bool IsPrimitiveImpl() diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.Interop.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.Interop.cs deleted file mode 100644 index b9941aaec9444..0000000000000 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.Interop.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using global::System; -using global::System.Runtime.InteropServices; -using global::Internal.Reflection.Core.Execution; - -namespace Internal.Reflection.Execution -{ - //========================================================================================================== - // These ExecutionEnvironment entrypoints provide access to the Interop\MCG information that - // enables Reflection invoke - //========================================================================================================== - internal sealed partial class ExecutionEnvironmentImplementation : ExecutionEnvironment - { - public sealed override bool IsCOMObject(Type type) - { -#if PROJECTN - return McgMarshal.IsComObject(type); -#else - return false; -#endif - } - } -} diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs index c415c1fc99fa6..7a9d3e6193439 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs @@ -197,7 +197,7 @@ public unsafe sealed override bool TryGetTypeReferenceForNamedType(RuntimeTypeHa /// metadataReader + typeRefHandle - a valid metadata reader + typeReferenceHandle where "metadataReader" is one /// of the metadata readers returned by ExecutionEnvironment.MetadataReaders. /// - /// Note: Although this method has a "bool" return value like the other mapping table accessors, the Project N pay-for-play design + /// Note: Although this method has a "bool" return value like the other mapping table accessors, the pay-for-play design /// guarantees that any type that has a metadata TypeReference to it also has a RuntimeTypeHandle underneath. /// /// Metadata reader for module containing the type reference diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionDomainSetupImplementation.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionDomainSetupImplementation.cs index efc5de5f13f30..439be77221166 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionDomainSetupImplementation.cs +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ReflectionDomainSetupImplementation.cs @@ -10,7 +10,7 @@ namespace Internal.Reflection.Execution { //========================================================================================================================= - // The setup information for the reflection domain used for Project N's "classic reflection". + // The setup information for the reflection domain used for "classic reflection". //========================================================================================================================= internal sealed class ReflectionDomainSetupImplementation : ReflectionDomainSetup { diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj index 1d4de60c96515..163276778502b 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj @@ -25,7 +25,6 @@ - diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Reflection/Execution/AssemblyBinderImplementation.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Reflection/Execution/AssemblyBinderImplementation.cs index f839a2a48511d..7808d1695c8e0 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Reflection/Execution/AssemblyBinderImplementation.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Reflection/Execution/AssemblyBinderImplementation.cs @@ -17,7 +17,7 @@ namespace Internal.Reflection.Execution { //============================================================================================================================= - // The assembly resolution policy for Project N's emulation of "classic reflection." + // The assembly resolution policy for emulation of "classic reflection." // // The policy is very simple: the only assemblies that can be "loaded" are those that are statically linked into the running // native process. There is no support for probing for assemblies in directories, user-supplied files, GACs, NICs or any diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallingConventions.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallingConventions.cs index f6fe938e49bc9..32582ae5e8afa 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallingConventions.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallingConventions.cs @@ -618,7 +618,7 @@ private static bool IsArgumentInRegister(ref int pNumRegistersUsed, CorElementTy case CorElementType.ELEMENT_TYPE_VALUETYPE: { - // On ProjectN valuetypes of integral size are passed enregistered + // Valuetypes of integral size are passed enregistered int structSize = TypeHandle.GetElemSize(typ, thArgType); switch (structSize) { @@ -1357,7 +1357,7 @@ private unsafe void ForceSigWalk() if (this.HasRetBuffArg() && IsRetBuffPassedAsFirstArg()) { // DESKTOP BEHAVIOR numRegistersUsed++; - // On ProjectN ret buff arg is passed on the call stack as the top stack arg + // ret buff arg is passed on the call stack as the top stack arg nSizeOfArgStack += IntPtr.Size; } diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs index c1ff399482a52..5873727a2aff2 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs @@ -453,9 +453,7 @@ private static void CreateEETypeWorker(MethodTable* pTemplateEEType, uint hashCo pEEType->OptionalFieldsPtr = (byte*)pEEType + cbEEType; optionalFields.WriteToEEType(pEEType, cbOptionalFieldsSize); -#if !PROJECTN pEEType->PointerToTypeManager = PermanentAllocatedMemoryBlobs.GetPointerToIntPtr(moduleInfo.Handle.GetIntPtrUNSAFE()); -#endif pEEType->DynamicModule = dynamicModulePtr; // Copy VTable entries from template type diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs index bc1b0b3e7eca7..425fc6e627f16 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs @@ -168,7 +168,7 @@ public static unsafe bool TryGetTypeReferenceForNamedType(RuntimeTypeHandle runt /// metadataReader + typeRefHandle - a valid metadata reader + typeReferenceHandle where "metadataReader" is one /// of the metadata readers returned by ExecutionEnvironment.MetadataReaders. /// - /// Note: Although this method has a "bool" return value like the other mapping table accessors, the Project N pay-for-play design + /// Note: Although this method has a "bool" return value like the other mapping table accessors, the pay-for-play design /// guarantees that any type that has a metadata TypeReference to it also has a RuntimeTypeHandle underneath. /// /// Metadata reader for module containing the type reference @@ -191,7 +191,7 @@ public static unsafe bool TryGetNamedTypeForTypeReference(MetadataReader metadat /// metadataReader + typeRefHandle - a valid metadata reader + typeReferenceHandle where "metadataReader" is one /// of the metadata readers returned by ExecutionEnvironment.MetadataReaders. /// - /// Note: Although this method has a "bool" return value like the other mapping table accessors, the Project N pay-for-play design + /// Note: Although this method has a "bool" return value like the other mapping table accessors, the pay-for-play design /// guarantees that any type that has a metadata TypeReference to it also has a RuntimeTypeHandle underneath. /// /// Metadata reader for module containing the type reference @@ -702,8 +702,7 @@ public static bool TryResolveMemberReference( public static unsafe bool TryGetMethodMethodNameAndSigFromVTableSlotForPregeneratedOrTemplateType(TypeSystemContext context, RuntimeTypeHandle type, int vtableSlot, out MethodNameAndSignature methodNameAndSig) { // - // NOTE: The semantics of the vtable slot and method declaring type in the VirtualInvokeMap table have slight differences between ProjectN and CoreRT ABIs. - // See comment in TryGetVirtualResolveData for more details. + // See comment in TryGetVirtualResolveData for more details on the semantics of the vtable slot and method declaring type in the VirtualInvokeMap table // int logicalSlot = vtableSlot; @@ -785,7 +784,7 @@ public static bool TryGetVirtualResolveData(NativeFormatModuleInfo module, externalReferences.InitializeCommonFixupsTable(module); // - // On CoreRT, the vtable entries for each instantiated type might not necessarily exist. + // The vtable entries for each instantiated type might not necessarily exist. // Example 1: // If there's a call to Foo.Method1 and a call to Foo.Method2, Foo will // not have Method2 in its vtable and Foo will not have Method1. @@ -901,8 +900,7 @@ private static unsafe bool TryGetMethodNameAndSigFromVirtualResolveData(NativeFo RuntimeTypeHandle declaringType, int logicalSlot, out MethodNameAndSignature methodNameAndSig) { // - // NOTE: The semantics of the vtable slot and method declaring type in the VirtualInvokeMap table have slight differences between ProjectN and CoreRT ABIs. - // See comment in TryGetVirtualResolveData for more details. + // See comment in TryGetVirtualResolveData for more details on the semantics of the vtable slot and method declaring type in the VirtualInvokeMap table // NativeReader invokeMapReader = GetNativeReaderForBlob(module, ReflectionMapBlob.VirtualInvokeMap); diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.NamedTypeLookup.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.NamedTypeLookup.cs index 8d4eab59061d5..478a6faa10511 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.NamedTypeLookup.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.NamedTypeLookup.cs @@ -243,7 +243,7 @@ public unsafe bool TryGetStaticsInfoForNamedType(RuntimeTypeHandle runtimeTypeHa /// metadataReader + typeDefHandle - a valid metadata reader + typeDefinitionHandle where "metadataReader" is one /// of the metadata readers returned by ExecutionEnvironment.MetadataReaders. /// - /// Note: Although this method has a "bool" return value like the other mapping table accessors, the Project N pay-for-play design + /// Note: Although this method has a "bool" return value like the other mapping table accessors, the pay-for-play design /// guarantees that any type enabled for metadata also has a RuntimeTypeHandle underneath. /// /// TypeDef handle for the type to look up diff --git a/src/coreclr/nativeaot/Test.CoreLib/src/System/RuntimeExceptionHelpers.cs b/src/coreclr/nativeaot/Test.CoreLib/src/System/RuntimeExceptionHelpers.cs index 9eeacfecfeaaa..8d0b49a67c400 100644 --- a/src/coreclr/nativeaot/Test.CoreLib/src/System/RuntimeExceptionHelpers.cs +++ b/src/coreclr/nativeaot/Test.CoreLib/src/System/RuntimeExceptionHelpers.cs @@ -87,9 +87,8 @@ public enum RhFailFastReason UnhandledException_ExceptionDispatchNotAllowed = 2, // "Unhandled exception: no handler found before escaping a finally clause or other fail-fast scope." UnhandledException_CallerDidNotHandle = 3, // "Unhandled exception: no handler found in calling method." ClassLibDidNotTranslateExceptionID = 4, // "Unable to translate failure into a classlib-specific exception object." - PN_UnhandledException = 5, // ProjectN: "Unhandled exception: a managed exception was not handled before reaching unmanaged code" - PN_UnhandledExceptionFromPInvoke = 6, // ProjectN: "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." - Max + UnhandledException = 5, // "Unhandled exception: a managed exception was not handled before reaching unmanaged code" + UnhandledExceptionFromPInvoke = 6, // "Unhandled exception: an unmanaged exception was thrown out of a managed-to-native transition." } // This is the classlib-provided fail-fast function that will be invoked whenever the runtime diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs index aa1a796bfaa0f..ea9bba916ba8d 100644 --- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs +++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // -// This class generates most of the implementation of the MetadataReader for the ProjectN format, +// This class generates most of the implementation of the MetadataReader for the NativeAOT format, // ensuring that the contract defined by CsPublicGen2 is implemented.The generated file is // 'NativeFormatReaderGen.cs', and any missing implementation is the supplied in the human-authored // source counterpart 'NativeFormatReader.cs'. diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DynamicInvokeThunkGenerationPolicy.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DynamicInvokeThunkGenerationPolicy.cs index 0a543c837cf75..b67635a7731b5 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DynamicInvokeThunkGenerationPolicy.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DynamicInvokeThunkGenerationPolicy.cs @@ -37,8 +37,7 @@ public override bool HasStaticInvokeThunk(MethodDesc targetMethod) { // Place an upper limit on how many parameters a method can have to still get a static stub. // From the past experience, methods taking 8000+ parameters get a stub that can hit various limitations - // in the codegen. On Project N, we were limited to 256 parameters because of MDIL limitations. - // We don't have such limitations here, but it's a nice round number. + // in the codegen. // Reflection invoke will still work, but will go through the calling convention converter. return targetMethod.Signature.Length <= 256; diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs index 28d10f23a28f0..4a13af01e6341 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs @@ -730,37 +730,18 @@ public int GetNextOffset() { int numRegistersUsed = 0; -#if PROJECTN || FEATURE_INTERPRETER - int initialArgOffset = 0; -#endif if (HasThis) numRegistersUsed++; if (HasRetBuffArg() && _transitionBlock.IsRetBuffPassedAsFirstArg) { -#if PROJECTN - if (!_transitionBlock.IsX86) -#endif - { - numRegistersUsed++; - } -#if PROJECTN - else - { - // DESKTOP BEHAVIOR is to do nothing here, as ret buf is never reached by the scan algorithm that walks backwards - // but in .NET Native, the x86 argument scan is a forward scan, so we need to skip the ret buf arg (which is always - // on the stack) - initialArgOffset = _transitionBlock.PointerSize; - } -#endif + numRegistersUsed++; } Debug.Assert(!IsVarArg || !HasParamType); -#if !PROJECTN // DESKTOP BEHAVIOR - This block is disabled for x86 as the param arg is the last argument on .NET Framework x86. if (!_transitionBlock.IsX86) -#endif { if (HasParamType) { @@ -802,11 +783,7 @@ public int GetNextOffset() } #endif _x86NumRegistersUsed = numRegistersUsed; -#if PROJECTN - _x86OfsStack = (int)(_transitionBlock.OffsetOfArgs + initialArgOffset); -#else _x86OfsStack = (int)(_transitionBlock.OffsetOfArgs + SizeOfArgStack()); -#endif break; case TargetArchitecture.X64: @@ -880,13 +857,9 @@ public int GetNextOffset() return _transitionBlock.OffsetOfArgumentRegisters + (_transitionBlock.NumArgumentRegisters - _x86NumRegistersUsed) * _transitionBlock.PointerSize; } -#if PROJECTN - argOfs = _x86OfsStack; - _x86OfsStack += _transitionBlock.StackElemSize(argSize); -#else _x86OfsStack -= _transitionBlock.StackElemSize(argSize); argOfs = _x86OfsStack; -#endif + Debug.Assert(argOfs >= _transitionBlock.OffsetOfArgs); return argOfs; @@ -1384,24 +1357,8 @@ private void ForceSigWalk() if (HasRetBuffArg() && _transitionBlock.IsRetBuffPassedAsFirstArg) { -#if PROJECTN - // On ProjectN ret buff arg is passed on the call stack as the top stack arg - nSizeOfArgStack += _transitionBlock.PointerSize; -#else - numRegistersUsed++; -#endif - } - -#if PROJECTN - // DESKTOP BEHAVIOR - This block is disabled for x86 as the param arg is the last argument on .NET Framework x86. - if (HasParamType) - { numRegistersUsed++; - _paramTypeLoc = (numRegistersUsed == 1) ? - ParamTypeLocation.Ecx : ParamTypeLocation.Edx; - Debug.Assert(numRegistersUsed <= 2); } -#endif if (IsVarArg) { @@ -1448,7 +1405,6 @@ private void ForceSigWalk() } } -#if !PROJECTN if (HasParamType) { if (numRegistersUsed < _transitionBlock.NumArgumentRegisters) @@ -1463,7 +1419,6 @@ private void ForceSigWalk() _paramTypeLoc = ParamTypeLocation.Stack; } } -#endif } else { diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs index a044a42b1d2dd..d62454ca11d84 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs @@ -205,22 +205,6 @@ public bool IsArgumentInRegister(ref int pNumRegistersUsed, CorElementType typ, case CorElementType.ELEMENT_TYPE_SZARRAY: pNumRegistersUsed++; return true; -#if PROJECTN - case CorElementType.ELEMENT_TYPE_VALUETYPE: - { - // On ProjectN valuetypes of integral size are passed enregistered - int structSize = TypeHandle.GetElemSize(typ, thArgType); - switch (structSize) - { - case 1: - case 2: - case 4: - pNumRegistersUsed++; - return true; - } - break; - } -#elif READYTORUN case CorElementType.ELEMENT_TYPE_VALUETYPE: if (IsTrivialPointerSizedStruct(thArgType)) { @@ -228,7 +212,6 @@ public bool IsArgumentInRegister(ref int pNumRegistersUsed, CorElementType typ, return true; } break; -#endif } } @@ -462,11 +445,7 @@ public override int OffsetFromGCRefMapPos(int pos) /// public override int GetRetBuffArgOffset(bool hasThis) { -#if PROJECTN - return OffsetOfArgs; -#else return hasThis ? X86Constants.OffsetOfEdx : X86Constants.OffsetOfEcx; -#endif } public override int StackElemSize(int parmSize, bool isValueType = false, bool isFloatHfa = false) diff --git a/src/coreclr/vm/eventtracepriv.h b/src/coreclr/vm/eventtracepriv.h index 54fdd43a176c3..8ea1a2aa31eb1 100644 --- a/src/coreclr/vm/eventtracepriv.h +++ b/src/coreclr/vm/eventtracepriv.h @@ -223,8 +223,7 @@ class BulkTypeValue // This is really a denorm of the size already stored in rgTypeParameters, but we // need a persistent place to stash this away so EventDataDescCreate & EventWrite // have a reliable place to copy it from. This is filled in at the last minute, - // when sending the event. (On ProjectN, which doesn't have StackSArray, this is - // filled in earlier and used in more places.) + // when sending the event. ULONG cTypeParameters; #ifdef FEATURE_REDHAWK diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs index 5b1c5459182f6..2498382782860 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs @@ -212,7 +212,7 @@ private static IAsyncStateMachineBox GetStateMachineBox( #if CORERT // DebugFinalizableAsyncStateMachineBox looks like a small type, but it actually is not because // it will have a copy of all the slots from its parent. It will add another hundred(s) bytes - // per each async method in CoreRT / ProjectN binaries without adding much value. Avoid + // per each async method in NativeAOT binaries without adding much value. Avoid // generating this extra code until a better solution is implemented. var box = new AsyncStateMachineBox(); #else @@ -400,7 +400,7 @@ internal static Task CreateWeaklyTypedStateMachineBox() #if CORERT // DebugFinalizableAsyncStateMachineBox looks like a small type, but it actually is not because // it will have a copy of all the slots from its parent. It will add another hundred(s) bytes - // per each async method in CoreRT / ProjectN binaries without adding much value. Avoid + // per each async method in NativeAOT binaries without adding much value. Avoid // generating this extra code until a better solution is implemented. return new AsyncStateMachineBox(); #else diff --git a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs index b11ff9905c547..b02de0879a9ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -682,7 +682,7 @@ internal static void ThrowForUnsupportedIntrinsicsVector256BaseType() where T } } -#if false // Reflection-based implementation does not work for CoreRT/ProjectN +#if false // Reflection-based implementation does not work for NativeAOT // This function will convert an ExceptionArgument enum value to the argument name string. [MethodImpl(MethodImplOptions.NoInlining)] private static string GetArgumentName(ExceptionArgument argument) @@ -900,7 +900,7 @@ private static string GetArgumentName(ExceptionArgument argument) } } -#if false // Reflection-based implementation does not work for CoreRT/ProjectN +#if false // Reflection-based implementation does not work for NativeAOT // This function will convert an ExceptionResource enum value to the resource string. [MethodImpl(MethodImplOptions.NoInlining)] private static string GetResourceString(ExceptionResource resource) diff --git a/src/libraries/System.Reflection/tests/GetTypeTests.cs b/src/libraries/System.Reflection/tests/GetTypeTests.cs index 5cc854e1f3d1d..43820b36351d8 100644 --- a/src/libraries/System.Reflection/tests/GetTypeTests.cs +++ b/src/libraries/System.Reflection/tests/GetTypeTests.cs @@ -155,8 +155,8 @@ public void GetTypeTest(string typeName, Type expectedResult) // When called with "ignoreCase: true", GetType() may have a choice of matching items. The one that is chosen // is an implementation detail (and on the CLR, *very* implementation-dependent as it's influenced by the internal - // layout of private hash tables.) As a result, we do not expect the same result across .NET Framework and Project N - // and so the best we can do is compare the names. + // layout of private hash tables.) As a result, we do not expect the same result across runtimes and so the best + // we can do is compare the names. string expectedName = expectedResult.AssemblyQualifiedName; Assert.Equal(expectedResult, Type.GetType(typeName, throwOnError: false, ignoreCase: false)); @@ -209,8 +209,8 @@ public void GetTypeTest(string typeName, Type expectedResult) // When called with "ignoreCase: true", GetType() may have a choice of matching items. The one that is chosen // is an implementation detail (and on the CLR, *very* implementation-dependent as it's influenced by the internal - // layout of private hash tables.) As a result, we do not expect the same result across .NET Framework and Project N - // and so the best we can do is compare the names. + // layout of private hash tables.) As a result, we do not expect the same result across runtimes and so the best + // we can do is compare the names. string expectedName = expectedResult.AssemblyQualifiedName; Assert.Null(Type.GetType(typeName, throwOnError: false, ignoreCase: false)); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.cs index edeb1a0fe207b..34fee0dd1d7a2 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.cs @@ -322,8 +322,7 @@ public void GetNativeVariant_HandleObject_ThrowsArgumentException(object obj) public static void GetNativeVariantForObject_CantCastToObject_ThrowsInvalidCastException() { // While GetNativeVariantForObject supports taking chars, GetObjectForNativeVariant will - // never return a char. The internal type is ushort, as mentioned above. This behavior - // is the same on ProjectN and Desktop CLR. + // never return a char. The internal type is ushort, as mentioned above. var v = new Variant(); IntPtr pNative = Marshal.AllocHGlobal(Marshal.SizeOf(v)); try diff --git a/src/libraries/System.Runtime/tests/System/Reflection/BindingFlagsDoNotWrap.cs b/src/libraries/System.Runtime/tests/System/Reflection/BindingFlagsDoNotWrap.cs index 98cc175c84da4..0bebd1c99c97f 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/BindingFlagsDoNotWrap.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/BindingFlagsDoNotWrap.cs @@ -34,7 +34,7 @@ public static void ConstructorInvokeTwoArgs() [Fact] public static void ConstructorInvokeStringCtor() { - // Code coverage: Project N - String constructors go through a separate code path. + // Code coverage: String constructors go through a separate code path. ConstructorInfo c = typeof(string).GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(char[]), typeof(int), typeof(int) }, null); TestDoNotWrap((bf) => c.Invoke(bf, null, new object[] { null, 0, 0 }, null)); } diff --git a/src/libraries/System.Text.Encoding.CodePages/src/Data/PreferredCodePageNames.csv b/src/libraries/System.Text.Encoding.CodePages/src/Data/PreferredCodePageNames.csv index 8e18d994fc2c8..3974e27a9d594 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/Data/PreferredCodePageNames.csv +++ b/src/libraries/System.Text.Encoding.CodePages/src/Data/PreferredCodePageNames.csv @@ -1,6 +1,6 @@ # # This file contains data for mapping from mapping from code page numbers to their preferred IANA encoding names -# and English names (we do not currently localize ProjectN libraries) +# and English names # # This can be used as input to the EncodingData tool when generating EncodingTable.Data.cs # diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingNLS.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingNLS.cs index 9a2d1be7da703..6bb8b41dbe370 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingNLS.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingNLS.cs @@ -340,11 +340,10 @@ public override string EncodingName if (_encodingName.StartsWith("Globalization_cp_", StringComparison.OrdinalIgnoreCase)) { - // On ProjectN, resource strings are stripped from retail builds and replaced by + // Resource strings may be stripped from retail builds and replaced by // their identifier names. Since this property is meant to be a localized string, - // but we don't localize ProjectN, we specifically need to do something reasonable - // in this case. This currently returns the English name of the encoding from a - // static data table. + // we specifically need to do something reasonable in this case. This currently + // returns the English name of the encoding from a static data table. _encodingName = EncodingTable.GetEnglishNameFromCodePage(CodePage); if (_encodingName == null) { diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index 0ab8a56ce7e2c..55d5c77d07ab7 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -157,8 +157,7 @@ public static string FormatHexStringFromUnicodeString(string string1, bool inclu return returnString; } - // Given a character, display its unicode value in hex format. ProjectN doens't support - // unicode category as a Property on Char. + // Given a character, display its unicode value in hex format. public static string FormatHexStringFromUnicodeChar(char char1, bool includeUnicodeCategory) { if (includeUnicodeCategory) diff --git a/src/tests/GC/Stress/Tests/allocationwithpins.cs b/src/tests/GC/Stress/Tests/allocationwithpins.cs index 6aaf0ff78eb8c..5eaf0bee68819 100644 --- a/src/tests/GC/Stress/Tests/allocationwithpins.cs +++ b/src/tests/GC/Stress/Tests/allocationwithpins.cs @@ -504,7 +504,7 @@ public static int Main(string[] args) Console.WriteLine("iterating {0} times", iter_num); } - // ProjectN doesn't support thread! for now just do everything on the main thread. + // For now just do everything on the main thread. //int threadCount = 8; // int threadCount = 1; // if (args.Length >= 2) diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/Struct.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/Struct.cs index 8605c7c7a267e..dce4fb9cff33c 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/Struct.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/Struct.cs @@ -143,7 +143,7 @@ public struct S8 { public string name; public bool gender; - [MarshalAs(UnmanagedType.Error)] //In ProjectN, MarshalAsError isnt supported in V1 + [MarshalAs(UnmanagedType.Error)] public int i32; [MarshalAs(UnmanagedType.Error)] public uint ui32; diff --git a/src/tests/nativeaot/SmokeTests/DynamicGenerics/universal_generics.cs b/src/tests/nativeaot/SmokeTests/DynamicGenerics/universal_generics.cs index 368e5d7633b25..ce6aa64f7995c 100644 --- a/src/tests/nativeaot/SmokeTests/DynamicGenerics/universal_generics.cs +++ b/src/tests/nativeaot/SmokeTests/DynamicGenerics/universal_generics.cs @@ -3406,9 +3406,6 @@ public static unsafe void EntryPoint() { Type targ1 = typeof(EventPattern<>).MakeGenericType(TypeOf.String); Type targ2 = typeof(StateProducer<>).MakeGenericType(targ1); - // *** RANDOME REFLECTION BUG: this works on the desktop CLR, but doesn't in ProjectN :) ***: - //Type targ3 = targ2.GetTypeInfo().GetDeclaredNestedType("State").MakeGenericType(targ1); - // Use this workaround instead: Type targ3 = typeof(StateProducer<>).GetTypeInfo().GetDeclaredNestedType("State").MakeGenericType(targ1); Type delType = typeof(Func<,,>).MakeGenericType(typeof(IInterface), targ3, TypeOf.String); diff --git a/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs b/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs index 785333e49092b..4d8289e128623 100644 --- a/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs +++ b/src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs @@ -911,7 +911,6 @@ public static void Run() // BaseClass.Method1 has the same slot as BaseClass.Method3 on CoreRT, because vtable entries // get populated on demand (the first type won't get a Method3 entry, and the latter won't get a Method1 entry) - // On ProjectN, both types will get vtable entries for both methods. new BaseClass().Method1(1); m1 = typeof(BaseClass).GetTypeInfo().GetDeclaredMethod("Method1"); Verify("BaseClass.Method1", m1.Invoke(new BaseClass(), new object[] { (int)1 })); diff --git a/src/tests/readytorun/tests/generics.cs b/src/tests/readytorun/tests/generics.cs index b5cbe9dc7c57e..fe1b5e7d588df 100644 --- a/src/tests/readytorun/tests/generics.cs +++ b/src/tests/readytorun/tests/generics.cs @@ -1149,7 +1149,6 @@ public static void Run() // BaseClass.Method1 has the same slot as BaseClass.Method3 on CoreRT, because vtable entries // get populated on demand (the first type won't get a Method3 entry, and the latter won't get a Method1 entry) - // On ProjectN, both types will get vtable entries for both methods. new BaseClass().Method1(1); m1 = typeof(BaseClass).GetMethod("Method1"); Verify("BaseClass.Method1", m1.Invoke(new BaseClass(), new object[] { (int)1 }));