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

Unified Diff: src/bootstrapper.cc

Issue 13533004: Make __proto__ a real JavaScript accessor property. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed moar comments by Andreas Rossberg. Created 7 years, 9 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/accessors.cc ('k') | src/heap.h » ('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 f57a1f6fd8fb69cbb3ac633382283fa7e6556486..596b480b70f8526956264cc2d10b5f6511f0a351 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -477,25 +477,10 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
native_context()->set_object_function(*object_fun);
// Allocate a new prototype for the object function.
- Handle<Map> object_prototype_map =
- factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
- Handle<DescriptorArray> prototype_descriptors(
- factory->NewDescriptorArray(0, 1));
- DescriptorArray::WhitenessWitness witness(*prototype_descriptors);
-
- Handle<Foreign> object_prototype(
- factory->NewForeign(&Accessors::ObjectPrototype));
- PropertyAttributes attribs = static_cast<PropertyAttributes>(DONT_ENUM);
- object_prototype_map->set_instance_descriptors(*prototype_descriptors);
-
- { // Add __proto__.
- CallbacksDescriptor d(heap->proto_string(), *object_prototype, attribs);
- object_prototype_map->AppendDescriptor(&d, witness);
- }
-
- Handle<JSObject> prototype = factory->NewJSObjectFromMap(
- object_prototype_map,
+ Handle<JSObject> prototype = factory->NewJSObject(
+ isolate->object_function(),
TENURED);
+
native_context()->set_initial_object_prototype(*prototype);
SetPrototype(object_fun, prototype);
}
« no previous file with comments | « src/accessors.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698