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

Unified Diff: src/bootstrapper.cc

Issue 2083353002: Cache Object.create maps on the passed prototype's PrototypeInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: properly set prototype Created 4 years, 6 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/builtins.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 199ac4125e6eb202e22bb2f9a88ea91452d99fcb..6ce80bffc1abea08ab3b2352f94cc2c3105fdbfd 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2994,6 +2994,14 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
native_context()->set_object_function_prototype_map(
HeapObject::cast(object_function->initial_map()->prototype())->map());
+ // Set up the map for Object.create(null) instances.
+ Handle<Map> object_with_null_prototype_map =
+ Map::CopyInitialMap(handle(object_function->initial_map(), isolate()));
+ Map::SetPrototype(object_with_null_prototype_map,
+ isolate()->factory()->null_value());
+ native_context()->set_object_with_null_prototype_map(
+ *object_with_null_prototype_map);
+
// Store the map for the %StringPrototype% after the natives has been compiled
// and the String function has been set up.
Handle<JSFunction> string_function(native_context()->string_function());
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698