• Toon Verwaest's avatar
    [parser] Replacing ExpressionClassifier with ExpressionScope that knows what it's tracking · d1b4e31b
    Toon Verwaest authored
    Since it's explicit what we're tracking, we can immediately throw errors in
    certain cases, and ignore irrelevant errors. We don't need to use the
    classifier itself to track "let let", since we know whether we're parsing a
    "let". Errors that were previously (almost) always accumulated are now
    immediately pushed to the scopes that care (parameter initialization errors).
    
    This CL drops avoiding allocation of classified errors, at least for now, but
    that doesn't affect performance anymore since we don't aggressively blacklist
    anymore. Classified errors are even less likely with the more precise approach.
    
    ParseAssignmentExpression doesn't introduce its own scope immediately, but
    reuses the outer scope.
    
    Rather than using full ExpressionClassifiers + Accumulate to separate
    expressions/patterns from each other while keeping track of the overall error
    state, this now uses an explicit AccumulationScope.
    
    When we parse (async) arrow functions we introduce new scopes
    that track that they may be (async) arrow functions.
    
    We track StrictModeFormal parameters in 2 different ways if it isn't
    immediately certain that it is a strict-mode formal error: Either directly on
    the (Pre)ParserFormalParameters, or on the NextArrowFunctionInfo in the case
    we're not yet certain that we'll have an arrow function. In the latter case we
    don't have a FormalParameter object yet, and we'll copy it over once we know
    we're parsing an arrow function. The latter works because it's not allowed to
    change strictness of a function with non-simple parameters.
    
    Design doc:
    https://docs.google.com/document/d/1FAvEp9EUK-G8kHfDIEo_385Hs2SUBCYbJ5H-NnLvq8M/
    
    Change-Id: If4ecd717c9780095c7ddc859c8945b3d7d268a9d
    Reviewed-on: https://chromium-review.googlesource.com/c/1367809
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#58307}
    d1b4e31b
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...
.clang-tidy 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...