Skip to content

Commit 1843a87

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

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
@@ -4403,7 +4403,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44034403
const Metadata *conformingType,
44044404
const ProtocolRequirement *reqBase,
44054405
const ProtocolRequirement *assocType) {
4406-
fprintf(stderr, "Entering slow path: %p %p %p %p\n", wtable, conformingType, reqBase, assocType);
44074406
#ifndef NDEBUG
44084407
{
44094408
const ProtocolConformanceDescriptor *conformance = wtable->Description;
@@ -4430,8 +4429,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44304429
const char *mangledNameBase =
44314430
(const char *)(uintptr_t(witness) &
44324431
~ProtocolRequirementFlags::AssociatedTypeMangledNameBit);
4433-
fprintf(stderr, "Mangled name base: %p\n", mangledNameBase);
4434-
fprintf(stderr, "name: %s\n", mangledNameBase);
44354432

44364433
// Check whether the mangled name has the prefix byte indicating that
44374434
// the mangled name is relative to the protocol itself.
@@ -4446,18 +4443,13 @@ swift_getAssociatedTypeWitnessSlowImpl(
44464443
const ProtocolConformanceDescriptor *conformance = wtable->Description;
44474444
const ProtocolDescriptor *protocol = conformance->getProtocol();
44484445

4449-
fprintf(stderr, "conformance %p protocol %p\n", conformance, protocol);
4450-
44514446
// Extract the mangled name itself.
44524447
StringRef mangledName =
44534448
Demangle::makeSymbolicMangledNameStringRef(mangledNameBase);
44544449

4455-
fprintf(stderr, "mangledName: %s\n", mangledName.str().c_str());
4456-
44574450
// Demangle the associated type.
44584451
MetadataResponse response;
44594452
if (inProtocolContext) {
4460-
fprintf(stderr, "in protocol context\n");
44614453
// The protocol's Self is the only generic parameter that can occur in the
44624454
// type.
44634455
response =
@@ -4480,7 +4472,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44804472
dependentDescriptor);
44814473
}).getResponse();
44824474
} else {
4483-
fprintf(stderr, "getting original conforming type\n");
44844475
// The generic parameters in the associated type name are those of the
44854476
// conforming type.
44864477

@@ -4499,18 +4490,6 @@ swift_getAssociatedTypeWitnessSlowImpl(
44994490
}).getResponse();
45004491
}
45014492
auto assocTypeMetadata = response.Value;
4502-
fprintf(stderr, "assocTypeMetadata: %p\n", assocTypeMetadata);
4503-
4504-
if (true) {
4505-
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
4506-
StringRef conformingTypeName(conformingTypeNameInfo.data,
4507-
conformingTypeNameInfo.length);
4508-
StringRef assocTypeName = findAssociatedTypeName(protocol, assocType);
4509-
fprintf(stderr, "fin: %s %s %s %s\n", assocTypeName.str().c_str(),
4510-
conformingTypeName.str().c_str(),
4511-
protocol->Name.get(),
4512-
mangledName.str().c_str());
4513-
}
45144493

45154494
if (!assocTypeMetadata) {
45164495
auto conformingTypeNameInfo = swift_getTypeName(conformingType, true);
@@ -4546,20 +4525,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request,
45464525
// If the low bit of the witness is clear, it's already a metadata pointer.
45474526
unsigned witnessIndex = assocType - reqBase;
45484527
auto witness = ((const void* const *)wtable)[witnessIndex];
4549-
fprintf(stderr, "getAssociatedTypeWitness fastpath: %x %p\n", witnessIndex, witness);
45504528
if (LLVM_LIKELY((uintptr_t(witness) &
45514529
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
45524530
// Cached metadata pointers are always complete.
4553-
fprintf(stderr, "fastpath: %p\n", witness);
4554-
auto witnessPtr = (const Metadata *)witness;
4555-
witnessPtr->dump();
4556-
if (witnessPtr->getKind() == MetadataKind::Class) {
4557-
fprintf(stderr, "class description:\n");
4558-
auto witnessClass = witnessPtr->getClassObject();
4559-
fprintf(stderr, "%lx\n", *(unsigned long*)&witnessClass->Data);
4560-
if (witnessClass->isTypeMetadata())
4561-
fprintf(stderr, "name: %s\n", witnessClass->getDescription()->Name.get());
4562-
}
45634531
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
45644532
}
45654533

0 commit comments

Comments
 (0)