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

Side by Side Diff: src/mips64/full-codegen-mips64.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 | « src/mips/full-codegen-mips.cc ('k') | src/parser.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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1260 }
1261 1261
1262 1262
1263 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { 1263 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
1264 Comment cmnt(masm_, "[ ForOfStatement"); 1264 Comment cmnt(masm_, "[ ForOfStatement");
1265 SetStatementPosition(stmt); 1265 SetStatementPosition(stmt);
1266 1266
1267 Iteration loop_statement(this, stmt); 1267 Iteration loop_statement(this, stmt);
1268 increment_loop_depth(); 1268 increment_loop_depth();
1269 1269
1270 // var iterable = subject
1271 VisitForAccumulatorValue(stmt->assign_iterable());
1272 __ mov(a0, v0);
1273
1274 // As with for-in, skip the loop if the iterator is null or undefined.
1275 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
1276 __ Branch(loop_statement.break_label(), eq, a0, Operand(at));
1277 __ LoadRoot(at, Heap::kNullValueRootIndex);
1278 __ Branch(loop_statement.break_label(), eq, a0, Operand(at));
1279
1280 // var iterator = iterable[Symbol.iterator](); 1270 // var iterator = iterable[Symbol.iterator]();
1281 VisitForEffect(stmt->assign_iterator()); 1271 VisitForEffect(stmt->assign_iterator());
1282 1272
1283 // Loop entry. 1273 // Loop entry.
1284 __ bind(loop_statement.continue_label()); 1274 __ bind(loop_statement.continue_label());
1285 1275
1286 // result = iterator.next() 1276 // result = iterator.next()
1287 VisitForEffect(stmt->next_result()); 1277 VisitForEffect(stmt->next_result());
1288 1278
1289 // if (result.done) break; 1279 // if (result.done) break;
(...skipping 3602 matching lines...) Expand 10 before | Expand all | Expand 10 after
4892 Assembler::target_address_at(pc_immediate_load_address)) == 4882 Assembler::target_address_at(pc_immediate_load_address)) ==
4893 reinterpret_cast<uint64_t>( 4883 reinterpret_cast<uint64_t>(
4894 isolate->builtins()->OsrAfterStackCheck()->entry())); 4884 isolate->builtins()->OsrAfterStackCheck()->entry()));
4895 return OSR_AFTER_STACK_CHECK; 4885 return OSR_AFTER_STACK_CHECK;
4896 } 4886 }
4897 4887
4898 4888
4899 } } // namespace v8::internal 4889 } } // namespace v8::internal
4900 4890
4901 #endif // V8_TARGET_ARCH_MIPS64 4891 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698