• littledan's avatar
    Add ES2015 RegExp full subclassing semantics behind a flag · 92a571e5
    littledan authored
    This patch implements ES2015 RegExp subclassing semantics, namely the
    hardest part where RegExp.prototype.exec and certain flag getters can
    be overridden in order to provide different behavior. This change is
    hidden behind a new flag, --harmony-regexp-exec. The flag guards the
    behavior by installing entirely different implementations of the
    methods which follow the new semantics.
    
    Preliminary performance tests show a 3-4x regression in the Octane
    RegExp benchmark. The new code doesn't call out into several fast
    paths that the old code supported, so this is expected.
    
    The patch is tested mostly by test262, where most RegExp tests are fixed,
    with the exception of deliberate spec violations for web compatibility,
    and for the 'sticky' flag, which is not dynamically read by this patch
    in all cases but rather statically compiled into the RegExp. The latter
    will require a follow-on patch to implement. A small additional set of
    tests verifies one particular case, mostly to check whether the flag
    mechanism works.
    
    R=adamk,yangguo@chromium.org
    LOG=Y
    BUG=v8:4602
    
    Review URL: https://codereview.chromium.org/1596483005
    
    Cr-Commit-Position: refs/heads/master@{#35068}
    92a571e5
regexp-string-methods.js 2.5 KB