[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:
Doug Gregor
2018-10-10 22:35:24 -07:00
parent 1fc57ad667
commit aba018c1e8
11 changed files with 47 additions and 18 deletions

View File

@@ -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;
}