Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index cbee082060ee1b99e0d3c61031f885f58071e3da..17f364b2c209b6585b6bcb0f79d87aa3fe7de0df 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -2196,15 +2196,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
VisitForAccumulatorValue(value); |
__ Pop(rbx); |
- // Check generator state. |
- Label wrong_state, closed_state, done; |
- STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0); |
- STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0); |
- __ SmiCompare(FieldOperand(rbx, JSGeneratorObject::kContinuationOffset), |
- Smi::FromInt(0)); |
- __ j(equal, &closed_state); |
- __ j(less, &wrong_state); |
- |
// Load suspended function and context. |
__ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset)); |
__ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset)); |
@@ -2226,7 +2217,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); |
__ call(&resume_frame); |
__ jmp(&done); |
@@ -2273,25 +2264,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
// Not reached: the runtime call returns elsewhere. |
__ Abort(kGeneratorFailedToResume); |
- // Reach here when generator is closed. |
- __ bind(&closed_state); |
- if (resume_mode == JSGeneratorObject::NEXT) { |
- // Return completed iterator result when generator is closed. |
- __ PushRoot(Heap::kUndefinedValueRootIndex); |
- // Pop value from top-of-stack slot; box result into result register. |
- EmitCreateIteratorResult(true); |
- } else { |
- // Throw the provided value. |
- __ Push(rax); |
- __ CallRuntime(Runtime::kThrow, 1); |
- } |
- __ jmp(&done); |
- |
- // Throw error if we attempt to operate on a running generator. |
- __ bind(&wrong_state); |
- __ Push(rbx); |
- __ CallRuntime(Runtime::kThrowGeneratorStateError, 1); |
- |
__ bind(&done); |
context()->Plug(result_register()); |
} |