Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Issue 705663004: harmony_scoping: Implement lexical bindings at top level (Closed)

Created:
6 years, 1 month ago by Dmitry Lomov (no reviews)
Modified:
6 years, 1 month ago
Reviewers:
adamk, rossberg
CC:
v8-dev, Paweł Hajdan Jr.
Project:
v8
Visibility:
Public.

Description

harmony_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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+428 lines, -64 lines) Patch
M include/v8.h View 1 chunk +1 line, -1 line 0 comments Download
M src/bootstrapper.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 3 chunks +54 lines, -1 line 0 comments Download
M src/contexts.cc View 1 2 3 6 chunks +115 lines, -54 lines 0 comments Download
M src/factory.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M src/heap/heap.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/ic/ic.cc View 1 2 chunks +34 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 3 chunks +5 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 1 chunk +19 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M src/runtime/runtime-scopes.cc View 1 3 chunks +51 lines, -1 line 0 comments Download
M test/cctest/test-decls.cc View 1 3 chunks +122 lines, -7 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Dmitry Lomov (no reviews)
FYI: this is work in progress, but shaping up. Let me know if you have ...
6 years, 1 month ago (2014-11-05 16:54:33 UTC) #1
rossberg
https://codereview.chromium.org/705663004/diff/1/src/contexts.cc File src/contexts.cc (right): https://codereview.chromium.org/705663004/diff/1/src/contexts.cc#newcode24 src/contexts.cc:24: FixedArray::CopySize(table, length + 1)); This should perhaps double the ...
6 years, 1 month ago (2014-11-06 12:29:12 UTC) #2
Dmitry Lomov (no reviews)
This is now ready for review. I believe this is semantically correct and does not ...
6 years, 1 month ago (2014-11-06 17:26:58 UTC) #3
adamk
Sorry for the delay (due to BlinkOn). Would you mind adding a more detailed CL ...
6 years, 1 month ago (2014-11-06 20:18:06 UTC) #4
Dmitry Lomov (no reviews)
Comments addressed, PTAL https://codereview.chromium.org/705663004/diff/20001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/705663004/diff/20001/src/bootstrapper.cc#newcode912 src/bootstrapper.cc:912: factory->NewGlobalContextTable(1, 0); On 2014/11/06 20:18:05, adamk ...
6 years, 1 month ago (2014-11-07 10:18:48 UTC) #5
rossberg
Nice, only nits remaining. https://codereview.chromium.org/705663004/diff/40001/src/contexts.cc File src/contexts.cc (right): https://codereview.chromium.org/705663004/diff/40001/src/contexts.cc#newcode18 src/contexts.cc:18: int size = table->size(); Nit: ...
6 years, 1 month ago (2014-11-07 13:22:38 UTC) #6
Dmitry Lomov (no reviews)
All nits addressed, PTAL https://codereview.chromium.org/705663004/diff/40001/src/contexts.cc File src/contexts.cc (right): https://codereview.chromium.org/705663004/diff/40001/src/contexts.cc#newcode18 src/contexts.cc:18: int size = table->size(); On ...
6 years, 1 month ago (2014-11-07 14:29:00 UTC) #7
rossberg
lgtm https://codereview.chromium.org/705663004/diff/80001/src/contexts.h File src/contexts.h (right): https://codereview.chromium.org/705663004/diff/80001/src/contexts.h#newcode193 src/contexts.h:193: // The table is a fixed array, its ...
6 years, 1 month ago (2014-11-07 14:36:10 UTC) #8
Dmitry Lomov (no reviews)
Thanks for review! Adam, could you take a look as well? On 2014/11/07 14:36:10, rossberg ...
6 years, 1 month ago (2014-11-07 14:41:59 UTC) #9
adamk
lgtm
6 years, 1 month ago (2014-11-07 16:04:03 UTC) #10
Dmitry Lomov (no reviews)
6 years, 1 month ago (2014-11-07 16:29:26 UTC) #11
Message was sent while issue was closed.
Committed patchset #6 (id:100001) manually as 25220 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698