OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 3770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3781 // with the specified attributes. | 3781 // with the specified attributes. |
3782 int NumberOfElementsFilterAttributes(PropertyFilter filter); | 3782 int NumberOfElementsFilterAttributes(PropertyFilter filter); |
3783 | 3783 |
3784 // Returns the number of enumerable elements in the dictionary. | 3784 // Returns the number of enumerable elements in the dictionary. |
3785 int NumberOfEnumElements() { | 3785 int NumberOfEnumElements() { |
3786 return NumberOfElementsFilterAttributes(ENUMERABLE_STRINGS); | 3786 return NumberOfElementsFilterAttributes(ENUMERABLE_STRINGS); |
3787 } | 3787 } |
3788 | 3788 |
3789 enum SortMode { UNSORTED, SORTED }; | 3789 enum SortMode { UNSORTED, SORTED }; |
3790 | 3790 |
| 3791 // Return the key indices sorted by its enumeration index. |
| 3792 static Handle<FixedArray> GetOrderedKeyIndices( |
| 3793 Handle<Dictionary<Derived, Shape, Key>> dictionary); |
| 3794 |
3791 // Collect the keys into the given KeyAccumulator, in ascending chronological | 3795 // Collect the keys into the given KeyAccumulator, in ascending chronological |
3792 // order of property creation. | 3796 // order of property creation. |
3793 static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary, | 3797 static void CollectKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary, |
3794 KeyAccumulator* keys); | 3798 KeyAccumulator* keys); |
3795 | 3799 |
3796 // Copies enumerable keys to preallocated fixed array. | 3800 // Copies enumerable keys to preallocated fixed array. |
3797 static void CopyEnumKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary, | 3801 static void CopyEnumKeysTo(Handle<Dictionary<Derived, Shape, Key>> dictionary, |
3798 Handle<FixedArray> storage, KeyCollectionMode mode, | 3802 Handle<FixedArray> storage, KeyCollectionMode mode, |
3799 KeyAccumulator* accumulator); | 3803 KeyAccumulator* accumulator); |
3800 | 3804 |
(...skipping 8106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11907 } | 11911 } |
11908 return value; | 11912 return value; |
11909 } | 11913 } |
11910 }; | 11914 }; |
11911 | 11915 |
11912 | 11916 |
11913 } // NOLINT, false-positive due to second-order macros. | 11917 } // NOLINT, false-positive due to second-order macros. |
11914 } // NOLINT, false-positive due to second-order macros. | 11918 } // NOLINT, false-positive due to second-order macros. |
11915 | 11919 |
11916 #endif // V8_OBJECTS_H_ | 11920 #endif // V8_OBJECTS_H_ |
OLD | NEW |