@@ -386,12 +386,6 @@ namespace UnifiedRegex
386
386
byte *currentByte = startByte;
387
387
w->Print (_u (" 0x%p[+0x%03x](0x%03x) [%s]:" ), startByte, offset, size, annotation);
388
388
389
- if ((T *)this == that)
390
- {
391
- w->PrintEOL (_u (" (no unique data -- skipping)" ));
392
- return ;
393
- }
394
-
395
389
for (; currentByte < endByte; ++currentByte)
396
390
{
397
391
if ((currentByte - endByte) % 4 == 0 )
@@ -412,7 +406,7 @@ namespace UnifiedRegex
412
406
ptrdiff_t offsetToData = (byte *)&(start->tag ) - ((byte *)start);
413
407
size_t size = baseSize - offsetToData;
414
408
415
- byte *startByte = (byte *)(&(start->tag )); // skip over the vtable pointer
409
+ byte *startByte = (byte *)(&(start->tag ));
416
410
byte *endByte = startByte + size;
417
411
byte *currentByte = startByte;
418
412
w->Print (_u (" 0x%p[+0x%03x](0x%03x) [%s]:" ), startByte, offsetToData, size, annotation);
@@ -5722,7 +5716,6 @@ namespace UnifiedRegex
5722
5716
return res;
5723
5717
}
5724
5718
5725
-
5726
5719
#if ENABLE_REGEX_CONFIG_OPTIONS
5727
5720
void Matcher::Print (DebugWriter* w, const Char* const input, const CharCount inputLength, CharCount inputOffset, const uint8* instPointer, ContStack &contStack, AssertionStack &assertionStack) const
5728
5721
{
@@ -5759,7 +5752,28 @@ namespace UnifiedRegex
5759
5752
if (program->tag == Program::BOIInstructionsTag || program->tag == Program::InstructionsTag)
5760
5753
{
5761
5754
w->Print (_u (" instPointer: " ));
5762
- ((const Inst*)instPointer)->Print (w, InstPointerToLabel (instPointer), program->rep .insts .litbuf );
5755
+
5756
+ const Inst* inst = (const Inst*)instPointer;
5757
+ switch (inst->tag )
5758
+ {
5759
+ #define MBase (TagName, ClassName ) \
5760
+ case Inst::TagName: \
5761
+ { \
5762
+ const ClassName *actualInst = static_cast <const ClassName *>(inst); \
5763
+ actualInst->Print (w, InstPointerToLabel (instPointer), program->rep .insts .litbuf ); \
5764
+ break ; \
5765
+ }
5766
+ #define M (TagName ) MBase(TagName, TagName##Inst)
5767
+ #define MTemplate (TagName, TemplateDeclaration, GenericClassName, SpecializedClassName ) MBase(TagName, SpecializedClassName)
5768
+ #include " RegexOpCodes.h"
5769
+ #undef MBase
5770
+ #undef M
5771
+ #undef MTemplate
5772
+ default :
5773
+ Assert (false );
5774
+ __assume (false );
5775
+ }
5776
+
5763
5777
w->PrintEOL (_u (" groups:" ));
5764
5778
w->Indent ();
5765
5779
for (int i = 0 ; i < program->numGroups ; i++)
@@ -5920,7 +5934,26 @@ namespace UnifiedRegex
5920
5934
int i = 0 ;
5921
5935
while (curr != instsLim)
5922
5936
{
5923
- curr += ((Inst*)curr)->Print (w, (Label)(isBaselineMode ? i++ : curr - rep.insts .insts ), rep.insts .litbuf );
5937
+ const Inst *inst = (const Inst*)curr;
5938
+ switch (inst->tag )
5939
+ {
5940
+ #define MBase (TagName, ClassName ) \
5941
+ case Inst::TagName: \
5942
+ { \
5943
+ const ClassName *actualInst = static_cast <const ClassName *>(inst); \
5944
+ curr += actualInst->Print (w, (Label)(isBaselineMode ? i++ : curr - rep.insts .insts ), rep.insts .litbuf ); \
5945
+ break ; \
5946
+ }
5947
+ #define M (TagName ) MBase(TagName, TagName##Inst)
5948
+ #define MTemplate (TagName, TemplateDeclaration, GenericClassName, SpecializedClassName ) MBase(TagName, SpecializedClassName)
5949
+ #include " RegexOpCodes.h"
5950
+ #undef MBase
5951
+ #undef M
5952
+ #undef MTemplate
5953
+ default :
5954
+ Assert (false );
5955
+ __assume (false );
5956
+ }
5924
5957
}
5925
5958
w->Unindent ();
5926
5959
w->PrintEOL (_u (" }" ));
0 commit comments