Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index 426287540e4e2b523b9ed40c9030504f5ee79cf3..5d855ebe5427a3b474dec68ab0996b4dd45ebdb5 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -1109,6 +1109,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
// Get the object to enumerate over. If the object is null or undefined, skip |
// over the loop. See ECMA-262 version 5, section 12.6.4. |
+ SetExpressionPosition(stmt->enumerable()); |
VisitForAccumulatorValue(stmt->enumerable()); |
__ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, &exit); |
Register null_value = x15; |
@@ -1202,6 +1203,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
// Generate code for doing the condition check. |
PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ Bind(&loop); |
+ SetExpressionPosition(stmt->each()); |
+ |
// Load the current count to x0, load the length to x1. |
__ PeekPair(x0, x1, 0); |
__ Cmp(x0, x1); // Compare to the array length. |
@@ -1271,48 +1274,6 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
} |
-void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
- Comment cmnt(masm_, "[ ForOfStatement"); |
- SetStatementPosition(stmt); |
- |
- Iteration loop_statement(this, stmt); |
- increment_loop_depth(); |
- |
- // var iterator = iterable[Symbol.iterator](); |
- VisitForEffect(stmt->assign_iterator()); |
- |
- // Loop entry. |
- __ Bind(loop_statement.continue_label()); |
- |
- // result = iterator.next() |
- VisitForEffect(stmt->next_result()); |
- |
- // if (result.done) break; |
- Label result_not_done; |
- VisitForControl(stmt->result_done(), |
- loop_statement.break_label(), |
- &result_not_done, |
- &result_not_done); |
- __ Bind(&result_not_done); |
- |
- // 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); |
- EmitBackEdgeBookkeeping(stmt, loop_statement.continue_label()); |
- __ B(loop_statement.continue_label()); |
- |
- // Exit and decrement the loop depth. |
- PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
- __ Bind(loop_statement.break_label()); |
- decrement_loop_depth(); |
-} |
- |
- |
void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
bool pretenure) { |
// Use the fast case closure allocation code that allocates in new space for |