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

Unified Diff: src/heap.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/heap.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698