| Index: src/runtime/runtime-generator.cc
|
| diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
|
| index 181b5f9540040405bb3d4b9ad0ccf529c50bdff5..5e64a477bc98ae235b316398cb6474c9cbe6ceb8 100644
|
| --- a/src/runtime/runtime-generator.cc
|
| +++ b/src/runtime/runtime-generator.cc
|
| @@ -72,63 +72,6 @@ RUNTIME_FUNCTION(Runtime_SuspendJSGeneratorObject) {
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
| -
|
| -// Note that this function is the slow path for resuming generators. It is only
|
| -// called if the suspended activation had operands on the stack, stack handlers
|
| -// needing rewinding, or if the resume should throw an exception. The fast path
|
| -// is handled directly in FullCodeGenerator::EmitGeneratorResume(), which is
|
| -// inlined into GeneratorNext, GeneratorReturn, and GeneratorThrow.
|
| -// EmitGeneratorResume is called in any case, as it needs to reconstruct the
|
| -// stack frame and make space for arguments and operands.
|
| -RUNTIME_FUNCTION(Runtime_ResumeJSGeneratorObject) {
|
| - SealHandleScope shs(isolate);
|
| - DCHECK(args.length() == 3);
|
| - CONVERT_ARG_CHECKED(JSGeneratorObject, generator_object, 0);
|
| - CONVERT_ARG_CHECKED(Object, value, 1);
|
| - CONVERT_SMI_ARG_CHECKED(resume_mode_int, 2);
|
| - JavaScriptFrameIterator stack_iterator(isolate);
|
| - JavaScriptFrame* frame = stack_iterator.frame();
|
| -
|
| - DCHECK_EQ(frame->function(), generator_object->function());
|
| - DCHECK(frame->function()->shared()->is_compiled());
|
| - DCHECK(!frame->function()->IsOptimized());
|
| -
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0);
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0);
|
| -
|
| - Code* code = generator_object->function()->shared()->code();
|
| - int offset = generator_object->continuation();
|
| - DCHECK_GT(offset, 0);
|
| - frame->set_pc(code->instruction_start() + offset);
|
| - if (FLAG_enable_embedded_constant_pool) {
|
| - frame->set_constant_pool(code->constant_pool());
|
| - }
|
| - generator_object->set_continuation(JSGeneratorObject::kGeneratorExecuting);
|
| -
|
| - FixedArray* operand_stack = generator_object->operand_stack();
|
| - int operands_count = operand_stack->length();
|
| - if (operands_count != 0) {
|
| - frame->RestoreOperandStack(operand_stack);
|
| - generator_object->set_operand_stack(isolate->heap()->empty_fixed_array());
|
| - }
|
| -
|
| - JSGeneratorObject::ResumeMode resume_mode =
|
| - static_cast<JSGeneratorObject::ResumeMode>(resume_mode_int);
|
| - switch (resume_mode) {
|
| - // Note: this looks like NEXT and RETURN are the same but RETURN receives
|
| - // special treatment in the generator code (to which we return here).
|
| - case JSGeneratorObject::NEXT:
|
| - case JSGeneratorObject::RETURN:
|
| - return value;
|
| - case JSGeneratorObject::THROW:
|
| - return isolate->Throw(value);
|
| - }
|
| -
|
| - UNREACHABLE();
|
| - return isolate->ThrowIllegalOperation();
|
| -}
|
| -
|
| -
|
| RUNTIME_FUNCTION(Runtime_GeneratorClose) {
|
| HandleScope scope(isolate);
|
| DCHECK(args.length() == 1);
|
| @@ -195,23 +138,5 @@ RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) {
|
| return isolate->heap()->undefined_value();
|
| }
|
|
|
| -// Optimization for builtins calling any of the following three functions is
|
| -// disabled in js/generator.js and compiler.cc, hence they are unreachable.
|
| -
|
| -RUNTIME_FUNCTION(Runtime_GeneratorNext) {
|
| - UNREACHABLE();
|
| - return nullptr;
|
| -}
|
| -
|
| -RUNTIME_FUNCTION(Runtime_GeneratorReturn) {
|
| - UNREACHABLE();
|
| - return nullptr;
|
| -}
|
| -
|
| -RUNTIME_FUNCTION(Runtime_GeneratorThrow) {
|
| - UNREACHABLE();
|
| - return nullptr;
|
| -}
|
| -
|
| } // namespace internal
|
| } // namespace v8
|
|
|