• 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
..
fail Loading commit data...
mjsunit Loading commit data...
regress/fail Loading commit data...
BUILD.gn Loading commit data...
README.md Loading commit data...
asm-assignment-undeclared.js Loading commit data...
asm-assignment-undeclared.out Loading commit data...
asm-function-mismatch-def.js Loading commit data...
asm-function-mismatch-def.out Loading commit data...
asm-function-mismatch-use.js Loading commit data...
asm-function-mismatch-use.out Loading commit data...
asm-function-redefined.js Loading commit data...
asm-function-redefined.out Loading commit data...
asm-function-undefined.js Loading commit data...
asm-function-undefined.out Loading commit data...
asm-function-variable-collision.js Loading commit data...
asm-function-variable-collision.out Loading commit data...
asm-import-wrong-annotation.js Loading commit data...
asm-import-wrong-annotation.out Loading commit data...
asm-import-wrong-object.js Loading commit data...
asm-import-wrong-object.out Loading commit data...
asm-linking-bogus-heap.js Loading commit data...
asm-linking-bogus-heap.out Loading commit data...
asm-linking-bogus-stdlib.js Loading commit data...
asm-linking-bogus-stdlib.out Loading commit data...
asm-linking-missing-heap.js Loading commit data...
asm-linking-missing-heap.out Loading commit data...
asm-missing-parameter-annotation.js Loading commit data...
asm-missing-parameter-annotation.out Loading commit data...
asm-missing-return-annotation.js Loading commit data...
asm-missing-return-annotation.out Loading commit data...
asm-table-mismatch-def.js Loading commit data...
asm-table-mismatch-def.out Loading commit data...
asm-table-mismatch-use.js Loading commit data...
asm-table-mismatch-use.out Loading commit data...
asm-table-redefined.js Loading commit data...
asm-table-redefined.out Loading commit data...
asm-table-undefined.js Loading commit data...
asm-table-undefined.out Loading commit data...
asm-table-variable-collision.js Loading commit data...
asm-table-variable-collision.out Loading commit data...
message.status Loading commit data...
non-use-strict-hex-escape.js Loading commit data...
non-use-strict-hex-escape.out Loading commit data...
non-use-strict-octal-escape.js Loading commit data...
non-use-strict-octal-escape.out Loading commit data...
non-use-strict-uhex-escape.js Loading commit data...
non-use-strict-uhex-escape.out Loading commit data...
nonstrict-arguments.js Loading commit data...
nonstrict-arguments.out Loading commit data...
nonstrict-eval.js Loading commit data...
nonstrict-eval.out Loading commit data...
nonstrict-with.js Loading commit data...
nonstrict-with.out Loading commit data...
object-binding-pattern-await-computed-name.js Loading commit data...
object-binding-pattern-await-computed-name.out Loading commit data...
strict-octal-indirect-regexp.js Loading commit data...
strict-octal-indirect-regexp.out Loading commit data...
strict-octal-regexp.js Loading commit data...
strict-octal-regexp.out Loading commit data...
testcfg.py Loading commit data...
try-catch-finally-no-message.js Loading commit data...
try-catch-finally-no-message.out Loading commit data...
try-catch-finally-return-in-finally.js Loading commit data...
try-catch-finally-return-in-finally.out Loading commit data...
try-finally-return-in-finally.js Loading commit data...
try-finally-return-in-finally.out Loading commit data...
wasm-finish-compilation.js Loading commit data...
wasm-finish-compilation.out Loading commit data...
wasm-function-name-async.js Loading commit data...
wasm-function-name-async.out Loading commit data...
wasm-function-name-streaming.js Loading commit data...
wasm-function-name-streaming.out Loading commit data...
wasm-module-and-function-name-async.js Loading commit data...
wasm-module-and-function-name-async.out Loading commit data...
wasm-module-and-function-name-streaming.js Loading commit data...
wasm-module-and-function-name-streaming.out Loading commit data...
wasm-module-name-async.js Loading commit data...
wasm-module-name-async.out Loading commit data...
wasm-module-name-streaming.js Loading commit data...
wasm-module-name-streaming.out Loading commit data...
wasm-no-name-async.js Loading commit data...
wasm-no-name-async.out Loading commit data...
wasm-no-name-streaming.js Loading commit data...
wasm-no-name-streaming.out Loading commit data...
wasm-trace-memory-interpreted.js Loading commit data...
wasm-trace-memory-interpreted.out Loading commit data...
wasm-trace-memory-liftoff.js Loading commit data...
wasm-trace-memory-liftoff.out Loading commit data...
wasm-trace-memory.js Loading commit data...
wasm-trace-memory.out Loading commit data...