Skip to content

Mangle the protocol requirement array #15558

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
merged 4 commits into from
Mar 28, 2018

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 28, 2018

Just a couple of minor bits from protocol resilience. We can't have relative references from symbols without names or symbols with unnamed_addr, because it breaks the REPL. Of course right now you cannot define resilient protocols in the REPL. But it's a bit of future-proofing.

We have RelativeDirectPointer and RelativeIndirectablePointer. The latter
cannot be used with function pointers because it assumes the payload is
2-byte aligned and uses the least significant bit to dynamically
distinguish a direct pointer from an indirect pointer.

For resilient conformances, we want to use protocol dispatch thunks as
keys in the witness table template. They're not 2 byte aligned, and
they're always defined in a different image, so we need an unconditional
indirect relative pointer template.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov requested a review from jckarter March 28, 2018 00:11
@jckarter
Copy link
Contributor

Looks good to me.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit 4c6b452 into swiftlang:master Mar 28, 2018
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.

2 participants