Change 15297 by jhi@alpha on 2002/03/18 14:39:15
Make regex DEBUGGING faster.
Affected files ...
.... //depot/perl/perl.c#416 edit
.... //depot/perl/perl.h#448 edit
.... //depot/perl/regexec.c#267 edit
Differences ...
==== //depot/perl/perl.c#416 (text) ====
Index: perl/perl.c
--- perl/perl.c.~1~ Mon Mar 18 07:45:05 2002
+++ perl/perl.c Mon Mar 18 07:45:05 2002
@@ -258,6 +258,11 @@
PL_fdpid = newAV(); /* for remembering popen pids by fd */
PL_modglobal = newHV(); /* pointers to per-interpreter module globals
*/
PL_errors = newSVpvn("",0);
+#ifdef DEBUGGING
+ sv_setpvn(PERL_DEBUG_PAD(0), "", 0); /* For regex debugging. */
+ sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
+ sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
+#endif
#ifdef USE_ITHREADS
PL_regex_padav = newAV();
av_push(PL_regex_padav,(SV*)newAV()); /* First entry is an array of empty
elements */
==== //depot/perl/perl.h#448 (text) ====
Index: perl/perl.h
--- perl/perl.h.~1~ Mon Mar 18 07:45:05 2002
+++ perl/perl.h Mon Mar 18 07:45:05 2002
@@ -3183,7 +3183,7 @@
};
#define PERL_DEBUG_PAD(i) &(PL_debug_pad.pad[i])
-#define PERL_DEBUG_PAD_ZERO(i) (sv_setpvn(PERL_DEBUG_PAD(i), "", 0),
PERL_DEBUG_PAD(i))
+#define PERL_DEBUG_PAD_ZERO(i) (SvPVX(PERL_DEBUG_PAD(i))[0] = 0,
+SvCUR(PERL_DEBUG_PAD(i)) = 0, PERL_DEBUG_PAD(i))
/* Enable variables which are pointers to functions */
typedef void (CPERLscope(*peep_t))(pTHX_ OP* o);
==== //depot/perl/regexec.c#267 (text) ====
Index: perl/regexec.c
--- perl/regexec.c.~1~ Mon Mar 18 07:45:05 2002
+++ perl/regexec.c Mon Mar 18 07:45:05 2002
@@ -2054,12 +2054,6 @@
New(22,PL_reg_start_tmp, PL_reg_start_tmpl, char*);
}
-#ifdef DEBUGGING
- sv_setpvn(PERL_DEBUG_PAD(0), "", 0);
- sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
- sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
-#endif
-
/* XXXX What this code is doing here?!!! There should be no need
to do this again and again, PL_reglastparen should take care of
this! --ilya*/
End of Patch.