-
Notifications
You must be signed in to change notification settings - Fork 538
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
NativeAOT TODO list #9784
Comments
Alternate "MVP 1.1" typemap idea, for posterity: instead of a
The linker step would populate (1), which might be faster because At runtime, consult (2) first, and if a type mapping doesn't exist, use (1) to lookup the Questions:
|
There must be a way to use a android/src/Microsoft.Android.Sdk.ILLink/TypeMappingStep.cs Lines 70 to 83 in 70bd636
|
|
I'm currently exploring this direction for the type map: https://gist.github.com/simonrozsival/8b3f2294d7fa1cf84ca32e8145984c98
What do you think? |
@simonrozsival brought up a point that the
|
I don't think I expressed myself correctly. If we generate IL that builds the I was trying to say that we cannot serialize the raw numeric values of We can of course create an array of RTH, but it will need to be initialized at startup: static readonly RuntimeTypeHandle[] s_handles = [ typeof(X).TypeHandle, typeof(Y).TypeHandle ];
// is compiled to IL like this:
.method private hidebysig specialname rtspecialname static
void .cctor () cil managed
{
// Method begins at RVA 0x2058
// Code size 56 (0x38)
.maxstack 8
IL_0000: ldc.i4.2
IL_0001: newarr [System.Runtime]System.RuntimeTypeHandle
IL_0006: dup
IL_0007: ldc.i4.0
IL_0008: ldtoken X
IL_000d: call class [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle(valuetype [System.Runtime]System.RuntimeTypeHandle)
IL_0012: callvirt instance valuetype [System.Runtime]System.RuntimeTypeHandle [System.Runtime]System.Type::get_TypeHandle()
IL_0017: stelem [System.Runtime]System.RuntimeTypeHandle
IL_001c: dup
IL_001d: ldc.i4.1
IL_001e: ldtoken Y
IL_0023: call class [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle(valuetype [System.Runtime]System.RuntimeTypeHandle)
IL_0028: callvirt instance valuetype [System.Runtime]System.RuntimeTypeHandle [System.Runtime]System.Type::get_TypeHandle()
IL_002d: stelem [System.Runtime]System.RuntimeTypeHandle
IL_0032: stsfld valuetype [System.Runtime]System.RuntimeTypeHandle[] X::s_handles
IL_0037: ret
} // end of method X::.cctor |
ILC can interpret some static constructors at compile time and produce preinitialized data in the executable image. It would not work for the Dictionary but it can probably work for a simple array... (or can be tweaked to work if it doesn't at the moment) |
What do we need to do for NativeAOT?
dotnet new android && dotnet publish -p:PublishAot=true
Microsoft.Android.Runtime.NativeAOT.dll
#9760dotnet new maui
runs: [WIP] turn NativeAOT sample into a .NET MAUI app #9747debug.mono.log
, to disablelref/gref
loggingmonodroid_log()
for NativeAOT$(PublishAotUsingRuntimePack)=true
, and see what xamarin/xamarin-macios does$(PublishAotUsingRuntimePack)=true
#9815libc++_shared.so
The text was updated successfully, but these errors were encountered: