Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreCLR/NativeAOT] UnsafeAccessorAttribute non-generic support #86932

Merged
merged 55 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0e18368
General cleanup
AaronRobinsonMSFT May 26, 2023
292da73
Prototype for UnsafeAccessorAttribute
AaronRobinsonMSFT May 26, 2023
40111fa
Remove IsUnsafeAccessor flag from MethodDesc
AaronRobinsonMSFT May 27, 2023
0191e0d
Cleanup memory managment confusion
AaronRobinsonMSFT May 27, 2023
ef239fb
Fix non-standard C++
AaronRobinsonMSFT May 29, 2023
a396e04
Add UnsafeAccessorAttribute API
AaronRobinsonMSFT May 29, 2023
6437420
C++ clean-up
AaronRobinsonMSFT May 29, 2023
b24717a
Return missing(field/method) HRESULT when
AaronRobinsonMSFT May 29, 2023
edd7fb7
Implement IL generation for all accessor paths
AaronRobinsonMSFT May 30, 2023
03a9ef3
Implement static/instance field lookup
AaronRobinsonMSFT May 30, 2023
d771f04
Implement static/instance method lookup
AaronRobinsonMSFT May 30, 2023
02267ff
Alter member names for clarity.
AaronRobinsonMSFT May 30, 2023
e911d3a
Add libraries tests
AaronRobinsonMSFT May 31, 2023
c6dbb50
Remove CORINFO_MODULE_ALLACCESS scope
AaronRobinsonMSFT May 31, 2023
9864b45
Fix message buffer
AaronRobinsonMSFT May 31, 2023
60c38dd
Throw exceptions instead of returning HRESULT.
AaronRobinsonMSFT May 31, 2023
10b9c75
Update visibility check API
AaronRobinsonMSFT May 31, 2023
3e9ee12
Remove enum METHOD_TYPE.
AaronRobinsonMSFT May 31, 2023
62f9e81
Disable tests on Mono
AaronRobinsonMSFT May 31, 2023
a506601
Missing virtual destructor
AaronRobinsonMSFT May 31, 2023
b8c94bf
Apply suggestions from code review
AaronRobinsonMSFT Jun 1, 2023
636e616
Apply suggestions from code review
AaronRobinsonMSFT Jun 1, 2023
72bc7f5
Add error message for invalid UnsafeAccessor use
AaronRobinsonMSFT Jun 5, 2023
2859b6e
Debugger logging updates
AaronRobinsonMSFT Jun 5, 2023
331f4cc
Update BOTR on TypeDesc
AaronRobinsonMSFT Jun 5, 2023
c01080e
Fix type used in message
AaronRobinsonMSFT Jun 5, 2023
1d5c1ab
Support UnsafeAccessor in NativeAOT
AaronRobinsonMSFT Jun 5, 2023
34ada73
Review feedback
AaronRobinsonMSFT Jun 6, 2023
a56bc40
Additional test for ctor
AaronRobinsonMSFT Jun 6, 2023
a43b3cc
Remove ctor special case lookup
AaronRobinsonMSFT Jun 6, 2023
3da55de
Remove usage of MetaSig
AaronRobinsonMSFT Jun 6, 2023
bbe820c
Collect custom modifiers counts
AaronRobinsonMSFT Jun 7, 2023
18a2749
Convert all tests to be runtime tests.
AaronRobinsonMSFT Jun 8, 2023
d5ff647
Defined ambiguity logic with respect to
AaronRobinsonMSFT Jun 8, 2023
924cf37
Address ambiguity in NativeAOT
AaronRobinsonMSFT Jun 8, 2023
305aeff
Add all previous tests in libraries into runtime
AaronRobinsonMSFT Jun 8, 2023
c169969
Use AmbiguousMatchException
AaronRobinsonMSFT Jun 8, 2023
3b3691f
Move tests to be Pri0 since they are all we have.
AaronRobinsonMSFT Jun 8, 2023
f0756b7
Add support in ILAsm
AaronRobinsonMSFT Jun 9, 2023
c51e986
Use xplat ARRAY_SIZE.
AaronRobinsonMSFT Jun 9, 2023
12ba472
Remove special handling of empty method in ILASM
AaronRobinsonMSFT Jun 9, 2023
efb27a4
Generate accessors that throw specific failures.
AaronRobinsonMSFT Jun 9, 2023
d3b0726
NativeAOT error handling was throwing asserts.
AaronRobinsonMSFT Jun 9, 2023
56d733e
Remove catch all for any exception. This code
AaronRobinsonMSFT Jun 10, 2023
facc48e
Use declaration method as owner for stubs
AaronRobinsonMSFT Jun 10, 2023
8d92e7e
Review feedback
AaronRobinsonMSFT Jun 10, 2023
b446a20
Improve MissingMethodException
AaronRobinsonMSFT Jun 12, 2023
5b67d04
Missed fallback name lookup on NativeAOT.
AaronRobinsonMSFT Jun 12, 2023
3663bad
Tests for calling convention bits on NativeAOT.
AaronRobinsonMSFT Jun 12, 2023
c2be6fc
Remove block of doc text for generics. Will add
AaronRobinsonMSFT Jun 12, 2023
63f975c
Treat signature calling convention bits like we treat
AaronRobinsonMSFT Jun 13, 2023
869a5f0
Managed and unmanaged function pointers never
AaronRobinsonMSFT Jun 13, 2023
c03dc9e
Feedback for throwing exceptions on NativeAOT
AaronRobinsonMSFT Jun 13, 2023
a309b06
Merge remote-tracking branch 'upstream/main' into runtime_86161
AaronRobinsonMSFT Jun 14, 2023
b957416
Missing NAOT version of error string
AaronRobinsonMSFT Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,7 @@
<data name="MarshalDirectiveGeneric" xml:space="preserve">
<value>Marshaling directives are invalid</value>
</data>
<data name="AmbiguousMatchUnsafeAccessor" xml:space="preserve">
<value>Ambiguity in binding of UnsafeAccessorAttribute.</value>
</data>
</root>
14 changes: 1 addition & 13 deletions src/coreclr/vm/method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1635,19 +1635,7 @@ class MethodDesc
UINT16 m_wFlags3AndTokenRemainder;

BYTE m_chunkIndex;

enum {
// enum_flag2_HasPrecode implies that enum_flag2_HasStableEntryPoint is set.
enum_flag2_HasStableEntryPoint = 0x01, // The method entrypoint is stable (either precode or actual code)
enum_flag2_HasPrecode = 0x02, // Precode has been allocated for this method
enum_flag2_IsUnboxingStub = 0x04,
// unused = 0x08,
enum_flag2_IsIntrinsic = 0x10, // Jit may expand method as an intrinsic
enum_flag2_IsEligibleForTieredCompilation = 0x20,
enum_flag2_RequiresCovariantReturnTypeChecking = 0x40
// unused = 0x80,
};
BYTE m_bFlags2;
BYTE m_methodIndex; // Used to hold the index into the chunk of this MethodDesc. Currently all 8 bits are used, but we could likely work with only 7 bits

// The slot number of this MethodDesc in the vtable array.
WORD m_wSlotNumber;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3275,7 +3275,7 @@ MethodTableBuilder::EnumerateClassMethods()
}

// Generic methods should always be mcInstantiated
if ((numGenericMethodArgs != 0) && (type != mcInstantiated))
if (hasGenericMethodArgs && (type != mcInstantiated))
{
BuildMethodTableThrowException(BFA_GENERIC_METHODS_INST);
}
Expand Down