This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
VERB nodes in the regex engine should NOT be marked as JUMPABLE.
authorBram <p5p@perl.wizbit.be>
Thu, 26 Aug 2010 11:27:24 +0000 (13:27 +0200)
committerYves Orton <demerphq@gmail.com>
Thu, 26 Aug 2010 11:36:57 +0000 (13:36 +0200)
commitd1c771f5a95fddf225347623798f65884aa6eee7
treec4487cca6e52a71bbd4ca06df7771c75d5ea5fcf
parent39c4496953eaedb023e4a860fd4bdeacdba098c8
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.
regexec.c
t/re/pat_advanced.t