OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 inline int GetInternalFieldCount(); | 2320 inline int GetInternalFieldCount(); |
2321 inline int GetInternalFieldOffset(int index); | 2321 inline int GetInternalFieldOffset(int index); |
2322 inline Object* GetInternalField(int index); | 2322 inline Object* GetInternalField(int index); |
2323 inline void SetInternalField(int index, Object* value); | 2323 inline void SetInternalField(int index, Object* value); |
2324 inline void SetInternalField(int index, Smi* value); | 2324 inline void SetInternalField(int index, Smi* value); |
2325 | 2325 |
2326 // Returns the number of properties on this object filtering out properties | 2326 // Returns the number of properties on this object filtering out properties |
2327 // with the specified attributes (ignoring interceptors). | 2327 // with the specified attributes (ignoring interceptors). |
2328 int NumberOfOwnProperties(PropertyAttributes filter = NONE); | 2328 int NumberOfOwnProperties(PropertyAttributes filter = NONE); |
2329 // Fill in details for properties into storage starting at the specified | 2329 // Fill in details for properties into storage starting at the specified |
2330 // index. | 2330 // index. Returns the number of properties that were added. |
2331 void GetOwnPropertyNames( | 2331 int GetOwnPropertyNames(FixedArray* storage, int index, |
2332 FixedArray* storage, int index, PropertyAttributes filter = NONE); | 2332 PropertyAttributes filter = NONE); |
2333 | 2333 |
2334 // Returns the number of properties on this object filtering out properties | 2334 // Returns the number of properties on this object filtering out properties |
2335 // with the specified attributes (ignoring interceptors). | 2335 // with the specified attributes (ignoring interceptors). |
2336 int NumberOfOwnElements(PropertyAttributes filter); | 2336 int NumberOfOwnElements(PropertyAttributes filter); |
2337 // Returns the number of enumerable elements (ignoring interceptors). | 2337 // Returns the number of enumerable elements (ignoring interceptors). |
2338 int NumberOfEnumElements(); | 2338 int NumberOfEnumElements(); |
2339 // Returns the number of elements on this object filtering out elements | 2339 // Returns the number of elements on this object filtering out elements |
2340 // with the specified attributes (ignoring interceptors). | 2340 // with the specified attributes (ignoring interceptors). |
2341 int GetOwnElementKeys(FixedArray* storage, PropertyAttributes filter); | 2341 int GetOwnElementKeys(FixedArray* storage, PropertyAttributes filter); |
2342 // Count and fill in the enumerable elements into storage. | 2342 // Count and fill in the enumerable elements into storage. |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3855 | 3855 |
3856 // Returns the number of enumerable elements in the dictionary. | 3856 // Returns the number of enumerable elements in the dictionary. |
3857 int NumberOfEnumElements(); | 3857 int NumberOfEnumElements(); |
3858 | 3858 |
3859 enum SortMode { UNSORTED, SORTED }; | 3859 enum SortMode { UNSORTED, SORTED }; |
3860 // Copies keys to preallocated fixed array. | 3860 // Copies keys to preallocated fixed array. |
3861 void CopyKeysTo(FixedArray* storage, | 3861 void CopyKeysTo(FixedArray* storage, |
3862 PropertyAttributes filter, | 3862 PropertyAttributes filter, |
3863 SortMode sort_mode); | 3863 SortMode sort_mode); |
3864 // Fill in details for properties into storage. | 3864 // Fill in details for properties into storage. |
3865 void CopyKeysTo(FixedArray* storage, | 3865 int CopyKeysTo(FixedArray* storage, int index, PropertyAttributes filter, |
3866 int index, | 3866 SortMode sort_mode); |
3867 PropertyAttributes filter, | |
3868 SortMode sort_mode); | |
3869 | 3867 |
3870 // Accessors for next enumeration index. | 3868 // Accessors for next enumeration index. |
3871 void SetNextEnumerationIndex(int index) { | 3869 void SetNextEnumerationIndex(int index) { |
3872 DCHECK(index != 0); | 3870 DCHECK(index != 0); |
3873 this->set(kNextEnumerationIndexIndex, Smi::FromInt(index)); | 3871 this->set(kNextEnumerationIndexIndex, Smi::FromInt(index)); |
3874 } | 3872 } |
3875 | 3873 |
3876 int NextEnumerationIndex() { | 3874 int NextEnumerationIndex() { |
3877 return Smi::cast(this->get(kNextEnumerationIndexIndex))->value(); | 3875 return Smi::cast(this->get(kNextEnumerationIndexIndex))->value(); |
3878 } | 3876 } |
(...skipping 7256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11135 } else { | 11133 } else { |
11136 value &= ~(1 << bit_position); | 11134 value &= ~(1 << bit_position); |
11137 } | 11135 } |
11138 return value; | 11136 return value; |
11139 } | 11137 } |
11140 }; | 11138 }; |
11141 | 11139 |
11142 } } // namespace v8::internal | 11140 } } // namespace v8::internal |
11143 | 11141 |
11144 #endif // V8_OBJECTS_H_ | 11142 #endif // V8_OBJECTS_H_ |
OLD | NEW |