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

Replace DelegateHelper with pre-generated delegates #4867

Merged
merged 1 commit into from May 9, 2023

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented May 9, 2023

As the title says. This allows us to get rid of the only System.Reflection.Emit usage in the ARMeilleure project, which should allow it to be compiled with NativeAOT. The only downside is that we need to write one additional line (the delegate declaration) for each method that we call from native JIT generated code.

I have tried other approaches here using generic methods, but none of them worked as you can't use GetFunctionPointerForDelegate with a generic delegate (even if it is just contained inside a generic type). So I think the only other solution here would be using a source generator to generate the delegates, but given the amount of them, it would probably take more time and more lines of code to write the source generator than just pre-generating them here.

@gdkchan gdkchan added cpu Related to ARMeilleure enhancement New feature or request labels May 9, 2023
@gdkchan gdkchan requested a review from marysaka May 9, 2023 01:18
@AcK77 AcK77 merged commit 40c1767 into Ryujinx:master May 9, 2023
6 checks passed
@gdkchan gdkchan deleted the delete-delegate-helper branch May 9, 2023 13:19
LoneBoco pushed a commit to LoneBoco/Ryujinx that referenced this pull request May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpu Related to ARMeilleure enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants