@@ -553,6 +553,7 @@ static const ProtocolConformanceDescriptor *
553
553
swift_conformsToSwiftProtocolImpl (const Metadata * const type,
554
554
const ProtocolDescriptor *protocol,
555
555
StringRef module ) {
556
+ fprintf (stderr, " in impl2\n " );
556
557
auto &C = Conformances.get ();
557
558
558
559
// See if we have a cached conformance. The ConcurrentMap data structure
@@ -579,17 +580,25 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
579
580
C.cacheFailure (type, protocol, snapshot.count ());
580
581
return nullptr ;
581
582
}
582
-
583
+ fprintf (stderr, " got to really scan \n " );
583
584
// Really scan conformance records.
584
585
for (size_t i = startIndex; i < endIndex; i++) {
586
+ fprintf (stderr, " index = %lx\n " , (unsigned long )i);
585
587
auto §ion = snapshot.Start [i];
586
588
// Eagerly pull records for nondependent witnesses into our cache.
587
589
for (const auto &record : section) {
588
- auto &descriptor = *record.get ();
590
+ fprintf (stderr, " got a record\n " );
591
+ auto descriptorPtr = record.get ();
592
+ auto &descriptor = *descriptorPtr;
593
+ fprintf (stderr, " got the descriptor: %p\n " , descriptorPtr);
594
+ fprintf (stderr, " got the protocol: %p\n " , descriptor.getProtocol ());
595
+ descriptor.getProtocol ()->dump ();
596
+ fprintf (stderr, " got it\n " );
589
597
590
598
// We only care about conformances for this protocol.
591
599
if (descriptor.getProtocol () != protocol)
592
600
continue ;
601
+ fprintf (stderr, " about to get matching type\n " );
593
602
594
603
// If there's a matching type, record the positive result.
595
604
ConformanceCandidate candidate (descriptor);
@@ -604,6 +613,7 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
604
613
}
605
614
606
615
// Conformance scan is complete.
616
+ fprintf (stderr, " about to update cache\n " );
607
617
608
618
// Search the cache once more, and this time update the cache if necessary.
609
619
FoundConformance = searchInConformanceCache (type, protocol);
@@ -618,10 +628,18 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
618
628
static const WitnessTable *
619
629
swift_conformsToProtocolImpl (const Metadata * const type,
620
630
const ProtocolDescriptor *protocol) {
631
+ // WebAssembly: logging pls
632
+ fprintf (stderr, " swift_conformsToProtocolImpl: %p %p\n " , type, protocol);
633
+ protocol->dump ();
634
+ fprintf (stderr, " trying to dump the type now\n " );
635
+ type->dump ();
636
+ fprintf (stderr, " dumped the type\n " );
637
+ // end WebAssembly
621
638
auto description =
622
639
swift_conformsToSwiftProtocol (type, protocol, StringRef ());
623
640
if (!description)
624
641
return nullptr ;
642
+ description->getProtocol ()->dump ();
625
643
626
644
return description->getWitnessTable (
627
645
findConformingSuperclass (type, description));
0 commit comments