• Jakob Gruber's avatar
    [regexp] Restructure fast path check logic · c6b1ef0e
    Jakob Gruber authored
    Prior to this CL, the regexp fast path check is stricter than it
    needs to be. For example, adding any arbitrary property on the regexp
    prototype would move the execution of all regexp builtins in the same
    context onto the slow path. This actually happens in the real world:
    popular web frameworks commonly monkey-patch builtin prototypes to add
    functionality.
    
    The intent of this CL is to widen the fast path for regexp builtins s.t.
    modifications of the prototype that do not conflict with our
    requirements stay on the fast path.
    
    This is done by extending the current fast path check with an
    additional step. If checking the prototype map identity or
    relevant prototype property constness fails, we now compare the actual
    value of all relevant properties against the expected value. If these
    match, the prototype can be considered fast.
    
    The new step as described in the previous paragraph is part of the
    permissive fast path check (BranchIfFastRegExp_Permissive). The strict
    variant (BranchIfFastRegExp_Strict) is also still required by a few
    spots. We should refactor these to also allow the permissive check in
    follow-up work.
    
    Bug: v8:5577,chromium:977382
    Change-Id: I69b2244e68ccfbd00edf17fc326aa4b5f5d089fa
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1706056
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#62948}
    c6b1ef0e
builtins-string-gen.h 6.07 KB