Skip to content

Commit b253e12

Browse files
zhuoweikateinoigakukun
authored andcommitted
Revert "WebAssembly: add logging in swift_getAssociatedTypeWitness"
Don't need the logging anymore. This reverts commit 7d35644ca7bfa027505f09b9232d34b8191bd42d.
1 parent 6c7047a commit b253e12

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
@@ -4350,7 +4350,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43504350
const Metadata *conformingType,
43514351
const ProtocolRequirement *reqBase,
43524352
const ProtocolRequirement *assocType) {
4353-
fprintf(stderr, "Entering slow path: %p %p %p %p\n", wtable, conformingType, reqBase, assocType);
43544353
#ifndef NDEBUG
43554354
{
43564355
const ProtocolConformanceDescriptor *conformance = wtable->Description;
@@ -4377,8 +4376,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
43774376
const char *mangledNameBase =
43784377
(const char *)(uintptr_t(witness) &
43794378
~ProtocolRequirementFlags::AssociatedTypeMangledNameBit);
4380-
fprintf(stderr, "Mangled name base: %p\n", mangledNameBase);
4381-
fprintf(stderr, "name: %s\n", mangledNameBase);
43824379

43834380
// Check whether the mangled name has the prefix byte indicating that
43844381
// the mangled name is relative to the protocol itself.
@@ -4393,18 +4390,13 @@ swift_getAssociatedTypeWitnessSlowImpl(
43934390
const ProtocolConformanceDescriptor *conformance = wtable->Description;
43944391
const ProtocolDescriptor *protocol = conformance->getProtocol();
43954392

4396-
fprintf(stderr, "conformance %p protocol %p\n", conformance, protocol);
4397-
43984393
// Extract the mangled name itself.
43994394
StringRef mangledName =
44004395
Demangle::makeSymbolicMangledNameStringRef(mangledNameBase);
44014396

4402-
fprintf(stderr, "mangledName: %s\n", mangledName.str().c_str());
4403-
44044397
// Demangle the associated type.
44054398
MetadataResponse response;
44064399
if (inProtocolContext) {
4407-
fprintf(stderr, "in protocol context\n");
44084400
// The protocol's Self is the only generic parameter that can occur in the
44094401
// type.
44104402
response =
@@ -4427,7 +4419,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44274419
dependentDescriptor);
44284420
}).getResponse();
44294421
} else {
4430-
fprintf(stderr, "getting original conforming type\n");
44314422
// The generic parameters in the associated type name are those of the
44324423
// conforming type.
44334424

@@ -4446,18 +4437,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44464437
}).getResponse();
44474438
}
44484439
auto assocTypeMetadata = response.Value;
4449-
fprintf(stderr, "assocTypeMetadata: %p\n", assocTypeMetadata);
4450-
4451-
if (true) {
4452-
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
4453-
StringRef conformingTypeName(conformingTypeNameInfo.data,
4454-
conformingTypeNameInfo.length);
4455-
StringRef assocTypeName = findAssociatedTypeName(protocol, assocType);
4456-
fprintf(stderr, "fin: %s %s %s %s\n", assocTypeName.str().c_str(),
4457-
conformingTypeName.str().c_str(),
4458-
protocol->Name.get(),
4459-
mangledName.str().c_str());
4460-
}
44614440

44624441
if (!assocTypeMetadata) {
44634442
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
@@ -4493,20 +4472,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request,
44934472
// If the low bit of the witness is clear, it's already a metadata pointer.
44944473
unsigned witnessIndex = assocType - reqBase;
44954474
auto witness = ((const void* const *)wtable)[witnessIndex];
4496-
fprintf(stderr, "getAssociatedTypeWitness fastpath: %x %p\n", witnessIndex, witness);
44974475
if (LLVM_LIKELY((uintptr_t(witness) &
44984476
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
44994477
// Cached metadata pointers are always complete.
4500-
fprintf(stderr, "fastpath: %p\n", witness);
4501-
auto witnessPtr = (const Metadata *)witness;
4502-
witnessPtr->dump();
4503-
if (witnessPtr->getKind() == MetadataKind::Class) {
4504-
fprintf(stderr, "class description:\n");
4505-
auto witnessClass = witnessPtr->getClassObject();
4506-
fprintf(stderr, "%lx\n", *(unsigned long*)&witnessClass->Data);
4507-
if (witnessClass->isTypeMetadata())
4508-
fprintf(stderr, "name: %s\n", witnessClass->getDescription()->Name.get());
4509-
}
45104478
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
45114479
}
45124480

0 commit comments

Comments
 (0)