Skip to content

Simplify devirtualization and fix a bug #7779

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 3 commits into from
Feb 27, 2017

Conversation

slavapestov
Copy link
Contributor

Replace if statements with asserts, figure out why assert is firing, delete some code, repeat.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@swift-ci
Copy link
Contributor

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

It looks like we didn't generate the correct cast instruction
in some cases, but another workaround was masking the problem.
It looks like the devirtualizer used to have problems computing
method types in the presence of generic substitutions, covariant
returns and other things, so it would bail if a perticular set
of pre-conditions was not met on the types of original method call
and the devirtualized method call.

I don't think any of this is necessary anymore. If this patch
introduces any regressions, we need to fix the root cause instead
of re-introducing this logic.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@slavapestov slavapestov requested a review from swiftix February 27, 2017 08:08
@swift-ci
Copy link
Contributor

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

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

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

@swiftix
Copy link
Contributor

swiftix commented Feb 27, 2017

@slavapestov So, you couldn't resit, but remove all this "can be converted in an ABI compatible way" logic? ;-) Overall, it looks simpler. But I see a high potential for breaking things. IIRC, not all of the affected code paths are currently covered by tests. We need to see if it breaks things in the wild.

Copy link
Contributor

@swiftix swiftix left a comment

Choose a reason for hiding this comment

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

So, let's merge and see of anything is broken.

@slavapestov
Copy link
Contributor Author

"So, let's merge and see of anything is broken." That's the spirit :-)

@slavapestov slavapestov merged commit 47b4309 into swiftlang:master Feb 27, 2017
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.

3 participants