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

Unified Diff: src/heap.cc

Issue 32003006: Handlify Heap::AllocateInitialMap 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.cc » ('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 8737c574b2d1d83e13722bc3d1b614c2f04c88aa..5f9bd38f07d9ccaf29d81252a5d873f6fbf7bc08 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4458,48 +4458,6 @@ MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) {
}
-MaybeObject* Heap::AllocateInitialMap(JSFunction* fun) {
- ASSERT(!fun->has_initial_map());
-
- // First create a new map with the size and number of in-object properties
- // suggested by the function.
- InstanceType instance_type;
- int instance_size;
- int in_object_properties;
- if (fun->shared()->is_generator()) {
- instance_type = JS_GENERATOR_OBJECT_TYPE;
- instance_size = JSGeneratorObject::kSize;
- in_object_properties = 0;
- } else {
- instance_type = JS_OBJECT_TYPE;
- instance_size = fun->shared()->CalculateInstanceSize();
- in_object_properties = fun->shared()->CalculateInObjectProperties();
- }
- Map* map;
- MaybeObject* maybe_map = AllocateMap(instance_type, instance_size);
- if (!maybe_map->To(&map)) return maybe_map;
-
- // Fetch or allocate prototype.
- Object* prototype;
- if (fun->has_instance_prototype()) {
- prototype = fun->instance_prototype();
- } else {
- MaybeObject* maybe_prototype = AllocateFunctionPrototype(fun);
- if (!maybe_prototype->To(&prototype)) return maybe_prototype;
- }
- map->set_inobject_properties(in_object_properties);
- map->set_unused_property_fields(in_object_properties);
- map->set_prototype(prototype);
- ASSERT(map->has_fast_object_elements());
-
- if (!fun->shared()->is_generator()) {
- fun->shared()->StartInobjectSlackTracking(map);
- }
-
- return map;
-}
-
-
void Heap::InitializeJSObjectFromMap(JSObject* obj,
FixedArray* properties,
Map* map) {
« no previous file with comments | « src/heap.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698