RESOLVED FIXED Bug 119191
Regular expressions with ".?" expressions at the start and the end match the entire string
https://bugs.webkit.org/show_bug.cgi?id=119191
Summary Regular expressions with ".?" expressions at the start and the end match the ...
Till Schneidereit
Reported 2013-07-28 05:12:09 PDT
STR: Execute the following code in JSC: 'abcdefghijk'.match('.?e.?') Expected result: def Actual result: abcdefghijk This also happens in SpiderMonkey, so it's almost guaranteed to be a Yarr issue.
Attachments
Patch (5.41 KB, patch)
2018-07-02 01:15 PDT, Sukolsak Sakshuwong
no flags
Archive of layout-test-results from ews205 for win-future (12.87 MB, application/zip)
2018-07-02 04:50 PDT, EWS Watchlist
no flags
Patch for landing (5.66 KB, patch)
2018-07-02 17:24 PDT, Sukolsak Sakshuwong
no flags
Till Schneidereit
Comment 1 2013-07-28 05:26:53 PDT
For SpiderMonkey, this regressed between two Yarr imports we did: 86639 was good, 130234 is bad.
Sukolsak Sakshuwong
Comment 2 2018-07-02 01:15:18 PDT
Sukolsak Sakshuwong
Comment 3 2018-07-02 01:32:02 PDT
The benchmark results are at https://gist.github.com/sukolsak/da11c94998776a4dfb3340f12f7b7688. The patch doesn't seem to cause a significant slowdown. I can think of a way to optimize these cases (/.?abc.*/, /.*abc.?/, /.{0,4}abc.*/, etc), which involves storing the quantifiers of the leading and trailing dots in the DotStarEnclosure. But I'm not sure if we should do it.
EWS Watchlist
Comment 4 2018-07-02 04:50:15 PDT
Comment on attachment 344084 [details] Patch Attachment 344084 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8410946 New failing tests: http/tests/security/canvas-remote-read-remote-video-redirect.html http/tests/security/video-poster-cross-origin-crash2.html
EWS Watchlist
Comment 5 2018-07-02 04:50:27 PDT
Created attachment 344094 [details] Archive of layout-test-results from ews205 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews205 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Michael Saboff
Comment 6 2018-07-02 10:55:15 PDT
Comment on attachment 344084 [details] Patch r=me
Sukolsak Sakshuwong
Comment 7 2018-07-02 17:12:03 PDT
Thanks! I ran some additional benchmark tests. (Thanks rniwa and yusukesuzuki for the help!). Here are the results. Without the patch: RexBench 23.00 +- 1.71ms JetStream Score 203.41 +- 37.830 With the patch: RexBench 23.19 +- 3.13ms JetStream Score 200.63 +- 41.824
Sukolsak Sakshuwong
Comment 8 2018-07-02 17:24:55 PDT
Created attachment 344156 [details] Patch for landing
WebKit Commit Bot
Comment 9 2018-07-02 18:03:26 PDT
Comment on attachment 344156 [details] Patch for landing Clearing flags on attachment: 344156 Committed r233453: <https://trac.webkit.org/changeset/233453>
WebKit Commit Bot
Comment 10 2018-07-02 18:03:27 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2018-07-02 18:05:47 PDT
Note You need to log in before you can comment on or make changes to this bug.