| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2182 // the elements array may be shared by a few objects and so before | 2182 // the elements array may be shared by a few objects and so before |
| 2183 // writing to any element the array must be copied. Use | 2183 // writing to any element the array must be copied. Use |
| 2184 // EnsureWritableFastElements in this case. | 2184 // EnsureWritableFastElements in this case. |
| 2185 // | 2185 // |
| 2186 // In the slow mode the elements is either a NumberDictionary, an | 2186 // In the slow mode the elements is either a NumberDictionary, an |
| 2187 // ExternalArray, or a FixedArray parameter map for a (sloppy) | 2187 // ExternalArray, or a FixedArray parameter map for a (sloppy) |
| 2188 // arguments object. | 2188 // arguments object. |
| 2189 DECL_ACCESSORS(elements, FixedArrayBase) | 2189 DECL_ACCESSORS(elements, FixedArrayBase) |
| 2190 inline void initialize_elements(); | 2190 inline void initialize_elements(); |
| 2191 MUST_USE_RESULT inline MaybeObject* ResetElements(); | 2191 MUST_USE_RESULT inline MaybeObject* ResetElements(); |
| 2192 static void ResetElements(Handle<JSObject> object); |
| 2193 static inline void SetMapAndElements(Handle<JSObject> object, |
| 2194 Handle<Map> map, |
| 2195 Handle<FixedArrayBase> elements); |
| 2192 inline ElementsKind GetElementsKind(); | 2196 inline ElementsKind GetElementsKind(); |
| 2193 inline ElementsAccessor* GetElementsAccessor(); | 2197 inline ElementsAccessor* GetElementsAccessor(); |
| 2194 // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind. | 2198 // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind. |
| 2195 inline bool HasFastSmiElements(); | 2199 inline bool HasFastSmiElements(); |
| 2196 // Returns true if an object has elements of FAST_ELEMENTS ElementsKind. | 2200 // Returns true if an object has elements of FAST_ELEMENTS ElementsKind. |
| 2197 inline bool HasFastObjectElements(); | 2201 inline bool HasFastObjectElements(); |
| 2198 // Returns true if an object has elements of FAST_ELEMENTS or | 2202 // Returns true if an object has elements of FAST_ELEMENTS or |
| 2199 // FAST_SMI_ONLY_ELEMENTS. | 2203 // FAST_SMI_ONLY_ELEMENTS. |
| 2200 inline bool HasFastSmiOrObjectElements(); | 2204 inline bool HasFastSmiOrObjectElements(); |
| 2201 // Returns true if an object has any of the fast elements kinds. | 2205 // Returns true if an object has any of the fast elements kinds. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2230 inline bool HasFixedUint16Elements(); | 2234 inline bool HasFixedUint16Elements(); |
| 2231 inline bool HasFixedInt32Elements(); | 2235 inline bool HasFixedInt32Elements(); |
| 2232 inline bool HasFixedUint32Elements(); | 2236 inline bool HasFixedUint32Elements(); |
| 2233 inline bool HasFixedFloat32Elements(); | 2237 inline bool HasFixedFloat32Elements(); |
| 2234 inline bool HasFixedFloat64Elements(); | 2238 inline bool HasFixedFloat64Elements(); |
| 2235 | 2239 |
| 2236 bool HasFastArgumentsElements(); | 2240 bool HasFastArgumentsElements(); |
| 2237 bool HasDictionaryArgumentsElements(); | 2241 bool HasDictionaryArgumentsElements(); |
| 2238 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. | 2242 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. |
| 2239 | 2243 |
| 2240 inline void set_map_and_elements( | |
| 2241 Map* map, | |
| 2242 FixedArrayBase* value, | |
| 2243 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | |
| 2244 | |
| 2245 // Requires: HasFastElements(). | 2244 // Requires: HasFastElements(). |
| 2246 static Handle<FixedArray> EnsureWritableFastElements( | 2245 static Handle<FixedArray> EnsureWritableFastElements( |
| 2247 Handle<JSObject> object); | 2246 Handle<JSObject> object); |
| 2248 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); | 2247 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); |
| 2249 | 2248 |
| 2250 // Collects elements starting at index 0. | 2249 // Collects elements starting at index 0. |
| 2251 // Undefined values are placed after non-undefined values. | 2250 // Undefined values are placed after non-undefined values. |
| 2252 // Returns the number of non-undefined values. | 2251 // Returns the number of non-undefined values. |
| 2253 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, | 2252 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, |
| 2254 uint32_t limit); | 2253 uint32_t limit); |
| (...skipping 8568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10823 } else { | 10822 } else { |
| 10824 value &= ~(1 << bit_position); | 10823 value &= ~(1 << bit_position); |
| 10825 } | 10824 } |
| 10826 return value; | 10825 return value; |
| 10827 } | 10826 } |
| 10828 }; | 10827 }; |
| 10829 | 10828 |
| 10830 } } // namespace v8::internal | 10829 } } // namespace v8::internal |
| 10831 | 10830 |
| 10832 #endif // V8_OBJECTS_H_ | 10831 #endif // V8_OBJECTS_H_ |
| OLD | NEW |