Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index 39862bc4d39cea38c63adf8a83ae7a218ce61909..7bd7d4960dd6053ce672b61321664e353aedf2cb 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -947,14 +947,14 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
- Label loop, exit; |
- ForIn loop_statement(this, stmt); |
- increment_loop_depth(); |
- |
// Get the object to enumerate over. |
SetExpressionAsStatementPosition(stmt->enumerable()); |
VisitForAccumulatorValue(stmt->enumerable()); |
- OperandStackDepthIncrement(ForIn::kElementCount); |
+ OperandStackDepthIncrement(5); |
+ |
+ Label loop, exit; |
+ Iteration loop_statement(this, stmt); |
+ increment_loop_depth(); |
// If the object is null or undefined, skip over the loop, otherwise convert |
// it to a JS receiver. See ECMA-262 version 5, section 12.6.4. |
@@ -1115,8 +1115,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
// Remove the pointers stored on the stack. |
__ bind(loop_statement.break_label()); |
- __ addp(rsp, Immediate(5 * kPointerSize)); |
- OperandStackDepthDecrement(ForIn::kElementCount); |
+ DropOperands(5); |
// Exit and decrement the loop depth. |
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
@@ -1828,7 +1827,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
case Yield::kSuspend: |
// Pop value from top-of-stack slot; box result into result register. |
EmitCreateIteratorResult(false); |
- __ Push(result_register()); |
+ PushOperand(result_register()); |
// Fall through. |
case Yield::kInitial: { |
Label suspend, continuation, post_runtime, resume; |
@@ -1847,6 +1846,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
EmitUnwindAndReturn(); |
__ bind(&suspend); |
+ OperandStackDepthIncrement(1); // Not popped on this path. |
VisitForAccumulatorValue(expr->generator_object()); |
DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
__ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset), |
@@ -1874,7 +1874,6 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
case Yield::kFinal: { |
// Pop value from top-of-stack slot, box result into result register. |
- OperandStackDepthDecrement(1); |
EmitCreateIteratorResult(true); |
EmitUnwindAndReturn(); |
break; |
@@ -2014,6 +2013,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) { |
__ LoadRoot(FieldOperand(rax, JSIteratorResult::kDoneOffset), |
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
+ OperandStackDepthDecrement(1); |
} |