• Marja Hölttä's avatar
    [parser] Skipping inner funcs: implement a bailout. · e7a46253
    Marja Hölttä authored
    In some cases, PreParser cannot replicate the Scope structure created by
    Parser. It happens esp. with arrow function parameters, since the relevant
    information is already lost by the time we figure out it's an arrow function.
    
    In these cases, PreParser should bail out of trying to create data for skipping
    inner functions.
    
    Implementation notes:
    
    - The arrow function case is more fundamental; the non-arrow case could be
      hacked together somehow if we implemented tracking is_simple for each param
      separately; but now that it's possible to bail out consistently from both
      cases, I don't think the is_simple complication is worth it.
    
    - The added mjsunit test cases are based on the test262 test cases which exposed
      the problem.
    
    - cctest/preparser/PreParserScopeAnalysis was exercising similar cases, but the
      problem didn't show up because the function parameters didn't contain
      skippable functions. Those test cases have been repurposed for testing the
      bailout.
    
    - Extra precaution: the bailout tests are in a separate file, to guard from the
      bug that a bailout case results in bailing out of *all* data creation, which
      would make all skipping tests in the same file useless.
    
    BUG=v8:5516
    
    Change-Id: I4324749a5ec602fa5d7dc27647ade0284a6842fe
    Reviewed-on: https://chromium-review.googlesource.com/599849Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Commit-Queue: Marja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#47170}
    e7a46253
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles 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...
.gitignore Loading commit data...
.gn 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...
Makefile Loading commit data...
Makefile.android 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...