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

Issue 1060913005: [strong] Stricter check for referring to other classes inside methods. (Closed)

Created:
5 years, 8 months ago by marja
Modified:
5 years, 8 months ago
Reviewers:
rossberg
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[strong] Stricter check for referring to other classes inside methods. Add the restriction that both classes must be declared inside the same consectutive class declaration batch. Dependency analysis not implemented yet. BUG=v8:3956 LOG=N Committed: https://crrev.com/ddd3f318c7f3f04ceb151430bdd67cf634224aab Cr-Commit-Position: refs/heads/master@{#28032}

Patch Set 1 #

Patch Set 2 : rebased #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Total comments: 17

Patch Set 7 : rebased #

Patch Set 8 : Alternative solution: scopes #

Patch Set 9 : (tiny cleanup for the Scope based solution) #

Patch Set 10 : Code review (rossberg@) + fixes #

Patch Set 11 : . #

Total comments: 8

Patch Set 12 : rebased #

Patch Set 13 : Code review (rossberg) #

Total comments: 6

Patch Set 14 : Code review (rossberg) #

Total comments: 2

Patch Set 15 : code review (rossberg@) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+362 lines, -68 lines) Patch
M src/ast.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +15 lines, -5 lines 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +34 lines, -5 lines 0 comments Download
M src/scopes.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +18 lines, -3 lines 0 comments Download
M src/scopes.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +83 lines, -30 lines 0 comments Download
M src/variables.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +35 lines, -0 lines 0 comments Download
M test/mjsunit/strong/mutually-recursive-classes.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +177 lines, -25 lines 0 comments Download

Messages

Total messages: 31 (3 generated)
marja
Here's the next step. rossberg@, ptal. The "class inside a computed property name" case is ...
5 years, 8 months ago (2015-04-20 08:32:45 UTC) #2
marja
Hmm, another possibility would be to put the "batch start position" thing to Scope instead ...
5 years, 8 months ago (2015-04-20 09:41:18 UTC) #3
marja
Alright, I uploaded an alternative Scope-based (instead of FunctionState-based) solution, patch set 8. I think ...
5 years, 8 months ago (2015-04-20 11:13:18 UTC) #4
rossberg
There may be a kind of off-by-one-declaration bug in there, if I understand the code ...
5 years, 8 months ago (2015-04-20 11:15:26 UTC) #5
rossberg
On 2015/04/20 11:13:18, marja wrote: > Alright, I uploaded an alternative Scope-based (instead of FunctionState-based) ...
5 years, 8 months ago (2015-04-20 11:18:01 UTC) #6
marja
omg, turns out the counterexample let A = class { m(){B} } class B {} ...
5 years, 8 months ago (2015-04-20 12:37:30 UTC) #7
rossberg
On 2015/04/20 12:37:30, marja wrote: > omg, turns out the counterexample > > let A ...
5 years, 8 months ago (2015-04-20 13:52:45 UTC) #8
marja
Yup, I'm still unsure whether the inability to find a class variable in the following ...
5 years, 8 months ago (2015-04-20 13:59:46 UTC) #9
rossberg
On 2015/04/20 13:59:46, marja wrote: > I don't think this should work though: > > ...
5 years, 8 months ago (2015-04-20 14:13:26 UTC) #10
marja
Oh my, this is exponentially more complicated than I thought. Then this should be forbidden: ...
5 years, 8 months ago (2015-04-20 14:21:13 UTC) #11
rossberg
On 2015/04/20 14:21:13, marja wrote: > Oh my, this is exponentially more complicated than I ...
5 years, 8 months ago (2015-04-20 14:33:15 UTC) #12
marja
> > but the cycle detection logic I proposed earlier doesn't cover it. > > ...
5 years, 8 months ago (2015-04-20 14:35:46 UTC) #13
marja
On 2015/04/20 14:35:46, marja wrote: > > > but the cycle detection logic I proposed ...
5 years, 8 months ago (2015-04-20 14:36:31 UTC) #14
marja
Alright, I tried to fix all the cases you pointed out. ptal. I'm adding extra ...
5 years, 8 months ago (2015-04-20 15:58:23 UTC) #15
marja
Alright, I tried to fix all the cases you pointed out. ptal. I'm adding extra ...
5 years, 8 months ago (2015-04-20 15:58:28 UTC) #16
rossberg
https://codereview.chromium.org/1060913005/diff/190001/src/ast.h File src/ast.h (right): https://codereview.chromium.org/1060913005/diff/190001/src/ast.h#newcode577 src/ast.h:577: int consecutive_declaration_group_start() const { Nit: also drop the "consecutive" ...
5 years, 8 months ago (2015-04-21 13:30:02 UTC) #17
rossberg
PS: Might also try to store the link to the outer var in class scopes. ...
5 years, 8 months ago (2015-04-21 13:33:28 UTC) #18
marja
Alright, here's a new try. As mentioned (offline?), it's a bug (also in bleeding_edge) that ...
5 years, 8 months ago (2015-04-23 09:52:37 UTC) #19
rossberg
https://codereview.chromium.org/1060913005/diff/90001/test/mjsunit/strong/mutually-recursive-classes.js File test/mjsunit/strong/mutually-recursive-classes.js (right): https://codereview.chromium.org/1060913005/diff/90001/test/mjsunit/strong/mutually-recursive-classes.js#newcode151 test/mjsunit/strong/mutually-recursive-classes.js:151: // Note that this is also an error: On ...
5 years, 8 months ago (2015-04-23 12:20:54 UTC) #20
rossberg
On 2015/04/23 09:52:37, marja wrote: > As mentioned (offline?), it's a bug (also in bleeding_edge) ...
5 years, 8 months ago (2015-04-23 12:24:59 UTC) #21
marja
Afaics, we need to store the initializer positions for all variables, since we can e.g., ...
5 years, 8 months ago (2015-04-23 12:38:25 UTC) #22
rossberg
On 2015/04/23 12:38:25, marja wrote: > Afaics, we need to store the initializer positions for ...
5 years, 8 months ago (2015-04-23 12:58:37 UTC) #23
marja
https://codereview.chromium.org/1060913005/diff/230001/src/scopes.cc File src/scopes.cc (right): https://codereview.chromium.org/1060913005/diff/230001/src/scopes.cc#newcode1207 src/scopes.cc:1207: if (class_var->class_declaration_group_start() == On 2015/04/23 12:20:53, rossberg wrote: > ...
5 years, 8 months ago (2015-04-23 13:12:43 UTC) #24
rossberg
lgtm https://codereview.chromium.org/1060913005/diff/250001/src/scopes.cc File src/scopes.cc (right): https://codereview.chromium.org/1060913005/diff/250001/src/scopes.cc#newcode1191 src/scopes.cc:1191: class_var = class_var->corresponding_outer_class_variable(); Nit: you could switch the ...
5 years, 8 months ago (2015-04-23 13:17:21 UTC) #25
marja
thanks for review! https://codereview.chromium.org/1060913005/diff/250001/src/scopes.cc File src/scopes.cc (right): https://codereview.chromium.org/1060913005/diff/250001/src/scopes.cc#newcode1191 src/scopes.cc:1191: class_var = class_var->corresponding_outer_class_variable(); On 2015/04/23 13:17:20, ...
5 years, 8 months ago (2015-04-23 13:40:23 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1060913005/270001
5 years, 8 months ago (2015-04-23 13:40:36 UTC) #29
commit-bot: I haz the power
Committed patchset #15 (id:270001)
5 years, 8 months ago (2015-04-23 14:05:09 UTC) #30
commit-bot: I haz the power
5 years, 8 months ago (2015-04-23 14:05:26 UTC) #31
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/ddd3f318c7f3f04ceb151430bdd67cf634224aab
Cr-Commit-Position: refs/heads/master@{#28032}

Powered by Google App Engine
This is Rietveld 408576698