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

Unified Diff: src/objects.cc

Issue 1424293002: Fix cached EnumLength retrieval in JSObject::NumberOfOwnProperties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | test/mjsunit/regress/regress-crbug-549162.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 7b223c084a371ea7043b70f30108a91405eb9678..79ee09ad21eb59107e6e540a0c4d9ee18be052c6 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14791,7 +14791,9 @@ int JSObject::NumberOfOwnProperties(PropertyAttributes filter) {
if (HasFastProperties()) {
Map* map = this->map();
if (filter == NONE) return map->NumberOfOwnDescriptors();
- if (filter & DONT_ENUM) {
+ if (filter == DONT_SHOW) {
+ // The cached enum length was computed with filter == DONT_SHOW, so
+ // that's the only filter for which it's valid to retrieve it.
int result = map->EnumLength();
if (result != kInvalidEnumCacheSentinel) return result;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-549162.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698