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

Issue 7837028: Let bound iteration variables in for-loops (Closed)

Created:
9 years, 3 months ago by Steven
Modified:
9 years, 2 months ago
CC:
v8-dev
Visibility:
Public.

Description

Let bound iteration variables in for-loops TEST=mjsunit/harmony/block-for.js Committed: http://code.google.com/p/v8/source/detail?r=9658

Patch Set 1 #

Patch Set 2 : Rebased. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+372 lines, -8 lines) Patch
M src/parser.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M src/parser.cc View 1 7 chunks +101 lines, -6 lines 2 comments Download
M src/preparser.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M src/preparser.cc View 1 4 chunks +10 lines, -2 lines 0 comments Download
A test/mjsunit/harmony/block-for.js View 1 1 chunk +138 lines, -0 lines 4 comments Download
M test/mjsunit/harmony/debug-blockscopes.js View 1 1 chunk +109 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Steven
PTAL.
9 years, 3 months ago (2011-09-07 13:45:47 UTC) #1
Steven
I rebased this on http://codereview.chromium.org/8306025/ to include all the recent changes. Could you please take ...
9 years, 2 months ago (2011-10-17 10:59:50 UTC) #2
Lasse Reichstein
LGTM http://codereview.chromium.org/7837028/diff/6017/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/7837028/diff/6017/src/parser.cc#newcode2437 src/parser.cc:2437: // TODO(keuchel): move temporary variable to block scope ...
9 years, 2 months ago (2011-10-17 11:49:40 UTC) #3
Steven
9 years, 2 months ago (2011-10-17 12:18:29 UTC) #4
http://codereview.chromium.org/7837028/diff/6017/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/7837028/diff/6017/src/parser.cc#newcode2437
src/parser.cc:2437: // TODO(keuchel): move temporary variable to block scope
This is an optimization. TEMPORARY variables are always stack allocated, so I
can only change this after I land my code for stack allocating block scoped
variables. Will adapt the comment for now.
On 2011/10/17 11:49:40, Lasse Reichstein wrote:
> What does this mean? Is the current code not correct, or is this just an
> optimization?
> (and remember '.' at end of sentences :).

http://codereview.chromium.org/7837028/diff/6017/test/mjsunit/harmony/block-f...
File test/mjsunit/harmony/block-for.js (right):

http://codereview.chromium.org/7837028/diff/6017/test/mjsunit/harmony/block-f...
test/mjsunit/harmony/block-for.js:36: assertEquals(0, props({}).length,
"olen0");
On 2011/10/17 11:49:40, Lasse Reichstein wrote:
> You can safely choose to omit the third parameter of the test without loss
since
> our test framework reports the line now.

Done.

http://codereview.chromium.org/7837028/diff/6017/test/mjsunit/harmony/block-f...
test/mjsunit/harmony/block-for.js:54: for (let i = 0x0020; i < 0x01ff; i+=2) {
On 2011/10/17 11:49:40, Lasse Reichstein wrote:
> Try declaring i and s prior to this loop, and see that their values haven't
> changed afterwards.

Done.

Powered by Google App Engine
This is Rietveld 408576698