Uh oh!
There was an error while loading. Please reload this page.
[NativeAOT] Reflection Invoke refactoring - #73131
Conversation
- Refactored reflection Invoke in NativeAOT to be similar to how it is done in CoreCLR. - All argument validation and coercion is done via static code now. This makes the reflection invoke stubs much smaller and the AOT compiler side a lot simpler. - The invoke stub is minimal now and just takes the arguments for the methods to invoke as "Span of byrefs". The two notable differences with CoreCLR are: - The invoke stub takes the function pointer to call as an argument to allow sharing of the stubs between methods with the same signature. CoreCLR has the thunks non-sharable currently. We have discussed sharing them among methods with the same signature like it is done here. - The return value is returned as byref. CoreCLR thunk does boxing of the return value as part of the stub. Again, we have discussed to do it this way in CoreCLR too, we just did not have time to do it yet. Fixesdotnet#72548
0bef061 to
b08f4eeComparejkotas
commented
Jul 31, 2022
Some perf numbers
The extra fixed overhead that is observable in invoke static method with no arguments is due extra "Invoker" layer in native AOT. I am going to delete that layer in subsequent PRs. |
jkotas
commented
Aug 1, 2022
cc @steveharter @dotnet/area-system-reflection |
jkotas
commented
Aug 1, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkotas
commented
Aug 1, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkotas
commented
Aug 1, 2022
@MichalStrehovsky @dotnet/ilc-contrib This is ready for review. |
jkotas
commented
Aug 1, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkotas
commented
Aug 2, 2022
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
AaronRobinsonMSFT
commented
Aug 2, 2022
@jkotas I think this broke the API compat for AOT. |
jkotas
commented
Aug 2, 2022
@akoeplinger It looks like your #72143 was not updated to account for my changes. Could you please fix it up? |
Yep, I did merge main into my PR branch but looks like it was a few minutes before your PR went it. |
Fixed build break caused by merging dotnet#73131 and dotnet#73131 around the same time.
akoeplinger
commented
Aug 2, 2022
Opened a PR with the fix: #73248 |
Fixes#72548