• erikcorry's avatar
    Regexp: Optimize better in presence of lookaround. · 8df7c2a2
    erikcorry authored
    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}
    8df7c2a2
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
x87 Loading commit data...
OWNERS Loading commit data...
bytecodes-irregexp.h Loading commit data...
interpreter-irregexp.cc Loading commit data...
interpreter-irregexp.h Loading commit data...
jsregexp-inl.h Loading commit data...
jsregexp.cc Loading commit data...
jsregexp.h Loading commit data...
regexp-ast.cc Loading commit data...
regexp-ast.h Loading commit data...
regexp-macro-assembler-irregexp-inl.h Loading commit data...
regexp-macro-assembler-irregexp.cc Loading commit data...
regexp-macro-assembler-irregexp.h Loading commit data...
regexp-macro-assembler-tracer.cc Loading commit data...
regexp-macro-assembler-tracer.h Loading commit data...
regexp-macro-assembler.cc Loading commit data...
regexp-macro-assembler.h Loading commit data...
regexp-parser.cc Loading commit data...
regexp-parser.h Loading commit data...
regexp-stack.cc Loading commit data...
regexp-stack.h Loading commit data...
regexp-utils.cc Loading commit data...
regexp-utils.h Loading commit data...