Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 9b55ea747545799a7f35aa4948bdcfad46dccd0b..020019da978d9ddd65f61028834bb6611fb2a147 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -1946,8 +1946,21 @@ class JSObject: public JSReceiver { |
// Also maximal value of JSArray's length property. |
static const uint32_t kMaxElementCount = 0xffffffffu; |
+ // Constants for heuristics controlling conversion of fast elements |
+ // to slow elements. |
+ |
+ // Maximal gap that can be introduced by adding an element beyond |
+ // the current elements length. |
static const uint32_t kMaxGap = 1024; |
- static const int kMaxFastElementsLength = 5000; |
+ |
+ // Maximal length of fast elements array that won't be checked for |
+ // being dense enough on expansion. |
+ static const int kMaxUncheckedFastElementsLength = 5000; |
+ |
+ // Same as above but for old arrays. This limit is more strict. We |
+ // don't want to be wasteful with long lived objects. |
+ static const int kMaxUncheckedOldFastElementsLength = 500; |
+ |
static const int kInitialMaxFastElementArray = 100000; |
static const int kMaxFastProperties = 12; |
static const int kMaxInstanceSize = 255 * kPointerSize; |
@@ -2013,6 +2026,9 @@ class JSObject: public JSReceiver { |
// Returns true if most of the elements backing storage is used. |
bool HasDenseElements(); |
+ // Gets the current elements capacity and the number of used elements. |
+ void GetElementsCapacityAndUsage(int* capacity, int* used); |
+ |
bool CanSetCallback(String* name); |
MUST_USE_RESULT MaybeObject* SetElementCallback( |
uint32_t index, |