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

Unified Diff: src/objects.cc

Issue 581013003: Revert "Don't use OwnPrototypeChainLength in GetOwnPropertyNames" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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.h ('k') | src/runtime.cc » ('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 eb428aa1860a4410ccb473cb99a2150e16c75b5a..38b56d2e50c03ea02d30b5b56aff3a2eadc51d4e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13346,24 +13346,23 @@ void FixedArray::SortPairs(FixedArray* numbers, uint32_t len) {
// Fill in the names of own properties into the supplied storage. The main
// purpose of this function is to provide reflection information for the object
// mirrors.
-int JSObject::GetOwnPropertyNames(FixedArray* storage, int index,
- PropertyAttributes filter) {
+void JSObject::GetOwnPropertyNames(
+ FixedArray* storage, int index, PropertyAttributes filter) {
DCHECK(storage->length() >= (NumberOfOwnProperties(filter) - index));
if (HasFastProperties()) {
- int offset = 0;
int real_size = map()->NumberOfOwnDescriptors();
DescriptorArray* descs = map()->instance_descriptors();
for (int i = 0; i < real_size; i++) {
if ((descs->GetDetails(i).attributes() & filter) == 0 &&
!FilterKey(descs->GetKey(i), filter)) {
- storage->set(index + offset, descs->GetKey(i));
- offset++;
+ storage->set(index++, descs->GetKey(i));
}
}
- return offset;
} else {
- return property_dictionary()->CopyKeysTo(storage, index, filter,
- NameDictionary::UNSORTED);
+ property_dictionary()->CopyKeysTo(storage,
+ index,
+ filter,
+ NameDictionary::UNSORTED);
}
}
@@ -14056,11 +14055,13 @@ template Handle<SeededNumberDictionary>
HashTable<SeededNumberDictionary, SeededNumberDictionaryShape, uint32_t>::
Shrink(Handle<SeededNumberDictionary>, uint32_t);
-template int
- Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::CopyKeysTo(
- FixedArray*, int, PropertyAttributes,
- Dictionary<NameDictionary, NameDictionaryShape,
- Handle<Name> >::SortMode);
+template void Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::
+ CopyKeysTo(
+ FixedArray*,
+ int,
+ PropertyAttributes,
+ Dictionary<
+ NameDictionary, NameDictionaryShape, Handle<Name> >::SortMode);
template int
Dictionary<NameDictionary, NameDictionaryShape, Handle<Name> >::
@@ -15207,28 +15208,27 @@ void NameDictionary::CopyEnumKeysTo(FixedArray* storage) {
}
-template <typename Derived, typename Shape, typename Key>
-int Dictionary<Derived, Shape, Key>::CopyKeysTo(
- FixedArray* storage, int index, PropertyAttributes filter,
+template<typename Derived, typename Shape, typename Key>
+void Dictionary<Derived, Shape, Key>::CopyKeysTo(
+ FixedArray* storage,
+ int index,
+ PropertyAttributes filter,
typename Dictionary<Derived, Shape, Key>::SortMode sort_mode) {
DCHECK(storage->length() >= NumberOfElementsFilterAttributes(filter));
int capacity = DerivedHashTable::Capacity();
- int offset = 0;
for (int i = 0; i < capacity; i++) {
Object* k = DerivedHashTable::KeyAt(i);
if (DerivedHashTable::IsKey(k) && !FilterKey(k, filter)) {
PropertyDetails details = DetailsAt(i);
if (details.IsDeleted()) continue;
PropertyAttributes attr = details.attributes();
- if ((attr & filter) == 0) storage->set(index + offset, k);
- offset++;
+ if ((attr & filter) == 0) storage->set(index++, k);
}
}
if (sort_mode == Dictionary::SORTED) {
- storage->SortPairs(storage, index + offset);
+ storage->SortPairs(storage, index);
}
- DCHECK(storage->length() >= index + offset);
- return offset;
+ DCHECK(storage->length() >= index);
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698