Skip to content

Use the distributed thunk for non-distributed protocol requirements #59514

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

Merged

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jun 16, 2022

When a distributed-actor-isolated witness is provided for a
non-distributed-actor-isolated requirement, always hop to the
distributed thunk.

While here, mark distributed thunks as being final, to ensure that
we always statically call them vs. trying to retrieve them from the
vtable (since they aren't in the vtable).

Fixes the rest of the distributed part of rdar://92881539.

When a synchronous, actor-isolated declaration witnesses an
asynchronous, not-similarly-isolated requirement, emit an actor hop
within the witness thunk to ensure that we properly enter the context
of the actor.

Fixes swiftlang#58517 / rdar://92881539.

(cherry picked from commit 25a7988)
…hunk

We cannot hop to a distributed actor directly, so call through the
distributed thunk instead.

(cherry picked from commit 840b7ea)
When a distributed-actor-isolated witness is provided for a
non-distributed-actor-isolated requirement, always hop to the
distributed thunk.

While here, mark distributed thunks as being `final`, to ensure that
we always statically call them vs. trying to retrieve them from the
vtable (since they aren't in the vtable).
@DougGregor DougGregor requested a review from a team as a code owner June 16, 2022 23:46
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

Huh, only the last commit is new. The rest got merged already as part of #59456

@DougGregor DougGregor changed the title Teach witness thunks to hop to the actor when needed. Use the distributed thunk for non-distributed protocol requirements Jun 16, 2022
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thank you!

@ktoso ktoso added distributed Feature → concurrency: distributed actor r5.7 labels Jun 17, 2022
@ktoso
Copy link
Contributor

ktoso commented Jun 17, 2022

@swift-ci please build toolchain

@ktoso
Copy link
Contributor

ktoso commented Jun 17, 2022

Unrelated macOS failure: Swift(watchsimulator-i386) :: SymbolGraph/Symbols/SkipsPublicUnderscore.swift
I'll restart the job.

@ktoso
Copy link
Contributor

ktoso commented Jun 17, 2022

@swift-ci please test macOS

@ktoso
Copy link
Contributor

ktoso commented Jun 17, 2022

The failing test was reverted

@swift-ci please test macOS

@DougGregor DougGregor merged commit 4ed6f68 into swiftlang:release/5.7 Jun 17, 2022
@DougGregor DougGregor deleted the distributed-witness-mark-2-5.7 branch June 17, 2022 14:34
@ktoso
Copy link
Contributor

ktoso commented Jun 22, 2022

Cherry pick of #59513

@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Feature → concurrency: distributed actor 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants