You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some calls in reflector that do not necessarily need to use reflection.
For instance, if we are trying to invoke a public but hidden API from an older version of Android, in theory reflector can codegen invokevirtual method calls instead of using reflection.
This may be an edge case but it could be interesting to explore.
Perhaps there could be yet another annotation, e.g. @InvokeWith("invokevirtual") to provide reflector a hint.
The text was updated successfully, but these errors were encountered:
hoisie
changed the title
Update reflector to support faster invocation (e.g. invokevirtual)
Update reflector to support faster invocation methods (e.g. invokevirtual)
Feb 26, 2024
@hoisie I think Introducing annotation, @InvokeWith, that allows specifying the desired invocation strategy would enable us to bypass reflection in favor of direct method calls when interacting with APIs that are public but hidden, particularly in older versions of Android.
I have done some preliminary work on this and looking for your feedback and guidance on this:
-> Created a New "InvokeWith" annotation
@shashankiitbhu I do like the potential of something like @InvokeWith("invokevirtual"). Seems like that approach could work. Feel free to email me (my email is in git commit history) if you would like to work on this.
There are some calls in reflector that do not necessarily need to use reflection.
For instance, if we are trying to invoke a public but hidden API from an older version of Android, in theory reflector can codegen
invokevirtual
method calls instead of using reflection.This may be an edge case but it could be interesting to explore.
Perhaps there could be yet another annotation, e.g.
@InvokeWith("invokevirtual")
to provide reflector a hint.The text was updated successfully, but these errors were encountered: