-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add support for distributed functions in extensions of distributed actors #39785
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
Add support for distributed functions in extensions of distributed actors #39785
Conversation
…tors. Fix a few minor issues in the type checker and SILGen to properly cope with distributed functions defined within extensions of distributed actors. While here, centralize the logic that adds the "_remote_" function. Fixes rdar://84325525.
@swift-ci please smoke test and merge |
@swift-ci please smoke test and merge |
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.
Looks good, thanks a lot!
Distributed thunks were using the same mangling as direct method reference thunks (i.e., for "super" calls). Although not technically conflicting so long as actors never gain inheritance, it's confusing and could cause problems in the future. So, introduce a distinct mangling for distributed thunks and plumb them through the demangling and remangler.
@swift-ci please smoke test and merge |
@@ -217,6 +217,7 @@ types where the metadata itself has unknown layout.) | |||
global ::= global 'To' // swift-as-ObjC thunk | |||
global ::= global 'TD' // dynamic dispatch thunk | |||
global ::= global 'Td' // direct method reference thunk | |||
global ::= global 'TE' // distributed actor thunk |
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.
okey E then! Thanks for spotting this
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.
Hmmm we also used the Td
in:
case Kind::DistributedThunkAsyncFunctionPointer: {
std::string Result = getSILDeclRef().mangle();
Result.append("Td");
Result.append("Tu");
return Result;
}
which this doesnt fix yet -- i think there we also need to use TE right? I'll follow up with this.
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.
Yup, and that's what failed the tests -- I fixed it :)
@swift-ci please build toolchain macOS |
Actual failure, I think I know how to solve -- on it. |
Fix a few minor issues in the type checker and SILGen to properly cope with
distributed functions defined within extensions of distributed actors.
While here, centralize the logic that adds the "remote" function.
... and since this uncovered a problem with the mangling for distributed
functions, fix that, too.
Fixes rdar://84325525.