mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
of associated types in protocol witness tables. We use the global access functions when the result isn't dependent, and a simple accessor when the result can be cheaply recovered from the conforming metadata. Otherwise, we add a cache slot to a private section of the witness table, forcing an instantiation per conformance. Like generic type metadata, concrete instantiations of generic conformances are memoized. There's a fair amount of code in this patch that can't be dynamically tested at the moment because of the widespread reliance on recursive expansion of archetypes / dependent types. That's something we're now theoretically in a position to change, and as we do so, we'll test more of this code.
114 KiB
114 KiB