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

Issue 2306413002: Fully deserialize the scope chain after parsing, not before (Closed)

Created:
4 years, 3 months ago by jochen (gone - plz use gerrit)
Modified:
4 years, 3 months ago
Reviewers:
adamk, Toon Verwaest, marja
CC:
Michael Starzinger, rmcilroy, v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fully deserialize the scope chain after parsing, not before To avoid a dependency on the heap during parsing, we only create a scope chain without linking to the associated ScopeInfo objects before parsing. This is enough to avoid special cases during parsing of arrow functions / eval. Looking at the outer scope's variables during parsing was only needed for hosting sloppy block functions inside eval. To be able to do this now, we hoist for the outer-most eval scope after parsing, in DeclarationScope::Analyze. DeclarationScope::Analyze is also where we replace the outer scope chain with the fully deserialized version, so variables can be resolved. Also, this unifies background and foreground thread parsing, as we don't have to worry about ScopeInfos getting accessed before we're back on the main thread. BUG=v8:5215 R=verwaest@chromium.org,marja@chromium.org,adamk@chromium.org Committed: https://crrev.com/94492437d9696f70f5a3ce0b3dc91026cc021abe Cr-Commit-Position: refs/heads/master@{#39452}

Patch Set 1 #

Patch Set 2 : updates #

Patch Set 3 : updates #

Patch Set 4 : updates #

Total comments: 18

Patch Set 5 : updates #

Patch Set 6 : updates #

Total comments: 14

Patch Set 7 : updates #

Patch Set 8 : new approach #

Patch Set 9 : cleanup #

Total comments: 4

Patch Set 10 : updates #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -131 lines) Patch
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -8 lines 0 comments Download
M src/ast/scopes.h View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -5 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 8 chunks +41 lines, -59 lines 0 comments Download
M src/background-parsing-task.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
M src/compiler-dispatcher/compiler-dispatcher-job.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -3 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -4 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 7 chunks +20 lines, -45 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 66 (41 generated)
jochen (gone - plz use gerrit)
ptal there's a new function InspectScopeChain that looks at the declaration scope and stores what ...
4 years, 3 months ago (2016-09-09 13:03:40 UTC) #12
adamk
High-level note: more of your message belongs in the CL description (particularly the stuff about ...
4 years, 3 months ago (2016-09-09 17:42:40 UTC) #15
jochen (gone - plz use gerrit)
done
4 years, 3 months ago (2016-09-09 18:04:33 UTC) #17
marja
Idk the right answer to "how to make Scope not create AST nodes" problems yet ...
4 years, 3 months ago (2016-09-12 07:50:33 UTC) #18
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2306413002/diff/60001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2306413002/diff/60001/src/ast/scopes.cc#newcode438 src/ast/scopes.cc:438: if (is_eval_scope() && !outer_scope()->outer_scope()) return; On 2016/09/12 at 07:50:32, ...
4 years, 3 months ago (2016-09-12 08:18:18 UTC) #19
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2306413002/diff/60001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2306413002/diff/60001/src/ast/scopes.cc#newcode526 src/ast/scopes.cc:526: // Create VariableProxies for creating an assignment statement On ...
4 years, 3 months ago (2016-09-12 08:29:46 UTC) #24
marja
lgtm Offline discussion: We don't see a non-ugly way to make Scope not create Statements ...
4 years, 3 months ago (2016-09-12 08:51:25 UTC) #25
jochen (gone - plz use gerrit)
On 2016/09/12 at 08:51:25, marja wrote: > lgtm > > Offline discussion: We don't see ...
4 years, 3 months ago (2016-09-12 08:56:07 UTC) #26
jochen (gone - plz use gerrit)
Adam, do you have further comments?
4 years, 3 months ago (2016-09-12 09:07:53 UTC) #27
adamk
I would like to take one more pass on this today (which is full of ...
4 years, 3 months ago (2016-09-12 16:17:17 UTC) #30
adamk
The CL description reads as a list of things this CL does, but it's hard ...
4 years, 3 months ago (2016-09-12 16:57:48 UTC) #31
jochen (gone - plz use gerrit)
yeah, so the main motivation is to not touch the heap during parsing. There are ...
4 years, 3 months ago (2016-09-12 19:00:43 UTC) #32
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2306413002/diff/100001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2306413002/diff/100001/src/ast/scopes.cc#newcode319 src/ast/scopes.cc:319: ReplaceOuterScope(Scope::DeserializeScopeChain( On 2016/09/12 at 19:00:43, jochen wrote: > On ...
4 years, 3 months ago (2016-09-12 19:02:08 UTC) #33
adamk
https://codereview.chromium.org/2306413002/diff/100001/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2306413002/diff/100001/src/parsing/parser-base.h#newcode878 src/parsing/parser-base.h:878: // If the receiver scope is the outermost script ...
4 years, 3 months ago (2016-09-12 21:35:11 UTC) #38
jochen (gone - plz use gerrit)
understood (however, I think the differences aren't that bad in practice, as this only matters ...
4 years, 3 months ago (2016-09-13 07:11:13 UTC) #39
adamk
On 2016/09/13 07:11:13, jochen wrote: > understood (however, I think the differences aren't that bad ...
4 years, 3 months ago (2016-09-13 17:23:10 UTC) #40
jochen (gone - plz use gerrit)
updated, ptal I'll rework the CL description and get another review from Marja if this ...
4 years, 3 months ago (2016-09-13 21:33:55 UTC) #43
jochen (gone - plz use gerrit)
cleaned up the patch a bit to minimize the diff, and updated CL description. ptal!
4 years, 3 months ago (2016-09-14 07:09:47 UTC) #49
marja
lgtm w/ comments https://codereview.chromium.org/2306413002/diff/160001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2306413002/diff/160001/src/ast/scopes.cc#newcode535 src/ast/scopes.cc:535: scope->ReplaceOuterScope(Scope::DeserializeScopeChain( (I was slightly surprised that ...
4 years, 3 months ago (2016-09-14 09:45:21 UTC) #52
marja
Description nit: "We don't have to look at the outer scope's variables during parsing with ...
4 years, 3 months ago (2016-09-14 10:09:42 UTC) #53
jochen (gone - plz use gerrit)
updated https://codereview.chromium.org/2306413002/diff/160001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2306413002/diff/160001/src/ast/scopes.cc#newcode535 src/ast/scopes.cc:535: scope->ReplaceOuterScope(Scope::DeserializeScopeChain( On 2016/09/14 at 09:45:21, marja wrote: > ...
4 years, 3 months ago (2016-09-14 11:27:30 UTC) #55
adamk
lgtm
4 years, 3 months ago (2016-09-15 15:51:02 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2306413002/180001
4 years, 3 months ago (2016-09-15 16:14:42 UTC) #63
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 3 months ago (2016-09-15 16:41:09 UTC) #64
commit-bot: I haz the power
4 years, 3 months ago (2016-09-15 16:41:34 UTC) #66
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/94492437d9696f70f5a3ce0b3dc91026cc021abe
Cr-Commit-Position: refs/heads/master@{#39452}

Powered by Google App Engine
This is Rietveld 408576698