`UnsafeAccessorAttribute` non-generic support (#86932)
authorAaron Robinson <arobins@microsoft.com>
Thu, 15 Jun 2023 13:59:49 +0000 (06:59 -0700)
committerGitHub <noreply@github.com>
Thu, 15 Jun 2023 13:59:49 +0000 (06:59 -0700)
commit56497399532ae09436b5fe4bf7fefd1e0ff79f09
treed2ca6df090a5557005da6e331dd101f51a3ec684
parent4302b80fa089ace2d6fd404af99efddd1f121871
`UnsafeAccessorAttribute` non-generic support (#86932)

* CoreCLR and NativeAOT

* Add UnsafeAccessorAttribute API

* Implement IL generation for all accessor paths

* Implement static/instance field lookup - non-generic

* Implement static/instance method lookup - non-generic

* Defined ambiguity logic with respect to
custom modifiers.
- First pass ignore custom modifiers
- If ambiguity detected, rerun algorithm but
  require precise matching of custom modifiers.
- If there is no clear match throw AmbiguousImplementationException.

* Cleanup memory management confusion
with ILStubResolver.

* Fix non-standard C++

* Remove CORINFO_MODULE_ALLACCESS scope

* Remove enum METHOD_TYPE.

* Update BOTR on TypeDesc
49 files changed:
docs/design/coreclr/botr/type-loader.md
src/coreclr/debug/ee/controller.cpp
src/coreclr/debug/ee/debugger.cpp
src/coreclr/debug/ee/functioninfo.cpp
src/coreclr/dlls/mscorrc/mscorrc.rc
src/coreclr/dlls/mscorrc/resource.h
src/coreclr/ilasm/assem.cpp
src/coreclr/inc/corhlpr.h
src/coreclr/inc/formattype.cpp
src/coreclr/inc/sarray.h
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/TypeLoaderExceptionHelper.cs
src/coreclr/tools/Common/TypeSystem/Common/ExceptionStringID.cs
src/coreclr/tools/Common/TypeSystem/Common/MethodDesc.cs
src/coreclr/tools/Common/TypeSystem/Common/Properties/Resources.resx
src/coreclr/tools/Common/TypeSystem/IL/NativeAotILProvider.cs
src/coreclr/tools/Common/TypeSystem/IL/UnsafeAccessors.cs [new file with mode: 0644]
src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
src/coreclr/vm/amd64/asmconstants.h
src/coreclr/vm/dynamicmethod.cpp
src/coreclr/vm/dynamicmethod.h
src/coreclr/vm/frames.cpp
src/coreclr/vm/frames.h
src/coreclr/vm/gcenv.ee.common.cpp
src/coreclr/vm/ilstubresolver.cpp
src/coreclr/vm/ilstubresolver.h
src/coreclr/vm/jitinterface.cpp
src/coreclr/vm/jitinterface.h
src/coreclr/vm/memberload.cpp
src/coreclr/vm/memberload.h
src/coreclr/vm/method.hpp
src/coreclr/vm/methodtablebuilder.cpp
src/coreclr/vm/methodtablebuilder.h
src/coreclr/vm/methodtablebuilder.inl
src/coreclr/vm/prestub.cpp
src/coreclr/vm/siginfo.cpp
src/coreclr/vm/siginfo.hpp
src/coreclr/vm/stubgen.cpp
src/coreclr/vm/stubgen.h
src/coreclr/vm/stubmgr.cpp
src/coreclr/vm/typehandle.h
src/coreclr/vm/wellknownattributes.h
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/UnsafeAccessorAttribute.cs [new file with mode: 0644]
src/libraries/System.Runtime/ref/System.Runtime.cs
src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs
src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs [new file with mode: 0644]
src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.csproj [new file with mode: 0644]