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

Unified Diff: src/bootstrapper.cc

Issue 447293002: Mark as prototype only after instantiating the function (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « no previous file | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 5ce58a7e153d20d0761c82dbea00bb8ffb6b17b1..44803f8968bc9b761d5f5a9e386e09c2351f2676 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -480,8 +480,7 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
Handle<JSFunction> object_fun = factory->NewFunction(object_name);
Handle<Map> object_function_map =
factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
- object_fun->set_initial_map(*object_function_map);
- object_function_map->set_constructor(*object_fun);
+ JSFunction::SetInitialMap(object_fun, object_function_map);
object_function_map->set_unused_property_fields(
JSObject::kInitialGlobalObjectUnusedPropertiesCount);
@@ -1211,8 +1210,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
native_context()->set_sloppy_arguments_map(*map);
DCHECK(!function->has_initial_map());
- function->set_initial_map(*map);
- map->set_constructor(*function);
+ JSFunction::SetInitialMap(function, map);
DCHECK(map->inobject_properties() > Heap::kArgumentsCalleeIndex);
DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex);
@@ -1336,8 +1334,7 @@ void Genesis::InstallTypedArray(
JS_TYPED_ARRAY_TYPE,
JSTypedArray::kSizeWithInternalFields,
elements_kind);
- result->set_initial_map(*initial_map);
- initial_map->set_constructor(*result);
+ JSFunction::SetInitialMap(result, initial_map);
*fun = result;
ElementsKind external_kind = GetNextTransitionElementsKind(elements_kind);
@@ -1658,7 +1655,7 @@ Handle<JSFunction> Genesis::InstallInternalArray(
Handle<Map> original_map(array_function->initial_map());
Handle<Map> initial_map = Map::Copy(original_map);
initial_map->set_elements_kind(elements_kind);
- array_function->set_initial_map(*initial_map);
+ JSFunction::SetInitialMap(array_function, initial_map);
// Make "length" magic on instances.
Map::EnsureDescriptorSlack(initial_map, 1);
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698