Go to file
erikcorry f14b93a508 Regexp: Improve the speed that we scan for an initial point where a non-anchored
regexp can match by using a Boyer-Moore-like table.  This is done by identifying
non-greedy non-capturing loops in the nodes that eat any character one at a time.
For example in the middle of the regexp /foo[\s\S]*?bar/ we find such a loop.
There is also such a loop implicitly inserted at the start of any non-anchored
regexp.

When we have found such a loop we look ahead in the nodes to find the set of
characters that can come at given distances.  For example for the regexp
/.?foo/ we know that there are at least 3 characters ahead of us, and the sets
of characters that can occur are [any, [f, o], [o]].  We find a range in the
lookahead info where the set of characters is reasonably constrained.  In our
example this is from index 1 to 2 (0 is not constrained).  We can now look 3
characters ahead and if we don't find one of [f, o] (the union of [f, o] and
[o]) then we can skip forwards by the range size (in this case 2).

For Unicode input strings we do the same, but modulo 128.

We also look at the first string fed to the regexp and use that to get a hint
of the character frequencies in the inputs.  This affects the assessment of
whether the set of characters is 'reasonably constrained'.

We still have the old lookahead mechanism, which uses a wide load of multiple
characters followed by a mask and compare to determine whether a match is
possible at this point.
Review URL: http://codereview.chromium.org/9965010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-02 09:38:07 +00:00
benchmarks More fixes for V8 benchmark version 7. 2012-03-15 17:13:50 +00:00
build Add support for Mac OS X 64bit builds with GYP 2012-03-30 15:01:11 +00:00
include This value is required for showing the heap snapshot delta in Summary view of DevTools.Profiler. 2012-03-27 11:54:47 +00:00
preparser Prevent segfault when preparser fails due to lack of argument. 2012-02-22 10:31:32 +00:00
samples Fix scoping of v8::HandleScope to prevent use-after-dispose 2012-03-30 13:49:40 +00:00
src Regexp: Improve the speed that we scan for an initial point where a non-anchored 2012-04-02 09:38:07 +00:00
test Regexp: Improve the speed that we scan for an initial point where a non-anchored 2012-04-02 09:38:07 +00:00
tools Add support for Mac OS X 64bit builds with GYP 2012-03-30 15:01:11 +00:00
.gitignore Fix .gitignore for test data directories. 2012-02-20 13:17:20 +00:00
AUTHORS Add support for Mac OS X 64bit builds with GYP 2012-03-30 15:01:11 +00:00
ChangeLog Prepare push to trunk. Now working on version 3.10.1. 2012-03-30 08:35:30 +00:00
LICENSE Update LICENSE file 2012-01-03 16:38:42 +00:00
LICENSE.strongtalk Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.v8 Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.valgrind Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
Makefile Add support for Mac OS X 64bit builds with GYP 2012-03-30 15:01:11 +00:00
SConstruct Enable snapshots on MIPS. This is based on 2012-03-21 14:29:14 +00:00