Skip to content

Commit 81d21a3

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

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
@@ -4277,7 +4277,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
42774277
const Metadata *conformingType,
42784278
const ProtocolRequirement *reqBase,
42794279
const ProtocolRequirement *assocType) {
4280-
fprintf(stderr, "Entering slow path: %p %p %p %p\n", wtable, conformingType, reqBase, assocType);
42814280
#ifndef NDEBUG
42824281
{
42834282
const ProtocolConformanceDescriptor *conformance = wtable->Description;
@@ -4304,8 +4303,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43044303
const char *mangledNameBase =
43054304
(const char *)(uintptr_t(witness) &
43064305
~ProtocolRequirementFlags::AssociatedTypeMangledNameBit);
4307-
fprintf(stderr, "Mangled name base: %p\n", mangledNameBase);
4308-
fprintf(stderr, "name: %s\n", mangledNameBase);
43094306

43104307
// Check whether the mangled name has the prefix byte indicating that
43114308
// the mangled name is relative to the protocol itself.
@@ -4320,18 +4317,13 @@ swift_getAssociatedTypeWitnessSlowImpl(
43204317
const ProtocolConformanceDescriptor *conformance = wtable->Description;
43214318
const ProtocolDescriptor *protocol = conformance->getProtocol();
43224319

4323-
fprintf(stderr, "conformance %p protocol %p\n", conformance, protocol);
4324-
43254320
// Extract the mangled name itself.
43264321
StringRef mangledName =
43274322
Demangle::makeSymbolicMangledNameStringRef(mangledNameBase);
43284323

4329-
fprintf(stderr, "mangledName: %s\n", mangledName.str().c_str());
4330-
43314324
// Demangle the associated type.
43324325
MetadataResponse response;
43334326
if (inProtocolContext) {
4334-
fprintf(stderr, "in protocol context\n");
43354327
// The protocol's Self is the only generic parameter that can occur in the
43364328
// type.
43374329
response =
@@ -4354,7 +4346,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43544346
dependentDescriptor);
43554347
}).getResponse();
43564348
} else {
4357-
fprintf(stderr, "getting original conforming type\n");
43584349
// The generic parameters in the associated type name are those of the
43594350
// conforming type.
43604351

@@ -4373,18 +4364,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43734364
}).getResponse();
43744365
}
43754366
auto assocTypeMetadata = response.Value;
4376-
fprintf(stderr, "assocTypeMetadata: %p\n", assocTypeMetadata);
4377-
4378-
if (true) {
4379-
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
4380-
StringRef conformingTypeName(conformingTypeNameInfo.data,
4381-
conformingTypeNameInfo.length);
4382-
StringRef assocTypeName = findAssociatedTypeName(protocol, assocType);
4383-
fprintf(stderr, "fin: %s %s %s %s\n", assocTypeName.str().c_str(),
4384-
conformingTypeName.str().c_str(),
4385-
protocol->Name.get(),
4386-
mangledName.str().c_str());
4387-
}
43884367

43894368
if (!assocTypeMetadata) {
43904369
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
@@ -4420,20 +4399,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request,
44204399
// If the low bit of the witness is clear, it's already a metadata pointer.
44214400
unsigned witnessIndex = assocType - reqBase;
44224401
auto witness = ((const void* const *)wtable)[witnessIndex];
4423-
fprintf(stderr, "getAssociatedTypeWitness fastpath: %x %p\n", witnessIndex, witness);
44244402
if (LLVM_LIKELY((uintptr_t(witness) &
44254403
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
44264404
// Cached metadata pointers are always complete.
4427-
fprintf(stderr, "fastpath: %p\n", witness);
4428-
auto witnessPtr = (const Metadata *)witness;
4429-
witnessPtr->dump();
4430-
if (witnessPtr->getKind() == MetadataKind::Class) {
4431-
fprintf(stderr, "class description:\n");
4432-
auto witnessClass = witnessPtr->getClassObject();
4433-
fprintf(stderr, "%lx\n", *(unsigned long*)&witnessClass->Data);
4434-
if (witnessClass->isTypeMetadata())
4435-
fprintf(stderr, "name: %s\n", witnessClass->getDescription()->Name.get());
4436-
}
44374405
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
44384406
}
44394407

0 commit comments

Comments
 (0)