summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-01 22:00:30 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-01 22:00:30 +0000
commit44a689609fa78445e4c210006ef16da270d4e29e (patch)
tree4beaf9906defe0a6bac37184d1917140f92fab99 /regexec.c
parent257059b58a2d77aba48bf099d2f6f36a7db36640 (diff)
downloadperl-44a689609fa78445e4c210006ef16da270d4e29e.tar.gz
Hugo's second thoughts: drop the relatively rare and
slow optimization for now. p4raw-id: //depot/perl@20437
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c55
1 files changed, 6 insertions, 49 deletions
diff --git a/regexec.c b/regexec.c
index 961611b710..df96924d89 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3351,7 +3351,6 @@ S_regmatch(pTHX_ regnode *prog)
{
I32 l = 0;
CHECKPOINT lastcp;
- I32 lparen = *PL_reglastparen;
/* We suppose that the next guy does not need
backtracking: in particular, it is of constant length,
@@ -3391,19 +3390,8 @@ S_regmatch(pTHX_ regnode *prog)
if (! HAS_TEXT(text_node)) c1 = c2 = -1000;
else {
if (PL_regkind[(U8)OP(text_node)] == REF) {
- I32 n, ln;
- n = ARG(text_node); /* which paren pair */
- ln = PL_regstartp[n];
- /* assume yes if we haven't seen CLOSEn */
- if (
- (I32)*PL_reglastparen < n ||
- ln == -1 ||
- ln == PL_regendp[n]
- ) {
- c1 = c2 = -1000;
- goto assume_ok_MM;
- }
- c1 = *(PL_bostr + ln);
+ c1 = c2 = -1000;
+ goto assume_ok_MM;
}
else { c1 = (U8)*STRING(text_node); }
if (OP(text_node) == EXACTF || OP(text_node) == REFF)
@@ -3436,8 +3424,6 @@ S_regmatch(pTHX_ regnode *prog)
}
if (regmatch(next))
sayYES;
- /* t/op/regexp.t test 885 fails if this is performed */
- /* *PL_reglastparen = lparen; */
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- move forward. */
@@ -3475,19 +3461,8 @@ S_regmatch(pTHX_ regnode *prog)
if (! HAS_TEXT(text_node)) c1 = c2 = -1000;
else {
if (PL_regkind[(U8)OP(text_node)] == REF) {
- I32 n, ln;
- n = ARG(text_node); /* which paren pair */
- ln = PL_regstartp[n];
- /* assume yes if we haven't seen CLOSEn */
- if (
- (I32)*PL_reglastparen < n ||
- ln == -1 ||
- ln == PL_regendp[n]
- ) {
- c1 = c2 = -1000;
- goto assume_ok_REG;
- }
- c1 = *(PL_bostr + ln);
+ c1 = c2 = -1000;
+ goto assume_ok_REG;
}
else { c1 = (U8)*STRING(text_node); }
@@ -3525,7 +3500,6 @@ S_regmatch(pTHX_ regnode *prog)
}
if (regmatch(next))
sayYES;
- *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */
@@ -3585,19 +3559,8 @@ S_regmatch(pTHX_ regnode *prog)
if (! HAS_TEXT(text_node)) c1 = c2 = -1000;
else {
if (PL_regkind[(U8)OP(text_node)] == REF) {
- I32 n, ln;
- n = ARG(text_node); /* which paren pair */
- ln = PL_regstartp[n];
- /* assume yes if we haven't seen CLOSEn */
- if (
- (I32)*PL_reglastparen < n ||
- ln == -1 ||
- ln == PL_regendp[n]
- ) {
- c1 = c2 = -1000;
- goto assume_ok_easy;
- }
- s = (U8*)PL_bostr + ln;
+ c1 = c2 = -1000;
+ goto assume_ok_easy;
}
else { s = (U8*)STRING(text_node); }
@@ -3638,7 +3601,6 @@ S_regmatch(pTHX_ regnode *prog)
PL_reginput = locinput;
if (minmod) {
CHECKPOINT lastcp;
- I32 lparen = *PL_reglastparen;
minmod = 0;
if (ln && regrepeat(scan, ln) < ln)
sayNO;
@@ -3745,7 +3707,6 @@ S_regmatch(pTHX_ regnode *prog)
if (c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, ln, PL_reginput);
- *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
}
@@ -3753,7 +3714,6 @@ S_regmatch(pTHX_ regnode *prog)
else if (c1 == -1000)
{
TRYPAREN(paren, ln, PL_reginput);
- *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- move forward. */
@@ -3768,7 +3728,6 @@ S_regmatch(pTHX_ regnode *prog)
}
else {
CHECKPOINT lastcp;
- I32 lparen = *PL_reglastparen;
n = regrepeat(scan, n);
locinput = PL_reginput;
if (ln < n && PL_regkind[(U8)OP(next)] == EOL &&
@@ -3799,7 +3758,6 @@ S_regmatch(pTHX_ regnode *prog)
if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
- *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */
@@ -3823,7 +3781,6 @@ S_regmatch(pTHX_ regnode *prog)
if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
- *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */