Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 4927cac376176dbea65ca4ed45c2d893ee0b8d02..fb14663341c604a7ba546a4cd5a3b91904546386 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -580,6 +580,12 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) { |
} |
+Handle<Map> Factory::NewInitialMap(Handle<JSFunction> function) { |
+ CALL_HEAP_FUNCTION( |
+ isolate(), isolate()->heap()->AllocateInitialMap(*function), Map); |
+} |
+ |
+ |
Handle<Map> Factory::CopyWithPreallocatedFieldDescriptors(Handle<Map> src) { |
CALL_HEAP_FUNCTION( |
isolate(), src->CopyWithPreallocatedFieldDescriptors(), Map); |
@@ -1045,6 +1051,7 @@ Handle<String> Factory::InternalizedStringFromString(Handle<String> value) { |
Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor, |
PretenureFlag pretenure) { |
+ JSFunction::EnsureHasInitialMap(constructor); |
CALL_HEAP_FUNCTION( |
isolate(), |
isolate()->heap()->AllocateJSObject(*constructor, pretenure), JSObject); |
@@ -1191,6 +1198,19 @@ void Factory::SetContent(Handle<JSArray> array, |
} |
+Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
+ Handle<JSFunction> function) { |
+ ASSERT(function->shared()->is_generator()); |
+ JSFunction::EnsureHasInitialMap(function); |
+ Handle<Map> map(function->initial_map()); |
+ ASSERT(map->instance_type() == JS_GENERATOR_OBJECT_TYPE); |
+ CALL_HEAP_FUNCTION( |
+ isolate(), |
+ isolate()->heap()->AllocateJSObjectFromMap(*map), |
+ JSGeneratorObject); |
+} |
+ |
+ |
Handle<JSArrayBuffer> Factory::NewJSArrayBuffer() { |
Handle<JSFunction> array_buffer_fun( |
isolate()->context()->native_context()->array_buffer_fun()); |