-
Notifications
You must be signed in to change notification settings - Fork 514
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
Add a managed static registrar. Fixes #17324. #18268
Commits on May 11, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 527cba2 - Browse repository at this point
Copy the full SHA 527cba2View commit details -
[dotnet-linker] Reduce a bit of code duplication.
There are no functional changes here, just code simplification.
Configuration menu - View commit details
-
Copy full SHA for 7c7637e - Browse repository at this point
Copy the full SHA 7c7637eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e11297 - Browse repository at this point
Copy the full SHA 9e11297View commit details -
[dotnet-linker] Unify exception handling to go through the LinkerConf…
…iguration.Report method. Since LinkerConfiguration.Report uses the trimmer's API to report warnings and errors.
Configuration menu - View commit details
-
Copy full SHA for eb01507 - Browse repository at this point
Copy the full SHA eb01507View commit details -
[dotnet-linker] Add a way for ConfigurationAwareStep subclasses to re…
…turn exceptions. Without having to throw them.
Configuration menu - View commit details
-
Copy full SHA for 4351674 - Browse repository at this point
Copy the full SHA 4351674View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ac9b8f - Browse repository at this point
Copy the full SHA 3ac9b8fView commit details -
[static registrar] Refactor code to make it easier to reuse code late…
…r on. There are no functional changes here, just refactoring to make code easier to re-use.
Configuration menu - View commit details
-
Copy full SHA for 872af5d - Browse repository at this point
Copy the full SHA 872af5dView commit details -
[static registrar] Refactor code to make it easier to reuse code late…
…r on. There are no functional changes here, just refactoring to make code easier to re-use.
Configuration menu - View commit details
-
Copy full SHA for e66f82d - Browse repository at this point
Copy the full SHA e66f82dView commit details -
[static registrar] Refactor code to make it easier to reuse code late…
…r on. There are no functional changes here, just refactoring to make code easier to re-use.
Configuration menu - View commit details
-
Copy full SHA for a1410ac - Browse repository at this point
Copy the full SHA a1410acView commit details -
[tools] Add a ManagedStatic registrar mode.
This new mode is still considered a 'Static' registrar mode, it's just a variation of it.
Configuration menu - View commit details
-
Copy full SHA for cfb248e - Browse repository at this point
Copy the full SHA cfb248eView commit details -
[dotnet] Add an 'IsManagedStaticRegistrar' feature to the linker.
This way we can ask the linker to inline the Runtime.IsManagedStaticRegistrar property, and remove any dead code paths.
Configuration menu - View commit details
-
Copy full SHA for 34264cd - Browse repository at this point
Copy the full SHA 34264cdView commit details -
[dotnet-linker] Add the scaffolding for a ManagedRegistrarStep and a …
…ManagedRegistrarLookupTablesStep.
Configuration menu - View commit details
-
Copy full SHA for bf639a9 - Browse repository at this point
Copy the full SHA bf639a9View commit details -
[dotnet-linker] Don't do anything in ManagedRegistrarStep unless the …
…current registrar mode is 'ManagedStatic'.
Configuration menu - View commit details
-
Copy full SHA for 57d40d9 - Browse repository at this point
Copy the full SHA 57d40d9View commit details -
[dotnet-linker] Rearrange registration and generation in the static r…
…egistrar The managed static registrar will add code to the processed assemblies, which means it must run before the trimmer sweeps unused code. This means we have to split the current registrar logic in two: 1. First we process all the assemblies. 2. Then we write out the results. When not using the managed static registrar, these two steps happens right after oneanother (like they do now), while when using the managed static registrar, the processing is done before the trimmer sweeps (where we'll also generate all the new IL code), and then the generated native code will be done at the end of the build process (like for the old-school static registrar).
Configuration menu - View commit details
-
Copy full SHA for e39c6fb - Browse repository at this point
Copy the full SHA e39c6fbView commit details -
[registrar] Make some API from the registrar public so that the manag…
…ed static registrar step can access them. There are no functional changes here, just refactoring to make code easier to re-use.
Configuration menu - View commit details
-
Copy full SHA for a1e0e30 - Browse repository at this point
Copy the full SHA a1e0e30View commit details -
[src] Fix comparison between signed and unsigned int.
Comparing -1 to 0xFFFFFFFF doesn't get the right result otherwise.
Configuration menu - View commit details
-
Copy full SHA for 43b88af - Browse repository at this point
Copy the full SHA 43b88afView commit details -
[static registrar] Add support for generating block syntax in Objecti…
…ve-C method signatures. This is required when generating a cast of a function pointer to an Objective-C method signature (which the managed static registrar does).
Configuration menu - View commit details
-
Copy full SHA for 8f1fb22 - Browse repository at this point
Copy the full SHA 8f1fb22View commit details -
[static registrar] Move token reference creation a little bit later.
It's not needed until later anyway. This way we can add code for the managed static registrar (which does not need the token reference, in fact creating a token reference for a method won't be possible with the managed static registra) in the correct location in the code.
Configuration menu - View commit details
-
Copy full SHA for 70a39a7 - Browse repository at this point
Copy the full SHA 70a39a7View commit details -
[tools] Move code to compute block signatures to the static registrar.
This makes it easier to use this code from the managed static registrar.
Configuration menu - View commit details
-
Copy full SHA for 53d7bc5 - Browse repository at this point
Copy the full SHA 53d7bc5View commit details -
[registrar] Add an HasCustomAttribute overload that returns the found…
… attribute (if any)
Configuration menu - View commit details
-
Copy full SHA for dc56054 - Browse repository at this point
Copy the full SHA dc56054View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47eddc5 - Browse repository at this point
Copy the full SHA 47eddc5View commit details -
[dotnet-linker] Add a helper class for keeping track of methods and t…
…ypes when emitting IL code with Cecil.
Configuration menu - View commit details
-
Copy full SHA for 2a40824 - Browse repository at this point
Copy the full SHA 2a40824View commit details -
[registrar] Refactor code to determine if a method is a property acce…
…ssor to make it easier to reuse.
Configuration menu - View commit details
-
Copy full SHA for 72c654e - Browse repository at this point
Copy the full SHA 72c654eView commit details -
[dotnet-linker] Remove trimmed API from the registered types before g…
…enerating native code when using the managed static registrar. When using the managed static registrar, we register types with the static registrar before the linker does its work, so we need to follow-up after the linker has figured out what will be trimmed away to remove any such types from the list of registered types.
Configuration menu - View commit details
-
Copy full SHA for 4ab321d - Browse repository at this point
Copy the full SHA 4ab321dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bd045e - Browse repository at this point
Copy the full SHA 4bd045eView commit details -
[src] Refactor Class.ResolveToken to take the assembly as a parameter.
This is to make the Class.ResolveToken usable from the managed static registrar.
Configuration menu - View commit details
-
Copy full SHA for cbfc591 - Browse repository at this point
Copy the full SHA cbfc591View commit details -
[runtime] Add an API to look up the native symbol for an [UnmanagedCa…
…llersOnly] method. Add an API to look up the native symbol for an [UnmanagedCallersOnly] method from native code.
Configuration menu - View commit details
-
Copy full SHA for fb6ed7b - Browse repository at this point
Copy the full SHA fb6ed7bView commit details -
[tools] Add a managed static registrar. Fixes xamarin#17324.
This adds a managed static registrar, which is a variation of the static registrar that takes advantage of a few new features in C# and the runtime, as well as avoiding metadata tokens, which NativeAOT doesn't support. This registrar will generate most of the trampoline/interop code as managed code using Cecil, and the Objective-C part is as small as possible. Fixes xamarin#17324.
Configuration menu - View commit details
-
Copy full SHA for 382ebae - Browse repository at this point
Copy the full SHA 382ebaeView commit details -
[static registrar] Implement support for calling the generated Unmana…
…gedCallersOnly method from the managed static registrar
Configuration menu - View commit details
-
Copy full SHA for 9bcc96e - Browse repository at this point
Copy the full SHA 9bcc96eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8ccbad - Browse repository at this point
Copy the full SHA b8ccbadView commit details -
[registrar] We might link the [Protocol] attribute away, so store it …
…for later reference by the static registrar
Configuration menu - View commit details
-
Copy full SHA for 8f55662 - Browse repository at this point
Copy the full SHA 8f55662View commit details -
[src] Track selector and method better to provide more helpful error …
…messages. This commit introduces a few new GetNSObject/GetINativeObject overloads that will be used by the managed static registrar.
Configuration menu - View commit details
-
Copy full SHA for ed4eb42 - Browse repository at this point
Copy the full SHA ed4eb42View commit details -
Configuration menu - View commit details
-
Copy full SHA for a2f5e16 - Browse repository at this point
Copy the full SHA a2f5e16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1deba2c - Browse repository at this point
Copy the full SHA 1deba2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb62964 - Browse repository at this point
Copy the full SHA eb62964View commit details -
[monotouch-test] Use MidiThruConnectionEndpoint instead of MidiCIDevi…
…ceIdentification in exported methods. MidiCIDeviceIdentification isn't blittable ((yet)[1]), so exporting it makes the AOT compiler complain. Use a different (but blittable) type instead in the test. [1]: xamarin@03f0a35
Configuration menu - View commit details
-
Copy full SHA for 4f5fa5e - Browse repository at this point
Copy the full SHA 4f5fa5eView commit details -
[tests] Adjust to cope with slightly different errors reported when u…
…sing the managed static registrar.
Configuration menu - View commit details
-
Copy full SHA for 17b2d37 - Browse repository at this point
Copy the full SHA 17b2d37View commit details -
[linker] Don't optimize calls to BlockLiteral.SetupBlock in BlockLite…
…ral.CreateBlockForDelegate.
Configuration menu - View commit details
-
Copy full SHA for 00a8228 - Browse repository at this point
Copy the full SHA 00a8228View commit details
Commits on May 12, 2023
-
Update docs/managed-static-registrar.md
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for dd64974 - Browse repository at this point
Copy the full SHA dd64974View commit details -
Update docs/managed-static-registrar.md
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 5693250 - Browse repository at this point
Copy the full SHA 5693250View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4ea025 - Browse repository at this point
Copy the full SHA b4ea025View commit details -
[dotnet-linker] Don't prefix the exported entry point from an Unmanag…
…edCallersOnly method with an underscore in .NET 8+.
Configuration menu - View commit details
-
Copy full SHA for 3da0809 - Browse repository at this point
Copy the full SHA 3da0809View commit details -
Configuration menu - View commit details
-
Copy full SHA for f32c9e1 - Browse repository at this point
Copy the full SHA f32c9e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd2252f - Browse repository at this point
Copy the full SHA dd2252fView commit details
Commits on May 15, 2023
-
Apply suggestions from code review
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com> Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 3a8b988 - Browse repository at this point
Copy the full SHA 3a8b988View commit details -
Update runtime/xamarin/runtime.h
Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 7a5fca4 - Browse repository at this point
Copy the full SHA 7a5fca4View commit details -
Mark type forwarders when saving assemblies
Otherwise the linker will remove them. Co-authored-by: Filip Navara <filip.navara@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a04a1d4 - Browse repository at this point
Copy the full SHA a04a1d4View commit details -
[dotnet-linker] Improve code in AppBundleRewriter according to review.
Add a few more helper methods to get method references, that simplifies calling code.
Configuration menu - View commit details
-
Copy full SHA for 6d33409 - Browse repository at this point
Copy the full SHA 6d33409View commit details -
Configuration menu - View commit details
-
Copy full SHA for 065da5f - Browse repository at this point
Copy the full SHA 065da5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 587058f - Browse repository at this point
Copy the full SHA 587058fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4053da7 - Browse repository at this point
Copy the full SHA 4053da7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4830a8 - Browse repository at this point
Copy the full SHA e4830a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd67384 - Browse repository at this point
Copy the full SHA fd67384View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2828d7f - Browse repository at this point
Copy the full SHA 2828d7fView commit details -
[dotnet-linker] Always use 'IntPtr' as the type of for the first argu…
…ment in UnmanagedCallersOnly methods in the managed static registrar. This fixes invalid IL in a few cases.
Configuration menu - View commit details
-
Copy full SHA for 25ad7b2 - Browse repository at this point
Copy the full SHA 25ad7b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 429b8e3 - Browse repository at this point
Copy the full SHA 429b8e3View commit details -
[runtime] Change NSObject.AllocateNSObject<T> to not take the flags p…
…arameter. It's only called from one place, and the flags are constant, so just hardcode the value in the method instead of taking it as an input. This simplifies the generated managed static registrar code a little bit.
Configuration menu - View commit details
-
Copy full SHA for 50ba357 - Browse repository at this point
Copy the full SHA 50ba357View commit details -
GitHub Actions Autoformatter committed
May 15, 2023 Configuration menu - View commit details
-
Copy full SHA for a248260 - Browse repository at this point
Copy the full SHA a248260View commit details
Commits on May 18, 2023
-
[dotnet-linker] Make sure local variables are initialized before use …
…in generated method bodies.
Configuration menu - View commit details
-
Copy full SHA for 643015e - Browse repository at this point
Copy the full SHA 643015eView commit details -
[dotnet-linker] Ensure we call Runtime.CopyAndAutorelease in all appl…
…icable code paths.
Configuration menu - View commit details
-
Copy full SHA for 799095e - Browse repository at this point
Copy the full SHA 799095eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a7371cf - Browse repository at this point
Copy the full SHA a7371cfView commit details -
[dotnet-linker] Fix detecting when we must call the object-based Runt…
…ime.GetNSObject We can't call the generic Runtime.GetNSObject<T> method when we don't know the final type of the returned object, which happens for open types. However, we must always call the generic Runtime.GetNSObject<T> when we know the final type, so that we have the correct object type on the evaluation stack. Fix this by properly detecting open types and only calling Runtime.GetNSObject in that case.
Configuration menu - View commit details
-
Copy full SHA for 469fdb5 - Browse repository at this point
Copy the full SHA 469fdb5View commit details -
[dotnet-linker] Keep better track of when we're calling MethodBase.In…
…voke. Keep better track of whether we're calling MethodBase.Invoke to call the target method, which allows us to detect certain error scenarios (and show a corresponding error).
Configuration menu - View commit details
-
Copy full SHA for ed7b4b6 - Browse repository at this point
Copy the full SHA ed7b4b6View commit details -
[dotnet-linker] Keep track of when we called MethodBase.Invoke and an…
… 'object' reference is left on the stack. Keep track of when we called MethodBase.Invoke and an 'object' reference is left on the stack, so that we can cast to the appropiate type later on when we know how the value is converted to the corresponding native type. This fixes a few cases of the managed static registrar creating unverifiable IL.
Configuration menu - View commit details
-
Copy full SHA for aa75c70 - Browse repository at this point
Copy the full SHA aa75c70View commit details -
Configuration menu - View commit details
-
Copy full SHA for d540050 - Browse repository at this point
Copy the full SHA d540050View commit details -
[dotnet-linker] Simplify generated code for constructors of generic t…
…ypes. We can't create an instance of a generic type in the UnmanagedCallersOnly trampoline, so simplify the code to not even try, and instead just throw the final exception.
Configuration menu - View commit details
-
Copy full SHA for 666ec96 - Browse repository at this point
Copy the full SHA 666ec96View commit details -
GitHub Actions Autoformatter committed
May 18, 2023 Configuration menu - View commit details
-
Copy full SHA for 03488a2 - Browse repository at this point
Copy the full SHA 03488a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65590ba - Browse repository at this point
Copy the full SHA 65590baView commit details