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

Unified Diff: src/bootstrapper.cc

Issue 2430273007: [runtime] Object.create(null) creates a slow object (Closed)
Patch Set: fix GC mole issue Created 4 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 | « no previous file | src/builtins/builtins-object.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 0d55fb101a59a21c4b703c9331f907bb5c97cbdd..184de03d08292f0a60efe3fce545ee8e89ed0c23 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3528,12 +3528,13 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
HeapObject::cast(object_function->initial_map()->prototype())->map());
// Set up the map for Object.create(null) instances.
- Handle<Map> object_with_null_prototype_map =
+ Handle<Map> slow_object_with_null_prototype_map =
Map::CopyInitialMap(handle(object_function->initial_map(), isolate()));
- Map::SetPrototype(object_with_null_prototype_map,
+ slow_object_with_null_prototype_map->set_dictionary_map(true);
+ Map::SetPrototype(slow_object_with_null_prototype_map,
isolate()->factory()->null_value());
- native_context()->set_object_with_null_prototype_map(
- *object_with_null_prototype_map);
+ native_context()->set_slow_object_with_null_prototype_map(
+ *slow_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.
« no previous file with comments | « no previous file | src/builtins/builtins-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698