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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2164503005: [interpreter] Remove duped control scope in ForOfStatement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix golden. Created 4 years, 5 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/interpreter/bytecode_expectations/Generators.golden » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/bytecode-flags.h" 10 #include "src/interpreter/bytecode-flags.h"
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 builder()->ForInStep(index); 1159 builder()->ForInStep(index);
1160 builder()->StoreAccumulatorInRegister(index); 1160 builder()->StoreAccumulatorInRegister(index);
1161 loop_builder.JumpToHeader(); 1161 loop_builder.JumpToHeader();
1162 loop_builder.EndLoop(); 1162 loop_builder.EndLoop();
1163 builder()->Bind(&subject_null_label); 1163 builder()->Bind(&subject_null_label);
1164 builder()->Bind(&subject_undefined_label); 1164 builder()->Bind(&subject_undefined_label);
1165 } 1165 }
1166 1166
1167 void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { 1167 void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
1168 LoopBuilder loop_builder(builder()); 1168 LoopBuilder loop_builder(builder());
1169 ControlScopeForIteration control_scope(this, stmt, &loop_builder);
1170 1169
1171 builder()->SetExpressionAsStatementPosition(stmt->assign_iterator()); 1170 builder()->SetExpressionAsStatementPosition(stmt->assign_iterator());
1172 VisitForEffect(stmt->assign_iterator()); 1171 VisitForEffect(stmt->assign_iterator());
1173 1172
1174 VisitIterationHeader(stmt, &loop_builder); 1173 VisitIterationHeader(stmt, &loop_builder);
1175 builder()->SetExpressionAsStatementPosition(stmt->next_result()); 1174 builder()->SetExpressionAsStatementPosition(stmt->next_result());
1176 VisitForEffect(stmt->next_result()); 1175 VisitForEffect(stmt->next_result());
1177 VisitForAccumulatorValue(stmt->result_done()); 1176 VisitForAccumulatorValue(stmt->result_done());
1178 loop_builder.BreakIfTrue(); 1177 loop_builder.BreakIfTrue();
1179 1178
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 return execution_context()->scope()->language_mode(); 3177 return execution_context()->scope()->language_mode();
3179 } 3178 }
3180 3179
3181 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3180 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3182 return TypeFeedbackVector::GetIndex(slot); 3181 return TypeFeedbackVector::GetIndex(slot);
3183 } 3182 }
3184 3183
3185 } // namespace interpreter 3184 } // namespace interpreter
3186 } // namespace internal 3185 } // namespace internal
3187 } // namespace v8 3186 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698