Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: src/runtime.cc

Issue 32323013: Introduce JSFunction::EnsureHasInitialMap method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698