• adamk's avatar
    More accurately record an end position for default parameters in arrows · e96cbdcd
    adamk authored
    Our previous over-conservative answer caused us to emit hole checks in
    full-codegen when eagerly parsing but not when lazily parsing.
    
    With this patch, we use the positions of the BinaryOperations making up
    the parameter list (which are the positions of the commas) to determine
    the appropriate "end position" for each parameter's initializer. This means
    that we get accurate-enough positions for the initializers in the eager
    parsing step to get the same answers for hole-check-elimination that we
    will later during ParseLazy.
    
    In the included test case, for example:
    
      (function() { ((s = 17, y = s) => s)(); } )();
                            ^2     ^1
    
    The old code would generate a hole check when trying to load
    |s| for assignment to |y| (because it treated the closing parentheses
    pointed to by "^1" as the "initialization position" of |s|).
    
    The new code uses the comma pointed to by "^2" as the initialization
    position of |s|. Since that occurs textually before the load of |s|,
    full-codegen knows it can avoid the hole check.
    
    BUG=v8:4908
    LOG=n
    
    Review URL: https://codereview.chromium.org/1900343002
    
    Cr-Commit-Position: refs/heads/master@{#35678}
    e96cbdcd
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs 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/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore 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.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl 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...