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

Unified Diff: src/objects-inl.h

Issue 392243002: Reimplement SetProperty using the LookupIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/stub-cache.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 b01c49d2b4fcb66b8f949b622e1c9ea1d1c0d2f5..d348dc07bacccd4ece13ec577eaa988a5ee33961 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2079,23 +2079,12 @@ bool JSObject::HasFastProperties() {
}
-bool JSObject::TooManyFastProperties(StoreFromKeyed store_mode) {
- // Allow extra fast properties if the object has more than
- // kFastPropertiesSoftLimit 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.
- Map* map = this->map();
- if (map->unused_property_fields() != 0) return false;
-
- int inobject = map->inobject_properties();
-
- int limit;
- if (store_mode == CERTAINLY_NOT_STORE_FROM_KEYED) {
- limit = Max(inobject, kMaxFastProperties);
- } else {
- limit = Max(inobject, kFastPropertiesSoftLimit);
- }
- return properties()->length() > limit;
+bool Map::TooManyFastProperties(StoreFromKeyed store_mode) {
+ if (unused_property_fields() != 0) return false;
+ int minimum = store_mode == CERTAINLY_NOT_STORE_FROM_KEYED ? 128 : 12;
+ int limit = Max(minimum, inobject_properties());
+ int external = NumberOfFields() - inobject_properties();
+ return external > limit;
}
« no previous file with comments | « src/objects.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698