• vogelheim's avatar
    Speed up parsing w/ grammar shortcut. · 7a100dff
    vogelheim authored
    Certain token combinations (e.g. number literal followed by semicolon) will
    result in a single AST node, but require many levels of recursive descent
    parsing to determine this (11 in this example). For some 'obvious'
    combinations, we'll simply generate the appropriate AST node fairly far up
    in the call tree.
    
    This yields a mild but consistent parser speedup. The main con is code duplication.
    
    [Speedup between 0..20ms in parse time among a set of 25 commonly used sites. Speedup of ~180ms for a site w/ a very large codebase (adwords.google.com). Minor slow-downs between 0..8ms for <20% of sites.]
    
    R=marja@chromium.org
    BUG=v8:4947
    
    Review-Url: https://codereview.chromium.org/2188153002
    Cr-Commit-Position: refs/heads/master@{#38591}
    7a100dff
parser-base.h 137 KB