• Simon Zünd's avatar
    Introduce REPL mode · fbcc2e87
    Simon Zünd authored
    Design doc: bit.ly/v8-repl-mode
    
    This CL adds a new REPL mode that can be used via
    DebugEvaluate::GlobalREPL. REPL mode only implements re-declaration
    of 'let' bindings at the moment. Example:
    
    REPL Input 1: let x = 21;
    REPL Input 2: let x = 42;
    
    This would normally throw a SyntaxError, but works in REPL mode.
    
    The implementation is done by:
      - Setting a 'repl mode' bit on {Script}, {ScopeInfo}, {ParseInfo}
        and script {Scope}.
      - Each global let declaration still gets a slot reserved in the
        respective {ScriptContext}.
      - When a new REPL mode {ScriptContext} is created, name clashes
        for let bindings are not reported as errors.
      - Declarations, loads and stores for global let in REPL mode are
        now "load/store global" instead of accessing their respective
        context slot directly. This causes a lookup in the ScriptContextTable
        where the found slot for each name is guaranteed to be the same
        (the first one).
    
    Bug: chromium:1004193, chromium:1018158
    Change-Id: Ia6ab526b9f696400dbb8bfb611a4d43606119a47
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1876061
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64793}
    fbcc2e87
Name
Last commit
Last update
..
OWNERS Loading commit data...
expression-scope-reparenter.cc Loading commit data...
expression-scope-reparenter.h Loading commit data...
expression-scope.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
keywords-gen.h Loading commit data...
keywords.txt Loading commit data...
literal-buffer.cc Loading commit data...
literal-buffer.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pending-compilation-error-handler.cc Loading commit data...
pending-compilation-error-handler.h Loading commit data...
preparse-data-impl.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparser-logger.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner-inl.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...