Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Issue 2777583003: Regexp: Optimize better in presence of lookaround. (Closed)

Created:
3 years, 9 months ago by erikcorry
Modified:
3 years, 9 months ago
Reviewers:
Yang
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

Regexp: Optimize better in presence of lookaround. Previously the Boyer-Moore-Horspool optimization gave up in the presence of a submatch. A submatch is where we record the current position so that we can go back to it, which is an essential part of the semantics of lookarounds (lookaheads and lookbehinds). This has been the case since Boyer-Moore-Horspool was implemented, but it was overly cautious. * For positive lookahead it is OK to use the patterns inside the lookahead to guide the BMS optimization. * For positive lookbehind we harmlessly fail to optimize when the patterns inside the lookbehind go backwards because TextNode::EatsAtLeast returns 0. * For negative lookarounds, the NegativeLookaroundChoiceNode::FillInBMInfo method (in jsregexp.h) knows to only look at the following pattern. This is in response to disappointing lookbehind performance in Atom. See https://github.com/atom/find-and-replace/issues/571 R=yangguo@chromium.org BUG= Review-Url: https://codereview.chromium.org/2777583003 Cr-Commit-Position: refs/heads/master@{#44139} Committed: https://chromium.googlesource.com/v8/v8/+/8df7c2a21b07174c3704894ca1d149b2711dfa58

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -3 lines) Patch
M src/regexp/jsregexp.cc View 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
erikcorry
3 years, 9 months ago (2017-03-25 10:53:55 UTC) #1
Yang
On 2017/03/25 10:53:55, erikcorry wrote: lgtm.
3 years, 9 months ago (2017-03-27 07:04:45 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2777583003/1
3 years, 9 months ago (2017-03-27 07:05:41 UTC) #4
commit-bot: I haz the power
3 years, 9 months ago (2017-03-27 07:29:02 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/v8/v8/+/8df7c2a21b07174c3704894ca1d149b2711...

Powered by Google App Engine
This is Rietveld 408576698