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

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 1784883002: Fix expression positions for for-loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: It's not enough to fix the bug. You also need to TELL it you fixed the bug. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/ast-numbering.h" 8 #include "src/ast/ast-numbering.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 void FullCodeGenerator::VisitForStatement(ForStatement* stmt) { 1195 void FullCodeGenerator::VisitForStatement(ForStatement* stmt) {
1196 Comment cmnt(masm_, "[ ForStatement"); 1196 Comment cmnt(masm_, "[ ForStatement");
1197 // Do not insert break location as we do it below. 1197 // Do not insert break location as we do it below.
1198 SetStatementPosition(stmt, SKIP_BREAK); 1198 SetStatementPosition(stmt, SKIP_BREAK);
1199 1199
1200 Label test, body; 1200 Label test, body;
1201 1201
1202 Iteration loop_statement(this, stmt); 1202 Iteration loop_statement(this, stmt);
1203 1203
1204 if (stmt->init() != NULL) { 1204 if (stmt->init() != NULL) {
1205 SetStatementPosition(stmt->init());
1206 Visit(stmt->init()); 1205 Visit(stmt->init());
1207 } 1206 }
1208 1207
1209 increment_loop_depth(); 1208 increment_loop_depth();
1210 // Emit the test at the bottom of the loop (even if empty). 1209 // Emit the test at the bottom of the loop (even if empty).
1211 __ jmp(&test); 1210 __ jmp(&test);
1212 1211
1213 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); 1212 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
1214 __ bind(&body); 1213 __ bind(&body);
1215 Visit(stmt->body()); 1214 Visit(stmt->body());
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1905 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1907 var->initializer_position() >= proxy->position(); 1906 var->initializer_position() >= proxy->position();
1908 } 1907 }
1909 1908
1910 1909
1911 #undef __ 1910 #undef __
1912 1911
1913 1912
1914 } // namespace internal 1913 } // namespace internal
1915 } // namespace v8 1914 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698