Index: src/full-codegen/arm/full-codegen-arm.cc |
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc |
index 2c1ab705a51d3fdd16a820320d146f4ca64f11e8..6b3c4c63237e869810b802d41a245f474866090c 100644 |
--- a/src/full-codegen/arm/full-codegen-arm.cc |
+++ b/src/full-codegen/arm/full-codegen-arm.cc |
@@ -1851,63 +1851,43 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// this. It stays on the stack while we update the iterator. |
VisitForStackValue(expr->expression()); |
- switch (expr->yield_kind()) { |
- case Yield::kSuspend: |
- // Pop value from top-of-stack slot; box result into result register. |
- EmitCreateIteratorResult(false); |
- PushOperand(result_register()); |
- // Fall through. |
- case Yield::kInitial: { |
- Label suspend, continuation, post_runtime, resume; |
- |
- __ jmp(&suspend); |
- __ bind(&continuation); |
- // When we arrive here, the stack top is the resume mode and |
- // result_register() holds the input value (the argument given to the |
- // respective resume operation). |
- __ RecordGeneratorContinuation(); |
- __ pop(r1); |
- __ cmp(r1, Operand(Smi::FromInt(JSGeneratorObject::RETURN))); |
- __ b(ne, &resume); |
- __ push(result_register()); |
- EmitCreateIteratorResult(true); |
- EmitUnwindAndReturn(); |
- |
- __ bind(&suspend); |
- OperandStackDepthIncrement(1); // Not popped on this path. |
- VisitForAccumulatorValue(expr->generator_object()); |
- DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
- __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); |
- __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
- __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
- __ mov(r1, cp); |
- __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
- kLRHasBeenSaved, kDontSaveFPRegs); |
- __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); |
- __ cmp(sp, r1); |
- __ b(eq, &post_runtime); |
- __ push(r0); // generator object |
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- __ bind(&post_runtime); |
- PopOperand(result_register()); |
- EmitReturnSequence(); |
- |
- __ bind(&resume); |
- context()->Plug(result_register()); |
- break; |
- } |
- |
- case Yield::kFinal: { |
- // Pop value from top-of-stack slot, box result into result register. |
- EmitCreateIteratorResult(true); |
- EmitUnwindAndReturn(); |
- break; |
- } |
+ Label suspend, continuation, post_runtime, resume; |
+ |
+ __ jmp(&suspend); |
+ __ bind(&continuation); |
+ // When we arrive here, the stack top is the resume mode and |
+ // result_register() holds the input value (the argument given to the |
+ // respective resume operation). |
+ __ RecordGeneratorContinuation(); |
+ __ pop(r1); |
+ __ cmp(r1, Operand(Smi::FromInt(JSGeneratorObject::RETURN))); |
+ __ b(ne, &resume); |
+ __ push(result_register()); |
+ EmitCreateIteratorResult(true); |
+ EmitUnwindAndReturn(); |
+ |
+ __ bind(&suspend); |
+ OperandStackDepthIncrement(1); // Not popped on this path. |
+ VisitForAccumulatorValue(expr->generator_object()); |
+ DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); |
+ __ mov(r1, Operand(Smi::FromInt(continuation.pos()))); |
+ __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset)); |
+ __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset)); |
+ __ mov(r1, cp); |
+ __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2, |
+ kLRHasBeenSaved, kDontSaveFPRegs); |
+ __ add(r1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); |
+ __ cmp(sp, r1); |
+ __ b(eq, &post_runtime); |
+ __ push(r0); // generator object |
+ __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
+ __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ __ bind(&post_runtime); |
+ PopOperand(result_register()); |
+ EmitReturnSequence(); |
- case Yield::kDelegating: |
- UNREACHABLE(); |
- } |
+ __ bind(&resume); |
+ context()->Plug(result_register()); |
} |