-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Implement support for "zero overhead member access with suppressed visibility checks" #81741 for the mono JIT/AOT and interp
- Add
UnsafeAccessorAttributeas a well-known attribute to the runtime
We will need to extract a named string-value property from the custom attribute ([Mono] UnsafeAccessorAttribute non-generic support for field #88626) - Add code to JIT/AOT and the interp transform to detect
static externmethods with the attribute and trigger emitting the method wrapper for UnsafeAccessor ([Mono] UnsafeAccessorAttribute non-generic support for field #88626) - Implement some ilgen code to generate the method bodies for these methods for the non-generic case
- Field ([Mono] UnsafeAccessorAttribute non-generic support for field #88626)
- StaticField ([Mono] UnsafeAccessorAttribute non-generic support for field #88626)
- Constructor, Method, StaticMethod ([mono] Some UnsafeAccessorAttribute support for methods and constructors #88925)
- [mono] Support UnsafeAccessorAttribute method calls with custom modifiers #89098
(test cases:Verify_IgnoreCustomModifier,Verify_UnmanagedCallConvBitAreTreatedAsCustomModifiersAndIgnored,Verify_ManagedUnmanagedFunctionPointersDontMatchandVerify_InvalidTargetUnsafeAccessorAmbiguousMatch)
There might be some mild complication here for working with generics (the static extern method will be generic in that case) - our ilgen method builder might not support generics (in which case it will have to be extended)
ivanpovazan and kotlarmilos