• Patrick Thier's avatar
    [regexp] Bytecode peephole optimization · 66129430
    Patrick Thier authored
    Bytecodes used by the regular expression interpreter often occur in
    specific sequences. The number of dispatches in the interpreter can be
    reduced if those sequences are combined into a single bytecode.
    
    This CL adds a peephole optimization pass for regexp bytecodes.
    This pass checks the generated bytecode for pre-defined sequences that
    can be merged into a single bytecode.
    
    With the currently implemented bytecode sequences a speedup of 1.12x on
    regex-dna and octane-regexp is achieved.
    
    Bug: v8:9330
    Change-Id: I827f93273a5848e5963c7e3329daeb898995d151
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1813743
    Commit-Queue: Patrick Thier <pthier@google.com>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63992}
    66129430
regexp.cc 44.2 KB