Skip to content

Commit a8dcf8b

Browse files
committed
Revert "WebAssembly: add logging in swift_getAssociatedTypeWitness"
Don't need the logging anymore. This reverts commit 7d35644ca7bfa027505f09b9232d34b8191bd42d.
1 parent dd54892 commit a8dcf8b

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,7 +4266,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
42664266
const Metadata *conformingType,
42674267
const ProtocolRequirement *reqBase,
42684268
const ProtocolRequirement *assocType) {
4269-
fprintf(stderr, "Entering slow path: %p %p %p %p\n", wtable, conformingType, reqBase, assocType);
42704269
#ifndef NDEBUG
42714270
{
42724271
const ProtocolConformanceDescriptor *conformance = wtable->Description;
@@ -4293,8 +4292,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
42934292
const char *mangledNameBase =
42944293
(const char *)(uintptr_t(witness) &
42954294
~ProtocolRequirementFlags::AssociatedTypeMangledNameBit);
4296-
fprintf(stderr, "Mangled name base: %p\n", mangledNameBase);
4297-
fprintf(stderr, "name: %s\n", mangledNameBase);
42984295

42994296
// Check whether the mangled name has the prefix byte indicating that
43004297
// the mangled name is relative to the protocol itself.
@@ -4309,18 +4306,13 @@ swift_getAssociatedTypeWitnessSlowImpl(
43094306
const ProtocolConformanceDescriptor *conformance = wtable->Description;
43104307
const ProtocolDescriptor *protocol = conformance->getProtocol();
43114308

4312-
fprintf(stderr, "conformance %p protocol %p\n", conformance, protocol);
4313-
43144309
// Extract the mangled name itself.
43154310
StringRef mangledName =
43164311
Demangle::makeSymbolicMangledNameStringRef(mangledNameBase);
43174312

4318-
fprintf(stderr, "mangledName: %s\n", mangledName.str().c_str());
4319-
43204313
// Demangle the associated type.
43214314
MetadataResponse response;
43224315
if (inProtocolContext) {
4323-
fprintf(stderr, "in protocol context\n");
43244316
// The protocol's Self is the only generic parameter that can occur in the
43254317
// type.
43264318
response =
@@ -4343,7 +4335,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43434335
dependentDescriptor);
43444336
}).getResponse();
43454337
} else {
4346-
fprintf(stderr, "getting original conforming type\n");
43474338
// The generic parameters in the associated type name are those of the
43484339
// conforming type.
43494340

@@ -4362,18 +4353,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43624353
}).getResponse();
43634354
}
43644355
auto assocTypeMetadata = response.Value;
4365-
fprintf(stderr, "assocTypeMetadata: %p\n", assocTypeMetadata);
4366-
4367-
if (true) {
4368-
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
4369-
StringRef conformingTypeName(conformingTypeNameInfo.data,
4370-
conformingTypeNameInfo.length);
4371-
StringRef assocTypeName = findAssociatedTypeName(protocol, assocType);
4372-
fprintf(stderr, "fin: %s %s %s %s\n", assocTypeName.str().c_str(),
4373-
conformingTypeName.str().c_str(),
4374-
protocol->Name.get(),
4375-
mangledName.str().c_str());
4376-
}
43774356

43784357
if (!assocTypeMetadata) {
43794358
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
@@ -4409,20 +4388,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request,
44094388
// If the low bit of the witness is clear, it's already a metadata pointer.
44104389
unsigned witnessIndex = assocType - reqBase;
44114390
auto witness = ((const void* const *)wtable)[witnessIndex];
4412-
fprintf(stderr, "getAssociatedTypeWitness fastpath: %x %p\n", witnessIndex, witness);
44134391
if (LLVM_LIKELY((uintptr_t(witness) &
44144392
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
44154393
// Cached metadata pointers are always complete.
4416-
fprintf(stderr, "fastpath: %p\n", witness);
4417-
auto witnessPtr = (const Metadata *)witness;
4418-
witnessPtr->dump();
4419-
if (witnessPtr->getKind() == MetadataKind::Class) {
4420-
fprintf(stderr, "class description:\n");
4421-
auto witnessClass = witnessPtr->getClassObject();
4422-
fprintf(stderr, "%lx\n", *(unsigned long*)&witnessClass->Data);
4423-
if (witnessClass->isTypeMetadata())
4424-
fprintf(stderr, "name: %s\n", witnessClass->getDescription()->Name.get());
4425-
}
44264394
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
44274395
}
44284396

0 commit comments

Comments
 (0)