• Leszek Swirski's avatar
    [parser] Fix reindexing of functions inside classes · 1e37ca26
    Leszek Swirski authored
    A class's fields can appear twice in the class AST, via the properties
    array and the synthetised initializer method. This means that the
    reindexer can end up visiting the same function literal twice, since the
    T in AST is no longer a T but rather a DAG.
    
    Now, we special case the class visitor in the reindexer to avoid these
    double visits where appropriate. We know what kinds of fields can be
    double visisted, so we don't need a visited set, but we now also have
    one for debug builds to verify that each function is visited exactly
    once.
    
    Bug: chromium:974627
    Change-Id: Ib531becc6e3f3c73f420b5fb49790fe4a2022d65
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667003Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#62282}
    1e37ca26
ast-function-literal-id-reindexer.h 1.38 KB