Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index 25f18e571d369f10f599aad8a6bad1a2e5889ad4..d6a34560a12a8437b8e8b478d40e85055aef1388 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -1812,64 +1812,44 @@ 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; |
- |
- __ b(&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(r4); |
- __ CmpSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::RETURN), r0); |
- __ bne(&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())); |
- __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); |
- __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
- r0); |
- __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
- __ mr(r4, cp); |
- __ RecordWriteField(r3, JSGeneratorObject::kContextOffset, r4, r5, |
- kLRHasBeenSaved, kDontSaveFPRegs); |
- __ addi(r4, fp, Operand(StandardFrameConstants::kExpressionsOffset)); |
- __ cmp(sp, r4); |
- __ beq(&post_runtime); |
- __ push(r3); // generator object |
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ LoadP(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; |
+ |
+ __ b(&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(r4); |
+ __ CmpSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::RETURN), r0); |
+ __ bne(&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())); |
+ __ LoadSmiLiteral(r4, Smi::FromInt(continuation.pos())); |
+ __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
+ r0); |
+ __ StoreP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset), r0); |
+ __ mr(r4, cp); |
+ __ RecordWriteField(r3, JSGeneratorObject::kContextOffset, r4, r5, |
+ kLRHasBeenSaved, kDontSaveFPRegs); |
+ __ addi(r4, fp, Operand(StandardFrameConstants::kExpressionsOffset)); |
+ __ cmp(sp, r4); |
+ __ beq(&post_runtime); |
+ __ push(r3); // generator object |
+ __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
+ __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ __ bind(&post_runtime); |
+ PopOperand(result_register()); |
+ EmitReturnSequence(); |
- case Yield::kDelegating: |
- UNREACHABLE(); |
- } |
+ __ bind(&resume); |
+ context()->Plug(result_register()); |
} |