Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index ba3b5d086e6a515f24d7c8e012707dcd181eb9ea..b74a0583fd11de71a6ea6e9f7d59e3704ee1c889 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -1280,8 +1280,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. |
Register iterator = x0; |
@@ -1290,16 +1290,8 @@ void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
__ JumpIfRoot(iterator, Heap::kNullValueRootIndex, |
loop_statement.break_label()); |
- // Convert the iterator to a JS object. |
- Label convert, done_convert; |
- __ JumpIfSmi(iterator, &convert); |
- __ CompareObjectType(iterator, x1, x1, FIRST_SPEC_OBJECT_TYPE); |
- __ B(ge, &done_convert); |
- __ Bind(&convert); |
- __ Push(iterator); |
- __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
- __ Bind(&done_convert); |
- __ Push(iterator); |
+ // var iterator = iterable[Symbol.iterator](); |
+ VisitForEffect(stmt->assign_iterator()); |
// Loop entry. |
__ Bind(loop_statement.continue_label()); |