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

Issue 1784893003: ParameterInitializerRewriter must maintain temporary variable order (Closed)

Created:
4 years, 9 months ago by adamk
Modified:
4 years, 7 months ago
Reviewers:
nickie
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

ParameterInitializerRewriter must maintain temporary variable order When the rewriter moves a temporary variable between scopes, it must be sure to maintain the order, so that the rewritten order is the same as it would have been without rewriting. To expose the difference in behavior, this patch removes the superfluous visitation of ForOfStatement::each() from AstExpressionVisitor, which happened to be the only thing keeping all the temporaries in order in mjsunit/harmony/regress/regress-crbug-578038.js. Without the proper order, this test would fail under --stress-opt, because the ".for" variable (behind the "each" proxy) would get two different positions in the scope, one on first parse (with rewriting) and the other on second parse (lazy parsing for optimization). A follow-up patch will remove each() and iterable() from ForOfStatement altogether, but I wanted to keep this patch small to highlight exactly the bit of code needed to make the test pass when not visiting each(). BUG=v8:4791 LOG=n Committed: https://crrev.com/2d090ee46ad88272653873eec8b1bd465ce37b50 Cr-Commit-Position: refs/heads/master@{#36150}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased #

Patch Set 3 : Leave nulls in temps_, indices are now unique #

Total comments: 4

Patch Set 4 : Nikolaos comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -13 lines) Patch
M src/ast/ast-expression-visitor.cc View 1 chunk +0 lines, -1 line 0 comments Download
M src/ast/scopes.h View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 chunks +17 lines, -7 lines 0 comments Download
M src/parsing/parameter-initializer-rewriter.cc View 1 4 chunks +26 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
adamk
4 years, 9 months ago (2016-03-10 21:51:49 UTC) #3
nickie
On 2016/03/10 21:51:49, adamk wrote: LGTM. As a (possibly sci-fi) comment, if we have an ...
4 years, 9 months ago (2016-03-11 10:24:06 UTC) #4
nickie
Sorry, I forgot to publish this with the previous LGTM. https://codereview.chromium.org/1784893003/diff/1/src/parsing/parameter-initializer-rewriter.cc File src/parsing/parameter-initializer-rewriter.cc (right): https://codereview.chromium.org/1784893003/diff/1/src/parsing/parameter-initializer-rewriter.cc#newcode52 ...
4 years, 9 months ago (2016-03-11 10:48:44 UTC) #5
adamk
Looking at this code again, I realized it's not actually guaranteed to work, since the ...
4 years, 9 months ago (2016-03-11 21:19:40 UTC) #6
adamk
Uniqueness of indices is now handled (by nulling-out removed items instead of shrinking the List). ...
4 years, 7 months ago (2016-05-09 23:14:59 UTC) #7
nickie
lgtm https://codereview.chromium.org/1784893003/diff/40001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/1784893003/diff/40001/src/ast/scopes.cc#newcode989 src/ast/scopes.cc:989: if (temps_.length() > 0) { If you have ...
4 years, 7 months ago (2016-05-10 13:47:08 UTC) #8
adamk
Thanks for the quick turnaround. Not sure why I didn't take this approach two months ...
4 years, 7 months ago (2016-05-10 17:36:11 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1784893003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1784893003/60001
4 years, 7 months ago (2016-05-10 17:36:32 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 7 months ago (2016-05-10 18:09:38 UTC) #14
commit-bot: I haz the power
4 years, 7 months ago (2016-05-10 18:10:31 UTC) #16
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/2d090ee46ad88272653873eec8b1bd465ce37b50
Cr-Commit-Position: refs/heads/master@{#36150}

Powered by Google App Engine
This is Rietveld 408576698