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

Unified Diff: src/objects-inl.h

Issue 1218403002: Increment descriptor array slack for prototypes by a constant rather than 50% (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More comments Created 5 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 | « src/objects.cc ('k') | src/transitions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0007b37ca99a85ebc7643c9309e7a78834847e5d..0e43e1d3a0fbd434bf311fa3dffc579b3b73a3ee 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5092,6 +5092,7 @@ ACCESSORS(CallHandlerInfo, callback, Object, kCallbackOffset)
ACCESSORS(CallHandlerInfo, data, Object, kDataOffset)
ACCESSORS(TemplateInfo, tag, Object, kTagOffset)
+SMI_ACCESSORS(TemplateInfo, number_of_properties, kNumberOfProperties)
ACCESSORS(TemplateInfo, property_list, Object, kPropertyListOffset)
ACCESSORS(TemplateInfo, property_accessors, Object, kPropertyAccessorsOffset)
@@ -6945,11 +6946,13 @@ void Map::ClearCodeCache(Heap* heap) {
}
-int Map::SlackForArraySize(int old_size, int size_limit) {
+int Map::SlackForArraySize(bool is_prototype_map, int old_size,
+ int size_limit) {
const int max_slack = size_limit - old_size;
- CHECK(max_slack >= 0);
+ CHECK_LE(0, max_slack);
if (old_size < 4) return Min(max_slack, 1);
- return Min(max_slack, old_size / 2);
+ if (is_prototype_map) return Min(max_slack, 4);
+ return Min(max_slack, old_size / 4);
}
« no previous file with comments | « src/objects.cc ('k') | src/transitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698