• dslomov@chromium.org's avatar
    harmony_scoping: Implement lexical bindings at top level · 1a64b02d
    dslomov@chromium.org authored
    This implements correct semantics for "extensible" top level lexical scope.
    The entire lexical scope is represented at runtime by GlobalContextTable, reachable from native context and accumulating global contexts from every script loaded into the context.
    
    When the new script starts executing, it does the following validation:
    - checks the GlobalContextTable and global object (non-configurable own) properties against the set of declarations it introduces and reports potential conflicts.
    - invalidates the conflicting PropertyCells on global object, so that any code depending on them will miss/deopt causing any contextual lookups to be reexecuted under the new bindings
    - adds the lexical bindings it introduces to the GlobalContextTable
    
    Loads and stores for contextual lookups are modified so that they check the GlobalContextTable before looking up properties on global object, thus implementing the shadowing of global object properties by lexical declarations.
    
    R=adamk@chromium.org, rossberg@chromium.org
    
    Review URL: https://codereview.chromium.org/705663004
    
    Cr-Commit-Position: refs/heads/master@{#25220}
    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    1a64b02d
contexts.h 27.2 KB