Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 2e460487c75468ba5f629a3f8d39ee0684bdcf9e..8737c574b2d1d83e13722bc3d1b614c2f04c88aa 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -4606,15 +4606,7 @@ MaybeObject* Heap::AllocateJSObjectFromMapWithAllocationSite( |
MaybeObject* Heap::AllocateJSObject(JSFunction* constructor, |
PretenureFlag pretenure) { |
- // Allocate the initial map if absent. |
- if (!constructor->has_initial_map()) { |
- Object* initial_map; |
- { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); |
- if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; |
- } |
- constructor->set_initial_map(Map::cast(initial_map)); |
- Map::cast(initial_map)->set_constructor(constructor); |
- } |
+ ASSERT(constructor->has_initial_map()); |
// Allocate the object based on the constructors initial map. |
MaybeObject* result = AllocateJSObjectFromMap( |
constructor->initial_map(), pretenure); |
@@ -4629,15 +4621,7 @@ MaybeObject* Heap::AllocateJSObject(JSFunction* constructor, |
MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor, |
Handle<AllocationSite> allocation_site) { |
- // Allocate the initial map if absent. |
- if (!constructor->has_initial_map()) { |
- Object* initial_map; |
- { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); |
- if (!maybe_initial_map->ToObject(&initial_map)) return maybe_initial_map; |
- } |
- constructor->set_initial_map(Map::cast(initial_map)); |
- Map::cast(initial_map)->set_constructor(constructor); |
- } |
+ ASSERT(constructor->has_initial_map()); |
// Allocate the object based on the constructors initial map, or the payload |
// advice |
Map* initial_map = constructor->initial_map(); |
@@ -4669,23 +4653,6 @@ MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor, |
} |
-MaybeObject* Heap::AllocateJSGeneratorObject(JSFunction *function) { |
- ASSERT(function->shared()->is_generator()); |
- Map *map; |
- if (function->has_initial_map()) { |
- map = function->initial_map(); |
- } else { |
- // Allocate the initial map if absent. |
- MaybeObject* maybe_map = AllocateInitialMap(function); |
- if (!maybe_map->To(&map)) return maybe_map; |
- function->set_initial_map(map); |
- map->set_constructor(function); |
- } |
- ASSERT(map->instance_type() == JS_GENERATOR_OBJECT_TYPE); |
- return AllocateJSObjectFromMap(map); |
-} |
- |
- |
MaybeObject* Heap::AllocateJSModule(Context* context, ScopeInfo* scope_info) { |
// Allocate a fresh map. Modules do not have a prototype. |
Map* map; |