• Benedikt Meurer's avatar
    [es2015] Use [[ArrayIteratorNextIndex]] to indicate exhaustion. · 6031f172
    Benedikt Meurer authored
    Instead of changing the [[IteratedObject]] field to undefined to mark an
    array iterator as exhausted, store the appropriate maximum value into
    the [[ArrayIteratorNextIndex]] field such that the iterator will never
    produce any values again.
    
    Without this change the map check and the "length" access on the
    [[IteratedObject]] cannot be eliminated inside the loop, since the
    object can either be the array or undefined. Even with this change
    it's still not possible immediately due to missing aliasing
    information in the LoadElimination, but it paves the way for follow
    up improvements. Eventually the goal is to have `for..of` as fast as
    a traditional `for` loop even for really tight loops.
    
    This CL also hardens the implementation of the ArrayIterator by using
    proper CASTs and CSA_ASSERTs. The readability of the CSA builtin was
    improved by utilizing proper helper functions.
    
    Bug: v8:7510, v8:7514, v8:8070
    Change-Id: Ib46604fadad1a0f80e77fe71a1f47b0ca31ab841
    Reviewed-on: https://chromium-review.googlesource.com/1181902
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#55261}
    6031f172
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...