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

Unified Diff: src/objects-inl.h

Issue 2818041: Use the number of in-object properties when deciding how many fast... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698