Skip to content

[ParseableInterfaces] Skip value witnesses of resilient conformances #20419

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
Nov 9, 2018

Conversation

jrose-apple
Copy link
Contributor

We can't devirtualize through these conformances anyway, so we can get a (probably tiny) speedup by not doing any resolution of non-type witnesses.

Based on top of #20390. I suggest reviewing commit by commit.

rdar://problem/43824088

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 97bcb4fae31c172502bddce61599c8844cb6b13b

@@ -2850,6 +2833,23 @@ void ConformanceChecker::checkNonFinalClassWitness(ValueDecl *requirement,
}
}

ResolveWitnessResult
ConformanceChecker::resolveWitnessAsOpaque(ValueDecl *requirement) {
assert(!isa<AssociatedTypeDecl>(requirement) && "Use resolveTypeWitnessVia*");
Copy link
Contributor

@harlanhaskins harlanhaskins Nov 8, 2018

Choose a reason for hiding this comment

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

What's the reason this doesn't just take an AssociatedTypeDecl? Answered by looking below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole conformance-checking logic is split between type witnesses and non-type witnesses, and in practice it makes sense because they're resolved pretty differently. In this case, you can't actually make an associated type opaque, so the assertion makes sense.

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 97bcb4fae31c172502bddce61599c8844cb6b13b

@jrose-apple
Copy link
Contributor Author

Also depends on #20437. I'll rebase once that goes in.

checkConformance was pretty long. No functionality change.
We can't devirtualize through these conformances anyway, so we can get
a (probably tiny) speedup by not doing any resolution of non-type
witnesses.

rdar://problem/43824088
@jrose-apple jrose-apple force-pushed the resolution-dissolution branch from 97bcb4f to 61dd307 Compare November 9, 2018 17:05
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test Linux Platform
Git Sha - 97bcb4fae31c172502bddce61599c8844cb6b13b

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test OS X Platform
Git Sha - 97bcb4fae31c172502bddce61599c8844cb6b13b

@jrose-apple jrose-apple merged commit 877751a into swiftlang:master Nov 9, 2018
@jrose-apple jrose-apple deleted the resolution-dissolution branch November 12, 2018 19:16
@jrose-apple
Copy link
Contributor Author

This turned out to cause some problems. I'll write up test cases this afternoon, but with #20485 there's at least not a correctness issue. Reverting.

jrose-apple added a commit to jrose-apple/swift that referenced this pull request Nov 16, 2018
…rmances"

This reverts commit 61dd307,
the effective part of swiftlang#20419.

rdar://problem/43824088
jrose-apple added a commit that referenced this pull request Nov 16, 2018
…rmances" (#20637)

This reverts commit 61dd307,
the effective part of #20419.

rdar://problem/43824088
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.

4 participants