| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 25bfd340294e2f7aa9a84a6b336748ad9e4f4f35..dfc41b83c19d1c46c5a5247f40122196d105f607 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -1067,6 +1067,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());
|
| __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
|
| __ j(equal, &exit);
|
| @@ -1170,6 +1171,8 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| // Generate code for doing the condition check.
|
| PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
|
| __ bind(&loop);
|
| + SetExpressionPosition(stmt->each());
|
| +
|
| __ movp(rax, Operand(rsp, 0 * kPointerSize)); // Get the current index.
|
| __ cmpp(rax, Operand(rsp, 1 * kPointerSize)); // Compare to the array length.
|
| __ j(above_equal, loop_statement.break_label());
|
| @@ -1239,48 +1242,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());
|
| - __ jmp(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
|
|
|