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

Unified Diff: src/objects.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 | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 9e8b06c6fc467e8ca7668d039df96b29a9f9c4eb..dc403d90b049390354bb824ba39e1a98a7a226dd 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3432,7 +3432,8 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map,
if (expected_additional_properties > 0) {
property_count += expected_additional_properties;
} else {
- property_count += 2; // Make space for two more properties.
+ // Make space for two more properties.
+ property_count += NameDictionary::kInitialCapacity;
}
Handle<NameDictionary> dictionary =
NameDictionary::New(isolate, property_count);
@@ -16774,7 +16775,8 @@ Handle<Derived> HashTable<Derived, Shape, Key>::New(
MinimumCapacity capacity_option,
PretenureFlag pretenure) {
DCHECK(0 <= at_least_space_for);
- DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for));
+ DCHECK_IMPLIES(capacity_option == USE_CUSTOM_MINIMUM_CAPACITY,
+ base::bits::IsPowerOfTwo32(at_least_space_for));
int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY)
? at_least_space_for
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698