Skip to content
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

Embedded: specialized witness tables, part2: support remaining cases of class existentials #76874

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Oct 4, 2024

This is part 2 of #76669

This PR adds support for

  • existential of protocols with associated types and conformances.
  • base-protocols: inheritance of protocols
  • inherited conformanes: derived classes where the base conforms to a protocol

…added to MandatoryPerformanceOptimization's worklist

Do it by passing a closure instead of returning the new witness table.
This allows to add more than one new witness table to the worklist
For example:
```
protocol Base: AnyObject {}
protocol Derived: Base {}

class C: Derived {}

let e: Derived = C()
```
In Embedded Swift, witness method lookup is done from specialized witness tables.
For this to work, the type of witness_method must be specialized as well.
Otherwise the method call would be done with wrong parameter conventions (indirect instead of direct).
…le entries

Associated-type entries are simply skipped.
Associated-conformance entries point to the specialized conformance witness tables.
…ions

In Embedded Swift, witness method lookup is done from specialized witness tables.
For this to work, the type of witness_method must be specialized as well.
Otherwise the method call would be done with wrong parameter conventions (indirect instead of direct).
…ntries when specializing witness-tables

Support associated-type and associated-conformance entries.
This enable existentials with associated types.
That means: derived classes where the base conforms to a protocol
@eeckstein
Copy link
Contributor Author

@swift-ci test

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