You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change our code to use Class.GetHandleIntrinsic instead of Class.GetHandle whenever possible:
Some kind of optimization step during app build time is probably needed, because whether the Class.GetHandle -> Class.GetHandleIntrinsic transformation is safe or not partial depends on build settings (in particular the deployment target).
Modify the generator to emit Class.GetHandleIntrinsic when safe to do so (when the class in question is available in all OS versions we support).
Modify our manual code as well.
Add a (cecil?) test to verify that we got the above changes right (and we don't introduce regressions in the future).
The text was updated successfully, but these errors were encountered:
Many years ago we added a
Class.GetHandleIntrinsic
method to speed up fetching class handles:xamarin-macios/src/ObjCRuntime/Class.cs
Lines 141 to 149 in 209de6f
However, the comment is incorrect / out-of-date, because the AOT-compiler side of the code is not there anymore.
The idea would be to:
Class.GetHandleIntrinsic
to do what the comment says. Mono's AOT compiler already does something similar for Selector.GetHandle: https://github.com/dotnet/runtime/blob/87a35d6bf48fb418bf53630cd346781b349148f3/src/mono/mono/mini/intrinsics.c#L2221-L2261, which can be used as a starting point (the implementation would be different though - the generated native code should be equivalent to the Objective-C code[ObjectiveCType class]
.Class.GetHandleIntrinsic
instead ofClass.GetHandle
whenever possible:Class.GetHandle
->Class.GetHandleIntrinsic
transformation is safe or not partial depends on build settings (in particular the deployment target).Class.GetHandleIntrinsic
when safe to do so (when the class in question is available in all OS versions we support).The text was updated successfully, but these errors were encountered: