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

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

Issue 416033002: For-of on null or undefined is an error (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 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 | src/arm64/full-codegen-arm64.cc » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } 1269 }
1270 1270
1271 1271
1272 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { 1272 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
1273 Comment cmnt(masm_, "[ ForOfStatement"); 1273 Comment cmnt(masm_, "[ ForOfStatement");
1274 SetStatementPosition(stmt); 1274 SetStatementPosition(stmt);
1275 1275
1276 Iteration loop_statement(this, stmt); 1276 Iteration loop_statement(this, stmt);
1277 increment_loop_depth(); 1277 increment_loop_depth();
1278 1278
1279 // var iterable = subject
1280 VisitForAccumulatorValue(stmt->assign_iterable());
1281
1282 // As with for-in, skip the loop if the iterator is null or undefined.
1283 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex);
1284 __ b(eq, loop_statement.break_label());
1285 __ CompareRoot(r0, Heap::kNullValueRootIndex);
1286 __ b(eq, loop_statement.break_label());
1287
1288 // var iterator = iterable[Symbol.iterator](); 1279 // var iterator = iterable[Symbol.iterator]();
1289 VisitForEffect(stmt->assign_iterator()); 1280 VisitForEffect(stmt->assign_iterator());
1290 1281
1291 // Loop entry. 1282 // Loop entry.
1292 __ bind(loop_statement.continue_label()); 1283 __ bind(loop_statement.continue_label());
1293 1284
1294 // result = iterator.next() 1285 // result = iterator.next()
1295 VisitForEffect(stmt->next_result()); 1286 VisitForEffect(stmt->next_result());
1296 1287
1297 // if (result.done) break; 1288 // if (result.done) break;
(...skipping 3592 matching lines...) Expand 10 before | Expand all | Expand 10 after
4890 4881
4891 ASSERT(interrupt_address == 4882 ASSERT(interrupt_address ==
4892 isolate->builtins()->OsrAfterStackCheck()->entry()); 4883 isolate->builtins()->OsrAfterStackCheck()->entry());
4893 return OSR_AFTER_STACK_CHECK; 4884 return OSR_AFTER_STACK_CHECK;
4894 } 4885 }
4895 4886
4896 4887
4897 } } // namespace v8::internal 4888 } } // namespace v8::internal
4898 4889
4899 #endif // V8_TARGET_ARCH_ARM 4890 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698