mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ABI] Rework protocol descriptor metadata.
Reimplement protocol descriptors for Swift protocols as a kind of context descriptor, dropping the Objective-C protocol compatibility layout. The new protocol descriptors have several advantages over the current implementation: * They drop all of the unused fields required for layout-compatibility with Objective-C protocols. * They encode the full requirement signature of the protocol. This maintains more information about the protocol itself, including (e.g.) correctly encoding superclass requirements. * They fit within the general scheme of context descriptors, rather than being their own thing, which allows us to share more code with nominal type descriptors. * They only use relative pointers, so they’re smaller and can be placed in read-only memory Implements rdar://problem/38815359.
This commit is contained in:
@@ -3339,7 +3339,7 @@ static void initializeResilientWitnessTable(GenericWitnessTable *genericTable,
|
||||
void **table) {
|
||||
auto protocol = genericTable->Protocol.get();
|
||||
|
||||
auto requirements = protocol->Requirements.get();
|
||||
auto requirements = protocol->getRequirements();
|
||||
auto witnesses = genericTable->ResilientWitnesses->getWitnesses();
|
||||
|
||||
for (size_t i = 0, e = protocol->NumRequirements; i < e; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user