|
|
Chromium Code Reviews|
Created:
5 years, 1 month ago by caitp (gmail) Modified:
5 years, 1 month ago 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[es6] allow any LeftHandSideExpression in for-of loops
Fix an earlier regression which forbid non-VariableProxy LHS from being
used in for-of loops. Like for-in loops, the spec allows any LHS to be used,
with the sole exception that ObjectLiterals and ArrayLiterals must be valid
AssignmentPatterns.
Also fixes a bug in TurboFan which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value.
BUG=v8:4418, v8:2720
LOG=N
R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org, bmeurer@chromium.org
Committed: https://crrev.com/096125deaafe50c2c82cbf795dd9eee5264cbbf7
Cr-Commit-Position: refs/heads/master@{#31816}
Patch Set 1 #Patch Set 2 : Remove unneeded var from test (also rebased, woops) #Patch Set 3 : Fix bug in loop-assignment-analyzer which resulted in incorrect code #
Messages
Total messages: 32 (13 generated)
Quick fix for v8:4418 --- the for-loop parsing uses ParseExpression() rather than ParseLeftHandSideExpression() to parse the LHS, in order to accommodate C-style for-loop parsing. However, all of the obvious cases that could be caused by that seem to be reported as SyntaxErrors already (reporting comma-separated Expressions and assignments as invalid LHSes).
On 2015/11/04 18:58:50, caitp wrote: > Quick fix for v8:4418 --- the for-loop parsing uses ParseExpression() rather > than ParseLeftHandSideExpression() to parse the LHS, in order to accommodate > C-style for-loop parsing. However, all of the obvious cases that could be caused > by that seem to be reported as SyntaxErrors already (reporting comma-separated > Expressions and assignments as invalid LHSes). oops, wingo@chromium.org? my bad. Fixing that :>
Description was changed from ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. BUG=v8:4418, v8:2720 LOG=N R=wingo@chromium.org, littledan@chromium.org, adamk@chromium.org ========== to ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org ==========
caitpotter88@gmail.com changed reviewers: + wingo@igalia.com - wingo@chromium.org
The CQ bit was checked by adamk@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411873004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411873004/1
lgtm if tests pass
On 2015/11/04 19:32:33, adamk wrote: > lgtm if tests pass I guess there are failures, looking...
On 2015/11/04 19:42:41, caitp wrote: > On 2015/11/04 19:32:33, adamk wrote: > > lgtm if tests pass > > I guess there are failures, looking... The tests are good, this seems to be a bug in the compilers (affecting both crankshaft and TF)
On 2015/11/04 19:55:04, caitp wrote: > On 2015/11/04 19:42:41, caitp wrote: > > On 2015/11/04 19:32:33, adamk wrote: > > > lgtm if tests pass > > > > I guess there are failures, looking... > > The tests are good, this seems to be a bug in the compilers (affecting both > crankshaft and TF) I suspect the compiler issue is, the ALAA fails to record the assignment to the `each` variable, because this code isn't actually in the AST. Probably an easy fix, though
On 2015/11/04 20:53:00, caitp wrote: > On 2015/11/04 19:55:04, caitp wrote: > > On 2015/11/04 19:42:41, caitp wrote: > > > On 2015/11/04 19:32:33, adamk wrote: > > > > lgtm if tests pass > > > > > > I guess there are failures, looking... > > > > The tests are good, this seems to be a bug in the compilers (affecting both > > crankshaft and TF) > > I suspect the compiler issue is, the ALAA fails to record the assignment to the > `each` variable, because this code isn't actually in the AST. Probably an easy > fix, though yup, bingo. Sending a fix...
The CQ bit was checked by caitpotter88@gmail.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411873004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411873004/40001
Description was changed from ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org ========== to ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. Also fixes a bug in TurboFan and Crankshaft which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by caitpotter88@gmail.com
The patchset sent to the CQ was uploaded after l-g-t-m from adamk@chromium.org Link to the patchset: https://codereview.chromium.org/1411873004/#ps40001 (title: "Fix bug in loop-assignment-analyzer which resulted in incorrect code")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411873004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411873004/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/7439)
Description was changed from ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. Also fixes a bug in TurboFan and Crankshaft which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org ========== to ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. Also fixes a bug in TurboFan and Crankshaft which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org, bmeurer@chromium.org ==========
caitpotter88@gmail.com changed reviewers: + bmeurer@chromium.org
Oops, yeah. Can someone from src/compilers please check the ALAA change?
Is the mention of Crankshaft correct in the CL description? I'd think this should only affect TurboFan.
On 2015/11/04 21:40:59, adamk wrote: > Is the mention of Crankshaft correct in the CL description? I'd think this > should only affect TurboFan. Yeah, I guess crankshaft has a bailout on VisitForOfStatement, fixing.
Description was changed from ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. Also fixes a bug in TurboFan and Crankshaft which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org, bmeurer@chromium.org ========== to ========== [es6] allow any LeftHandSideExpression in for-of loops Fix an earlier regression which forbid non-VariableProxy LHS from being used in for-of loops. Like for-in loops, the spec allows any LHS to be used, with the sole exception that ObjectLiterals and ArrayLiterals must be valid AssignmentPatterns. Also fixes a bug in TurboFan which resulted in incorrectly replacing a variable load with a constant value in some instances, due to the AstLoopAssignmentAnalyzer failing to record the assignment to ForOfStatement's value. BUG=v8:4418, v8:2720 LOG=N R=wingo@igalia.com, littledan@chromium.org, adamk@chromium.org, bmeurer@chromium.org ==========
LGTM on compiler.
The CQ bit was checked by bmeurer@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1411873004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1411873004/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/096125deaafe50c2c82cbf795dd9eee5264cbbf7 Cr-Commit-Position: refs/heads/master@{#31816} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
