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