| Index: src/arm64/full-codegen-arm64.cc
|
| diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
|
| index b693d591270457c022d1f84aff55bd7cbea899fa..bc20733e3efe16edc9ef813d253e3948c4ad60a4 100644
|
| --- a/src/arm64/full-codegen-arm64.cc
|
| +++ b/src/arm64/full-codegen-arm64.cc
|
| @@ -4933,7 +4933,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
|
| Expression *value,
|
| JSGeneratorObject::ResumeMode resume_mode) {
|
| ASM_LOCATION("FullCodeGenerator::EmitGeneratorResume");
|
| - Register value_reg = x0;
|
| Register generator_object = x1;
|
| Register the_hole = x2;
|
| Register operand_stack_size = w3;
|
| @@ -4947,15 +4946,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
|
| VisitForAccumulatorValue(value);
|
| __ Pop(generator_object);
|
|
|
| - // Check generator state.
|
| - Label wrong_state, closed_state, done;
|
| - __ Ldr(x10, FieldMemOperand(generator_object,
|
| - JSGeneratorObject::kContinuationOffset));
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0);
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0);
|
| - __ CompareAndBranch(x10, Smi::FromInt(0), eq, &closed_state);
|
| - __ CompareAndBranch(x10, Smi::FromInt(0), lt, &wrong_state);
|
| -
|
| // Load suspended function and context.
|
| __ Ldr(cp, FieldMemOperand(generator_object,
|
| JSGeneratorObject::kContextOffset));
|
| @@ -4981,7 +4971,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;
|
| __ Bl(&resume_frame);
|
| __ B(&done);
|
|
|
| @@ -5026,26 +5016,6 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
|
| // Not reached: the runtime call returns elsewhere.
|
| __ Unreachable();
|
|
|
| - // Reach here when generator is closed.
|
| - __ Bind(&closed_state);
|
| - if (resume_mode == JSGeneratorObject::NEXT) {
|
| - // Return completed iterator result when generator is closed.
|
| - __ LoadRoot(x10, Heap::kUndefinedValueRootIndex);
|
| - __ Push(x10);
|
| - // Pop value from top-of-stack slot; box result into result register.
|
| - EmitCreateIteratorResult(true);
|
| - } else {
|
| - // Throw the provided value.
|
| - __ Push(value_reg);
|
| - __ CallRuntime(Runtime::kThrow, 1);
|
| - }
|
| - __ B(&done);
|
| -
|
| - // Throw error if we attempt to operate on a running generator.
|
| - __ Bind(&wrong_state);
|
| - __ Push(generator_object);
|
| - __ CallRuntime(Runtime::kThrowGeneratorStateError, 1);
|
| -
|
| __ Bind(&done);
|
| context()->Plug(result_register());
|
| }
|
|
|