-
Notifications
You must be signed in to change notification settings - Fork 53
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
[jnimarshalmethod-gen] Create delegate types for marshaling methods with 15+ parameters #711
[jnimarshalmethod-gen] Create delegate types for marshaling methods with 15+ parameters #711
Conversation
06985ed
to
8f101c8
Compare
Is there a reason to generate these new |
return marshalDelegateType; | ||
} | ||
|
||
public static void AddMarshalerTypeNameSuffix (StringBuilder sb, Type returnType, List<Type> funcTypeParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…I ask because I'm wondering if there's some way to not add this public
export, or at least find a "more suitable" location for it?
@@ -159,6 +159,66 @@ public static void StaticActionFloat (float f) | |||
return false; | |||
return true; | |||
} | |||
|
|||
[JavaCallable ("staticManyParametersWithAutogeneratedDelegateType", Signature="(ZBCSIJFDLjava/lang/Object;Ljava/lang/String;Ljava/util/ArrayList;Ljava/lang/String;Ljava/lang/Object;DFJII)I")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this method differs from the existing "lots of parameters" test:
How does this (pair of) method(s) differ from the current ExportType.staticFuncThisMethodTakesLotsOfParameters()
method? They both have lots of parameters, and they both appear to have "similar" [JavaCallable]
custom attribute values. How does this test differ?
parameterTypes.Add (typeof (AsyncCallback)); | ||
parameterTypes.Add (typeof (object)); | ||
|
||
CreateDelegateRuntimeManagedMethod (dtb, "BeginInvoke", typeof (IAsyncResult), parameterTypes.ToArray ()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to declare BeginInvoke()
and EndInvoke()
if these are generated types, with type names that are "inaccessible", and jnimarshalmethod-gen
isn't emitting references to these methods?
Closing as this is largely moot as of #1046 + dependencies. |
Context: #709
Generate delegate types for marshaling methods. We generate them
in cases where we cannot use
Func<>
orAction<>
delegatesbecause of too many parameters (more than 14) and when we don't
have special custom delegate type available - like
_JniMarshal_PPZBCSIJFDLLLLLDFJ_Z
delegate type in our tests.Let the TypeMover move these delegate types to the original
assembly as well.
Added test to check marshaling with auto-generated delegate types.
Example of generated delegate type:
An example of the optimized code in the registration
__<$>_jni_marshal_methods'::__RegisterNativeMembers
method: