Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index feb78c03ec8155437f14aa60b5724092db486b4a..16e311c6e8f5f8edccfb0bb7ec3652d54d83e6d9 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -3000,30 +3000,28 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetExpectedNumberOfProperties) { |
RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSGeneratorObject) { |
- SealHandleScope shs(isolate); |
+ HandleScope scope(isolate); |
ASSERT(args.length() == 0); |
JavaScriptFrameIterator it(isolate); |
JavaScriptFrame* frame = it.frame(); |
- JSFunction* function = frame->function(); |
+ Handle<JSFunction> function(frame->function()); |
RUNTIME_ASSERT(function->shared()->is_generator()); |
- JSGeneratorObject* generator; |
+ Handle<JSGeneratorObject> generator; |
if (frame->IsConstructor()) { |
- generator = JSGeneratorObject::cast(frame->receiver()); |
+ generator = handle(JSGeneratorObject::cast(frame->receiver())); |
} else { |
- MaybeObject* maybe_generator = |
- isolate->heap()->AllocateJSGeneratorObject(function); |
- if (!maybe_generator->To(&generator)) return maybe_generator; |
+ generator = isolate->factory()->NewJSGeneratorObject(function); |
} |
- generator->set_function(function); |
+ generator->set_function(*function); |
generator->set_context(Context::cast(frame->context())); |
generator->set_receiver(frame->receiver()); |
generator->set_continuation(0); |
generator->set_operand_stack(isolate->heap()->empty_fixed_array()); |
generator->set_stack_handler_index(-1); |
- return generator; |
+ return *generator; |
} |