summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorBram <p5p@perl.wizbit.be>2010-08-26 13:27:24 +0200
committerYves Orton <demerphq@gmail.com>2010-08-26 13:36:57 +0200
commitd1c771f5a95fddf225347623798f65884aa6eee7 (patch)
treec4487cca6e52a71bbd4ca06df7771c75d5ea5fcf /regexec.c
parent39c4496953eaedb023e4a860fd4bdeacdba098c8 (diff)
downloadperl-d1c771f5a95fddf225347623798f65884aa6eee7.tar.gz
VERB nodes in the regex engine should NOT be marked as JUMPABLE.
JUMPABLE nodes can be ignored during certain phases of regex execution, including ones where backtracking is affected. This change disables this behviour so that the VERBS can perform their desired results. Committer has taken the liberty of modifying the patch so that all VERBS are jumped, thus making the JUMPABLE expression a little simpler. I have left Bram's change to JUMPABLE intact, but inside of a comment for now. See discussion in thread for [perl #71942] *COMMIT bypasses optimisation for futher details. http://rt.perl.org/rt3/Ticket/Display.html?id=71942 There appears to be room for futher optimisation here by moving the JUMPABLE logic to regex-compile time. Currently it is arguable that the "optimisation" this patch seeks to avoid is actually not an optimisation at all, as it happens OVER AND OVER during execution of a match, thus the extra effort might actually outweight the benefit, especially on large strings.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 35ef8d4b12..ec4c4b049a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -252,7 +252,8 @@
OP(rn) == EVAL || \
OP(rn) == SUSPEND || OP(rn) == IFMATCH || \
OP(rn) == PLUS || OP(rn) == MINMOD || \
- OP(rn) == KEEPS || (PL_regkind[OP(rn)] == VERB) || \
+ OP(rn) == KEEPS || \
+ /*(PL_regkind[OP(rn)] == VERB && OP(rn) != PRUNE && OP(rn) != COMMIT && OP(rn) != MARKPOINT && OP(rn) != SKIP && OP(rn) != CUTGROUP) || */\
(PL_regkind[OP(rn)] == CURLY && ARG1(rn) > 0) \
)
#define IS_EXACT(rn) (PL_regkind[OP(rn)] == EXACT)