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

Remove LINQ expression dependencies on NativeAOT #1429

Merged
merged 31 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f3beeb6
Improve feature checks to avoid LINQ expressions
Sergio0694 Jan 7, 2024
ae20edc
Optimize more NAOT runtime checks
Sergio0694 Jan 7, 2024
fbf811d
Make Nullable<T> ABI types AOT safe
Sergio0694 Jan 7, 2024
5f09353
Remove some RuntimeFeature checks downlevel
Sergio0694 Jan 7, 2024
d863780
Restore support for Rect, Point, Size
Sergio0694 Jan 7, 2024
b227287
Combine Nullable<T> stubs for all blittable types
Sergio0694 Jan 7, 2024
34cd8c5
Inline out variable declarations in Nullable<T>.Value
Sergio0694 Jan 7, 2024
32b2c8f
Also treat TimeSpan as blittable
Sergio0694 Jan 7, 2024
d56db74
Hardcode all well known Nullable<T>.PIID values
Sergio0694 Jan 7, 2024
e3772e3
Use type checks instead of comparing type names
Sergio0694 Jan 7, 2024
d3cbab9
Always enable Nullable<T>.Value fallback downlevel
Sergio0694 Jan 7, 2024
127c291
Update Nullable<T>.GetValue with shared code
Sergio0694 Jan 7, 2024
c5da203
Fix AmbiguousMatchException in BoxedValueIReferenceImpl<T>
Sergio0694 Jan 7, 2024
ef1da85
Fix condition in EventHandler<T>.Invoke(...)
Sergio0694 Jan 8, 2024
27728ac
Fix marshalling of Nullable<DateTimeOffset>
Sergio0694 Jan 9, 2024
197e82c
Also support enum types in Nullable<T>
Sergio0694 Jan 9, 2024
b7d3660
Add missing readonly modifiers to IID fields
Sergio0694 Jan 10, 2024
4fa67b3
Reuse IIDs from hardcoded Nullable_ types
Sergio0694 Jan 10, 2024
c99fb03
Normalize whitespaces, remove unused usings
Sergio0694 Jan 10, 2024
4946871
Fix duplicate definitions of IReferenceIIDs
Sergio0694 Jan 10, 2024
7477eb0
Remove duplicate Nullable<T>.Value delegate definitions
Sergio0694 Jan 10, 2024
fa02e73
Remove some reflection from Nullable<T>.GetGuidSignature()
Sergio0694 Jan 10, 2024
555cd85
Fix some type references in Nullable<T>
Sergio0694 Jan 10, 2024
05340bd
Fix nullable signatures and add missing ones
Sergio0694 Jan 10, 2024
9d4ee3b
Make Nullable<T> for numerics also AOT safe
Sergio0694 Jan 10, 2024
0433c38
Remove GetAbiDelegateType root in EventHandler<T>
Sergio0694 Jan 10, 2024
5f5ee04
Improve feature check in SingleInterfaceOptimizedObject
Sergio0694 Jan 13, 2024
e94c933
Remove unnecessary array allocation
Sergio0694 Jan 15, 2024
99d4b2d
Avoid unnecessary Projections.GetAbiDelegateType calls
Sergio0694 Jan 17, 2024
71b246a
Add type name info to exception messages
Sergio0694 Jan 17, 2024
cfccf0f
Add Nullable_Type to IID signature switch
Sergio0694 Jan 17, 2024
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
586 changes: 305 additions & 281 deletions src/WinRT.Runtime/Projections/EventHandler.cs

Large diffs are not rendered by default.

2,594 changes: 1,309 additions & 1,285 deletions src/WinRT.Runtime/Projections/IDictionary.net5.cs

Large diffs are not rendered by default.

958 changes: 500 additions & 458 deletions src/WinRT.Runtime/Projections/IEnumerable.net5.cs

Large diffs are not rendered by default.

1,349 changes: 696 additions & 653 deletions src/WinRT.Runtime/Projections/IList.net5.cs

Large diffs are not rendered by default.

919 changes: 472 additions & 447 deletions src/WinRT.Runtime/Projections/IReadOnlyDictionary.net5.cs

Large diffs are not rendered by default.

761 changes: 395 additions & 366 deletions src/WinRT.Runtime/Projections/IReadOnlyList.net5.cs

Large diffs are not rendered by default.

440 changes: 228 additions & 212 deletions src/WinRT.Runtime/Projections/KeyValuePair.cs

Large diffs are not rendered by default.

3,041 changes: 1,663 additions & 1,378 deletions src/WinRT.Runtime/Projections/Nullable.cs

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions src/WinRT.Runtime/SingleInterfaceOptimizedObject.net5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using WinRT.Interop;

Expand All @@ -29,15 +30,21 @@ internal SingleInterfaceOptimizedObject(Type type, IObjectReference objRef, bool
if (requireQI)
{
Type helperType = type.FindHelperType();
var vftblType = helperType.FindVftblType();
if (vftblType is null)
{
_obj = objRef.As<IUnknownVftbl>(GuidGenerator.GetIID(helperType));
}
else

if (RuntimeFeature.IsDynamicCodeCompiled)
{
_obj = (IObjectReference)typeof(IObjectReference).GetMethod("As", Type.EmptyTypes).MakeGenericMethod(vftblType).Invoke(objRef, null);
var vftblType = helperType.FindVftblType();

if (vftblType is not null)
{
_obj = (IObjectReference)typeof(IObjectReference).GetMethod("As", Type.EmptyTypes).MakeGenericMethod(vftblType).Invoke(objRef, null);

return;
}
}

_obj = objRef.As<IUnknownVftbl>(GuidGenerator.GetIID(helperType));

}
else
{
Expand Down
Loading