Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index f4938a72975ee612de115649a93687043760f372..4491eda9fbd8f4defe088a3b08b7249dbd11b644 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -2234,15 +2234,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
VisitForAccumulatorValue(value); |
__ pop(r1); |
- // Check generator state. |
- Label wrong_state, closed_state, done; |
- __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
- STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0); |
- STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0); |
- __ cmp(r3, Operand(Smi::FromInt(0))); |
- __ b(eq, &closed_state); |
- __ b(lt, &wrong_state); |
- |
// Load suspended function and context. |
__ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); |
__ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
@@ -2265,7 +2256,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
// Enter a new JavaScript frame, and initialize its slots as they were when |
// the generator was suspended. |
- Label resume_frame; |
+ Label resume_frame, done; |
__ bind(&push_frame); |
__ bl(&resume_frame); |
__ jmp(&done); |
@@ -2325,26 +2316,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
// Not reached: the runtime call returns elsewhere. |
__ stop("not-reached"); |
- // Reach here when generator is closed. |
- __ bind(&closed_state); |
- if (resume_mode == JSGeneratorObject::NEXT) { |
- // Return completed iterator result when generator is closed. |
- __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
- __ push(r2); |
- // Pop value from top-of-stack slot; box result into result register. |
- EmitCreateIteratorResult(true); |
- } else { |
- // Throw the provided value. |
- __ push(r0); |
- __ CallRuntime(Runtime::kThrow, 1); |
- } |
- __ jmp(&done); |
- |
- // Throw error if we attempt to operate on a running generator. |
- __ bind(&wrong_state); |
- __ push(r1); |
- __ CallRuntime(Runtime::kThrowGeneratorStateError, 1); |
- |
__ bind(&done); |
context()->Plug(result_register()); |
} |