Reland II of 'Optimize trivial regexp disjunctions' CL 1176453002
authorerikcorry <erikcorry@chromium.org>
Wed, 10 Jun 2015 09:55:22 +0000 (02:55 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 10 Jun 2015 09:55:31 +0000 (09:55 +0000)
commit05507cc3ea6e96e9e9df98d276c235eea32374dd
treefb254751f77b42cf3c4d77993e051f596b8422f5
parent1a511b0e38f57431494e8a00a4ae92fcede9e02f
Reland II of 'Optimize trivial regexp disjunctions' CL 1176453002

This change rewrites regexps like (ab|ac|z|ad|ae|af) into (a[b-f]|z).  We can only reorder disjunctions like this for case-dependent regexps.  For case-independent regexps, the disjunctions should be pre-sorted for best results.

R=yangguo@chromium.org
BUG=chromium:482998
LOG=n

Review URL: https://codereview.chromium.org/1180433003

Cr-Commit-Position: refs/heads/master@{#28902}
src/ast.h
src/jsregexp.cc
src/jsregexp.h
src/list-inl.h
src/list.h
src/vector.h
test/cctest/test-heap.cc
test/mjsunit/regress/regress-crbug-482998.js [new file with mode: 0644]