OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |