OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 } | 1264 } |
1265 | 1265 |
1266 | 1266 |
1267 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { | 1267 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
1268 Comment cmnt(masm_, "[ ForOfStatement"); | 1268 Comment cmnt(masm_, "[ ForOfStatement"); |
1269 SetStatementPosition(stmt); | 1269 SetStatementPosition(stmt); |
1270 | 1270 |
1271 Iteration loop_statement(this, stmt); | 1271 Iteration loop_statement(this, stmt); |
1272 increment_loop_depth(); | 1272 increment_loop_depth(); |
1273 | 1273 |
1274 // var iterable = subject | |
1275 VisitForAccumulatorValue(stmt->assign_iterable()); | |
1276 | |
1277 // As with for-in, skip the loop if the iterator is null or undefined. | |
1278 Register iterator = x0; | |
1279 __ JumpIfRoot(iterator, Heap::kUndefinedValueRootIndex, | |
1280 loop_statement.break_label()); | |
1281 __ JumpIfRoot(iterator, Heap::kNullValueRootIndex, | |
1282 loop_statement.break_label()); | |
1283 | |
1284 // var iterator = iterable[Symbol.iterator](); | 1274 // var iterator = iterable[Symbol.iterator](); |
1285 VisitForEffect(stmt->assign_iterator()); | 1275 VisitForEffect(stmt->assign_iterator()); |
1286 | 1276 |
1287 // Loop entry. | 1277 // Loop entry. |
1288 __ Bind(loop_statement.continue_label()); | 1278 __ Bind(loop_statement.continue_label()); |
1289 | 1279 |
1290 // result = iterator.next() | 1280 // result = iterator.next() |
1291 VisitForEffect(stmt->next_result()); | 1281 VisitForEffect(stmt->next_result()); |
1292 | 1282 |
1293 // if (result.done) break; | 1283 // if (result.done) break; |
(...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4922 return previous_; | 4912 return previous_; |
4923 } | 4913 } |
4924 | 4914 |
4925 | 4915 |
4926 #undef __ | 4916 #undef __ |
4927 | 4917 |
4928 | 4918 |
4929 } } // namespace v8::internal | 4919 } } // namespace v8::internal |
4930 | 4920 |
4931 #endif // V8_TARGET_ARCH_ARM64 | 4921 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |