Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index bb4618ae45d68fb35c8ebceb02de8f757b4b0373..241991cd4b5c5e38dc9eca1bf1e74b05402af8c6 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1273,8 +1273,8 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
Iteration loop_statement(this, stmt); |
increment_loop_depth(); |
- // var iterator = iterable[@@iterator]() |
- VisitForAccumulatorValue(stmt->assign_iterator()); |
+ // var iterable = subject |
+ VisitForAccumulatorValue(stmt->assign_iterable()); |
// As with for-in, skip the loop if the iterator is null or undefined. |
__ CompareRoot(r0, Heap::kUndefinedValueRootIndex); |
@@ -1282,16 +1282,8 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
__ CompareRoot(r0, Heap::kNullValueRootIndex); |
__ b(eq, loop_statement.break_label()); |
- // Convert the iterator to a JS object. |
- Label convert, done_convert; |
- __ JumpIfSmi(r0, &convert); |
- __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE); |
- __ b(ge, &done_convert); |
- __ bind(&convert); |
- __ push(r0); |
- __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
- __ bind(&done_convert); |
- __ push(r0); |
+ // var iterator = iterable[Symbol.iterator](); |
+ VisitForEffect(stmt->assign_iterator()); |
// Loop entry. |
__ bind(loop_statement.continue_label()); |