• Hai Dang's avatar
    Add fast path for spreading keys/values of JSMap and JSSet. · fb29a554
    Hai Dang authored
    This CL extends IterableToListWithSymbolLookup with fast paths
    for spreading keys/values iterators of JSMap, and values iterator
    of JSSet (which is also the iterator of Set.prototype.keys() and
    Set.prototype[Symbol.iterator]()). The fast paths are only taken
    if the target still has original iteration behavior.
    
    For iterators it is also required that the iterator is not
    partially consumed. After spreading, to be spec-compliant, the
    iterator is exhausted. Tests are added.
    
    Bug: v8:7980
    Change-Id: Ida74e5ecbbc5ba5488d13a40f2c4bda14c781cbf
    Reviewed-on: https://chromium-review.googlesource.com/c/1276632Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
    Commit-Queue: Hai Dang <dhai@google.com>
    Cr-Commit-Position: refs/heads/master@{#56716}
    fb29a554
set-iterator-11.js 779 Bytes