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

Unified Diff: src/x64/full-codegen-x64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/iteration-optimization.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 62c6073a2fe96c333f07192ac156ed8b88aaa048..2c4a8042c31c50d22d6264cb4d94a5108df10f8c 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -1239,16 +1239,6 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
__ CompareRoot(rax, Heap::kNullValueRootIndex);
__ j(equal, loop_statement.break_label());
- // Convert the iterator to a JS object.
- Label convert, done_convert;
- __ JumpIfSmi(rax, &convert);
- __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx);
- __ j(above_equal, &done_convert);
- __ bind(&convert);
- __ push(rax);
- __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
- __ bind(&done_convert);
-
// Loop entry.
__ bind(loop_statement.continue_label());
@@ -1263,14 +1253,15 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
&result_not_done);
__ bind(&result_not_done);
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
+
// each = result.value
VisitForEffect(stmt->assign_each());
// Generate code for the body of the loop.
Visit(stmt->body());
- // Check stack before looping.
- PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS);
+ // Loop.
EmitBackEdgeBookkeeping(stmt, loop_statement.continue_label());
__ jmp(loop_statement.continue_label());
« no previous file with comments | « src/typing.cc ('k') | test/mjsunit/harmony/iteration-optimization.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698