Skip to content

[Async CC] Support for protocol witness methods. #34211

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

nate-chandler
Copy link
Contributor

Based on #34200 .

Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

Additionally, corrected ordering of indirect results. Previously, the indirect results were claimed from the explosion after the arguments were claimed. That failed to match the order in which arguments actually appear in the explosion. Here the order is reversed.

Previously, the polymorphic arguments were being discarded.  Here, that
situation is improved by pulling the polymorphic arguments out of the
explosion when having the polymorphic parameters via the
NecessaryBindings instance.  In order to eanble that, an overload of
NecessaryBindings::save is added which takes an explosion and asserts
that the polymorphic parameter pulled from the explosion matches with
the polymorphic parameter in the NecessaryBindings instance.
Use the TypeInfo for the argument lowering type of the self parameter
rather than for the self parameter's type itself.
Previously the methods for getting the index into the layout were public
and were being used to directly access the underlying buffer.  Here,
that abstraction leakage is fixed and field access is forced to go
through the appropriate methods.
Previously a raw CreateLoad was used, which happened to be fine.  Here,
a TI is used, explicitly clarifying that the indirect return is taken.
Previously, the indirect results were claimed from the explosion after
the arguments were claimed.  That failed to match the order in which
arguments actually appear in the explosion.  Here the order is reversed.
Previously, the AsyncContextLayout did not make space for the trailing
witness fields (self metadata and self witness table) and the
AsyncNativeCCEntryPointArgumentEmission could consequently not vend
these fields.  Here, the fields are added to the layout.
Previously the same code was used for loading values from the async
context.  Here, that same code is extracted into a private method.
Previously the same code was used for saving values into the async
context.  Here, that code is extracted into a private method.
Previously the code for loading indirect returns was inline in the
member function where it was performed.  Here it is pulled out into a
private method.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler merged commit d32b935 into swiftlang:main Oct 7, 2020
@nate-chandler nate-chandler deleted the concurrency/irgen/protocol-witness-methods branch July 5, 2023 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant