Descriptionharmony_scoping: Implement lexical bindings at top level
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
Committed: https://code.google.com/p/v8/source/detail?r=25220
Patch Set 1 #
Total comments: 13
Patch Set 2 : Ready for review #
Total comments: 26
Patch Set 3 : CR feedback #
Total comments: 8
Patch Set 4 : CR comments #Patch Set 5 : +Comment update #
Total comments: 1
Patch Set 6 : Rebased patch for landing #
Messages
Total messages: 11 (0 generated)
|