-
Notifications
You must be signed in to change notification settings - Fork 64
[marshal-methods] Add marshal methods classification code #998
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
Conversation
...JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
Outdated
Show resolved
Hide resolved
2658493 to
89a0c2c
Compare
...JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs
Show resolved
Hide resolved
|
In-progress commit message: Context: https://github.com/xamarin/xamarin-android/pull/7123
Context: fb94d598bddf7818d841914dd4f565cf5cd0bbac
Instead of having `JavaCallableWrapperGenerator` care about and
collect marshal methods override information, introduce a new
`JavaCallableMethodClassifier` type, and use that as the integration
point:
public abstract partial class JavaCallableMethodClassifier {
public abstract bool ShouldBeDynamicallyRegistered
TypeDefinition topType,
MethodDefinition registeredMethod,
MethodDefinition implementedMethod,
CustomAttribute registerAttribute
);
}
An instance of `JavaCallableMethodClassifier` can now be provided to
the `JavaCallableWrapperGenerator` constructor. If provided, then
`ShouldBeDynamicallyRegistered()` will be used to control which
methods are added to `__md_methods` and `Runtime.register()`.
If a type `JavaCallableWrapperGenerator` is processing doesn't have
any dynamically registered methods, then the code to register them
is no longer generated. |
|
@grendello wrote in the PR description:
What should happen in Debug builds? (Not necessarily relevant here, but it came to mind.) I don't think we want to require LLVM Marshal Methods for Debug builds, so is the plan to provide a |
We just don't pass any classifier in this case |
Add code which classifies methods selected by `JavaCallableWrapperGenerator` and decides whether they are to be registered dynamically or using the future native code marshal methods. If a type `JavaCallableWrapperGenerator` is processing is found to not have any dynamically registered methods, then the code to register them is no longer generated.
39a31cc to
8c8938d
Compare
Add code which classifies methods selected by
JavaCallableWrapperGeneratorand decides whether they are to be registered dynamically or using the
future native code marshal methods.
If a type
JavaCallableWrapperGeneratoris processing is found to nothave any dynamically registered methods, then the code to register them
is no longer generated.