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

Issue 2352593002: Preparse inner functions (new try) (Closed)

Created:
4 years, 3 months ago by marja
Modified:
4 years, 2 months ago
Reviewers:
Toon Verwaest, adamk
CC:
v8-reviews_googlegroups.com, Michael Hablich
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Preparse inner functions (new try) This is an overly pessimistic approach where PreParser only keeps track of unresolved variables, but doesn't declare anything. This will result in context-allocating variables in the outer function unnecessarily, if the variable names clash with variable names used by the inner function (even if the variables are not the same). However, we have been unable to prove that this approach wouldn't be good enough for the practical purposes. Fixes after the previous try ( https://codereview.chromium.org/2322243002/ ): Keep the context-allocation decision stable when compiling fully eagerly. Tests which exercise this functionality: mjsunit/fixed-context-shapes-when-recompiling.js Design document (chromium): https://docs.google.com/a/chromium.org/document/d/1rRv5JJZ0JpOZAZN2CSUwZPFJiBAdRnTiSYhazseNHFg/edit?usp=sharing BUG= Committed: https://crrev.com/7c73cf32c60484cdf37c84f1d61b4640e87068d7 Cr-Commit-Position: refs/heads/master@{#39719}

Patch Set 1 #

Patch Set 2 : rebased #

Patch Set 3 : . #

Patch Set 4 : first draft, not working... #

Patch Set 5 : fixing, doesn't work #

Patch Set 6 : fixes - now cctests run #

Patch Set 7 : moar #

Patch Set 8 : rebased #

Patch Set 9 : the real fix #

Patch Set 10 : add test #

Patch Set 11 : updated a test which asserts the exact context shape #

Patch Set 12 : more test upates #

Patch Set 13 : style & cleanup #

Total comments: 14

Patch Set 14 : comments #

Patch Set 15 : rebased #

Patch Set 16 : rebased again #

Total comments: 1

Patch Set 17 : code review (verwaest@, adamk@) #

Patch Set 18 : fixed rebase #

Patch Set 19 : moar refactoring #

Patch Set 20 : mindiff #

Patch Set 21 : add comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -99 lines) Patch
M src/ast/scopes.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -2 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +40 lines, -10 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +6 lines, -2 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 chunks +85 lines, -41 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -3 lines 0 comments Download
M src/parsing/preparser.h View 1 2 3 4 5 6 7 6 chunks +15 lines, -13 lines 0 comments Download
M src/parsing/preparser.cc View 1 2 3 4 5 6 7 4 chunks +46 lines, -16 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +9 lines, -1 line 0 comments Download
M test/mjsunit/debug-function-scopes.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M test/mjsunit/debug-scopes.js View 1 2 3 4 5 6 7 8 9 10 2 chunks +10 lines, -10 lines 0 comments Download
A test/mjsunit/lazy-inner-functions.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (33 generated)
marja
verwaest@, adamk@: ptal A new, fixed version, and now there's a design doc, too :) ...
4 years, 3 months ago (2016-09-23 10:32:56 UTC) #15
Toon Verwaest
https://codereview.chromium.org/2352593002/diff/240001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2352593002/diff/240001/src/ast/scopes.cc#newcode1595 src/ast/scopes.cc:1595: if (try_to_resolve) { Can't you just move !FLAG_lazy_inner_functions here? ...
4 years, 3 months ago (2016-09-23 11:51:18 UTC) #16
marja
Thanks for comments & discussions I'm still working on the rest of the comments, but ...
4 years, 3 months ago (2016-09-23 14:26:52 UTC) #19
adamk
The only big comment I would've made is on the same section that Toon is ...
4 years, 3 months ago (2016-09-23 18:21:30 UTC) #20
marja
thanks for comments! https://codereview.chromium.org/2352593002/diff/240001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2352593002/diff/240001/src/ast/scopes.cc#newcode1532 src/ast/scopes.cc:1532: !var->has_forced_context_allocation() && !var->is_arguments()) { On 2016/09/23 ...
4 years, 2 months ago (2016-09-26 07:14:41 UTC) #25
Toon Verwaest
lgtm. There's still a lot of cleanup to be done after this, but let's do ...
4 years, 2 months ago (2016-09-26 11:58:54 UTC) #35
marja
Thanks for review! (As discussed w/ adamk@, I'm landing this now that verwaest@ has reviewed.)
4 years, 2 months ago (2016-09-26 12:00:42 UTC) #36
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/2352593002/420001
4 years, 2 months ago (2016-09-26 12:00:59 UTC) #39
commit-bot: I haz the power
Committed patchset #21 (id:420001)
4 years, 2 months ago (2016-09-26 12:36:21 UTC) #41
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/7c73cf32c60484cdf37c84f1d61b4640e87068d7 Cr-Commit-Position: refs/heads/master@{#39719}
4 years, 2 months ago (2016-09-26 12:36:41 UTC) #43
Michael Hablich
4 years, 2 months ago (2016-09-26 13:53:38 UTC) #44
Message was sent while issue was closed.
A revert of this CL (patchset #21 id:420001) has been created in
https://codereview.chromium.org/2373443003/ by hablich@chromium.org.

The reason for reverting is: We currently have some stability issues on Canary.
Let's reland this after we verified that we "fixed" Canary again..

Powered by Google App Engine
This is Rietveld 408576698