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

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

Issue 15740007: Add for-of Crankshaft support Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase onto master; fix AstTyper for ForOfStatement Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ast.h » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 1267
1268 // var iterator = iterable[@@iterator]() 1268 // var iterator = iterable[@@iterator]()
1269 VisitForAccumulatorValue(stmt->assign_iterator()); 1269 VisitForAccumulatorValue(stmt->assign_iterator());
1270 1270
1271 // As with for-in, skip the loop if the iterator is null or undefined. 1271 // As with for-in, skip the loop if the iterator is null or undefined.
1272 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); 1272 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex);
1273 __ b(eq, loop_statement.break_label()); 1273 __ b(eq, loop_statement.break_label());
1274 __ CompareRoot(r0, Heap::kNullValueRootIndex); 1274 __ CompareRoot(r0, Heap::kNullValueRootIndex);
1275 __ b(eq, loop_statement.break_label()); 1275 __ b(eq, loop_statement.break_label());
1276 1276
1277 // Convert the iterator to a JS object.
1278 Label convert, done_convert;
1279 __ JumpIfSmi(r0, &convert);
1280 __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE);
1281 __ b(ge, &done_convert);
1282 __ bind(&convert);
1283 __ push(r0);
1284 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
1285 __ bind(&done_convert);
1286 __ push(r0);
1287
1288 // Loop entry. 1277 // Loop entry.
1289 __ bind(loop_statement.continue_label()); 1278 __ bind(loop_statement.continue_label());
1290 1279
1291 // result = iterator.next() 1280 // result = iterator.next()
1292 VisitForEffect(stmt->next_result()); 1281 VisitForEffect(stmt->next_result());
1293 1282
1294 // if (result.done) break; 1283 // if (result.done) break;
1295 Label result_not_done; 1284 Label result_not_done;
1296 VisitForControl(stmt->result_done(), 1285 VisitForControl(stmt->result_done(),
1297 loop_statement.break_label(), 1286 loop_statement.break_label(),
1298 &result_not_done, 1287 &result_not_done,
1299 &result_not_done); 1288 &result_not_done);
1300 __ bind(&result_not_done); 1289 __ bind(&result_not_done);
1301 1290
1291 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
1292
1302 // each = result.value 1293 // each = result.value
1303 VisitForEffect(stmt->assign_each()); 1294 VisitForEffect(stmt->assign_each());
1304 1295
1305 // Generate code for the body of the loop. 1296 // Generate code for the body of the loop.
1306 Visit(stmt->body()); 1297 Visit(stmt->body());
1307 1298
1308 // Check stack before looping. 1299 // Loop.
1309 PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS);
1310 EmitBackEdgeBookkeeping(stmt, loop_statement.continue_label()); 1300 EmitBackEdgeBookkeeping(stmt, loop_statement.continue_label());
1311 __ jmp(loop_statement.continue_label()); 1301 __ jmp(loop_statement.continue_label());
1312 1302
1313 // Exit and decrement the loop depth. 1303 // Exit and decrement the loop depth.
1314 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 1304 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
1315 __ bind(loop_statement.break_label()); 1305 __ bind(loop_statement.break_label());
1316 decrement_loop_depth(); 1306 decrement_loop_depth();
1317 } 1307 }
1318 1308
1319 1309
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after
4935 *context_length = 0; 4925 *context_length = 0;
4936 return previous_; 4926 return previous_;
4937 } 4927 }
4938 4928
4939 4929
4940 #undef __ 4930 #undef __
4941 4931
4942 } } // namespace v8::internal 4932 } } // namespace v8::internal
4943 4933
4944 #endif // V8_TARGET_ARCH_ARM 4934 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698