mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ABI] Pass requirement base descriptor to swift_getAssociatedTypeWitness().
Have clients pass the requirement base descriptor to swift_getAssociatedTypeWitness(), so that the witness index is just one subtraction away, avoiding several dependent loads (witness table -> conformance descriptor -> protocol descriptor -> requirement offset) in the hot path.
This commit is contained in:
@@ -671,7 +671,10 @@ static const Metadata *resolveGenericParamRef(
|
||||
current = swift_getAssociatedTypeWitness(
|
||||
MetadataState::Abstract,
|
||||
const_cast<WitnessTable *>(witnessTable),
|
||||
current, assocTypeReq).Value;
|
||||
current,
|
||||
assocTypeRef.Protocol
|
||||
->getRequirementBaseDescriptor(),
|
||||
assocTypeReq).Value;
|
||||
if (!current) return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user