Index: src/runtime/runtime-generator.cc |
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc |
index 5e64a477bc98ae235b316398cb6474c9cbe6ceb8..eeac3ad6b64b934b897387313139d88ccaa6eb4e 100644 |
--- a/src/runtime/runtime-generator.cc |
+++ b/src/runtime/runtime-generator.cc |
@@ -14,22 +14,18 @@ namespace internal { |
RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) { |
HandleScope scope(isolate); |
- DCHECK(args.length() == 0); |
- |
- JavaScriptFrameIterator it(isolate); |
- JavaScriptFrame* frame = it.frame(); |
- Handle<JSFunction> function(frame->function()); |
+ DCHECK(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1); |
RUNTIME_ASSERT(function->shared()->is_generator()); |
- Handle<JSGeneratorObject> generator; |
- DCHECK(!frame->IsConstructor()); |
- generator = isolate->factory()->NewJSGeneratorObject(function); |
+ Handle<JSGeneratorObject> generator = |
+ isolate->factory()->NewJSGeneratorObject(function); |
generator->set_function(*function); |
- generator->set_context(Context::cast(frame->context())); |
- generator->set_receiver(frame->receiver()); |
- generator->set_continuation(0); |
+ generator->set_context(isolate->context()); |
+ generator->set_receiver(*receiver); |
generator->set_operand_stack(isolate->heap()->empty_fixed_array()); |
- |
+ generator->set_continuation(JSGeneratorObject::kGeneratorExecuting); |
return *generator; |
} |