Skip to content

Thunk linkage and fragility cleanup #8422

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

slavapestov
Copy link
Contributor

Pop a yak off the stack:

  • Testing change for preserving serialized SIL in merge modules led to...
  • Noticing that SIL witness table thunks had the wrong linkage, which led to...
  • Noticing that referencing thunks and imported synthesized declarations from inlineable functions crashes in the SIL verifier, which led to...
  • Renaming [fragile] to [serialized] and adding a third [serializable] state

I just merged the past part (#8407). This is the second-to-last bit.

This generalizes a hack where re-abstraction thunks become fragile on contact
with fragile functions.

The old policy was:

- [fragile] functions always serialized
- [reabstraction_thunk] transitively referenced from fragile always serialized

The new policy is:

- [serialized] functions always serialized
- [serializable] functions transitively referenced from serialized functions
  are always serialized
- Most kinds of thunks can now be [serializable], allowing them to be shared
  between serialized and non-serialized code without any issues, as long as the
  body of the thunk is sufficiently "simple" (doesn't reference private
  symbols or performs direct access to resilient types)
This code has been commented out for years, doesn't compile,
and when I changed it to compile it blew up building overlays.

I don't feel it adds any value to have it around so I'm
removing it.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 8f40288
Test requested by - @slavapestov

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8f40288
Test requested by - @slavapestov

This fixes a crash when referencing partially-applied methods
from @_inlineable functions.

Also, curry thunks for private methods do not need shared
linkage; private is sufficient.
@slavapestov slavapestov force-pushed the thunk-linkage-and-fragility-cleanup branch from 8f40288 to 91b980b Compare March 30, 2017 04:35
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit e3a331f into swiftlang:master Mar 30, 2017
@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 91b980b
Test requested by - @slavapestov

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