Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 5007) |
+++ src/objects-inl.h (working copy) |
@@ -1335,6 +1335,21 @@ |
} |
+bool JSObject::HasFastProperties() { |
+ return !properties()->IsDictionary(); |
+} |
+ |
+ |
+int JSObject::MaxFastProperties() { |
+ // Allow extra fast properties if the object has more than |
+ // kMaxFastProperties in-object properties. When this is the case, |
+ // it is very unlikely that the object is being used as a dictionary |
+ // and there is a good chance that allowing more map transitions |
+ // will be worth it. |
+ return Max(map()->inobject_properties(), kMaxFastProperties); |
+} |
+ |
+ |
void Struct::InitializeBody(int object_size) { |
Object* value = Heap::undefined_value(); |
for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) { |
@@ -1343,11 +1358,6 @@ |
} |
-bool JSObject::HasFastProperties() { |
- return !properties()->IsDictionary(); |
-} |
- |
- |
bool Object::ToArrayIndex(uint32_t* index) { |
if (IsSmi()) { |
int value = Smi::cast(this)->value(); |