-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Mono] added simple reverse pinvoke support to interpreter #102185
[Mono] added simple reverse pinvoke support to interpreter #102185
Conversation
imethod->swift_error_offset = -1; | ||
|
||
MonoClass *swift_error = mono_class_try_get_swift_error_class (); | ||
MonoClass *swift_error_ptr = mono_class_create_ptr (m_class_get_this_arg (swift_error)); | ||
|
||
int swift_error_index = -1; | ||
for (int i = 0; i < sig->param_count; i++) { | ||
MonoClass *klass = mono_class_from_mono_type_internal (sig->params [i]); | ||
if (klass == swift_error_ptr) { | ||
swift_error_index = i; | ||
break; | ||
} | ||
} |
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.
We could probably hardcode type and allocate this variable without checking whether SwiftError* exists on signature
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.
Sounds good. It can allocate a variable for SwiftError*
if a signature is CallConvSwift
.
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 got rid of the loop as you suggested. I don't think there is a significant benefit of hardcoding it now. What you think?
a135604
to
232d512
Compare
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Verified that using |
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.
LGTM!
Adds simple (no structs) Swift reverse pinvoke support to mono interpreter.