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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 static Handle<FixedArray> EnsureWritableFastElements( | 2235 static Handle<FixedArray> EnsureWritableFastElements( |
2236 Handle<JSObject> object); | 2236 Handle<JSObject> object); |
2237 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); | 2237 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); |
2238 | 2238 |
2239 // Collects elements starting at index 0. | 2239 // Collects elements starting at index 0. |
2240 // Undefined values are placed after non-undefined values. | 2240 // Undefined values are placed after non-undefined values. |
2241 // Returns the number of non-undefined values. | 2241 // Returns the number of non-undefined values. |
2242 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, | 2242 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, |
2243 uint32_t limit); | 2243 uint32_t limit); |
2244 // As PrepareElementsForSort, but only on objects where elements is | 2244 // As PrepareElementsForSort, but only on objects where elements is |
2245 // a dictionary, and it will stay a dictionary. | 2245 // a dictionary, and it will stay a dictionary. Collates undefined and |
| 2246 // unexisting elements below limit from position zero of the elements. |
2246 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, | 2247 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, |
2247 uint32_t limit); | 2248 uint32_t limit); |
2248 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit); | |
2249 | 2249 |
2250 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithCallback( | 2250 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithCallback( |
2251 Handle<JSObject> object, | 2251 Handle<JSObject> object, |
2252 Handle<Object> receiver, | 2252 Handle<Object> receiver, |
2253 Handle<Object> structure, | 2253 Handle<Object> structure, |
2254 Handle<Name> name); | 2254 Handle<Name> name); |
2255 | 2255 |
2256 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithCallback( | 2256 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithCallback( |
2257 Handle<JSObject> object, | 2257 Handle<JSObject> object, |
2258 Handle<Object> structure, | 2258 Handle<Object> structure, |
(...skipping 8006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10265 DECL_ACCESSORS(length, Object) | 10265 DECL_ACCESSORS(length, Object) |
10266 | 10266 |
10267 // Overload the length setter to skip write barrier when the length | 10267 // Overload the length setter to skip write barrier when the length |
10268 // is set to a smi. This matches the set function on FixedArray. | 10268 // is set to a smi. This matches the set function on FixedArray. |
10269 inline void set_length(Smi* length); | 10269 inline void set_length(Smi* length); |
10270 | 10270 |
10271 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, | 10271 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, |
10272 uint32_t index, | 10272 uint32_t index, |
10273 Handle<Object> value); | 10273 Handle<Object> value); |
10274 | 10274 |
10275 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index, | |
10276 Object* value); | |
10277 | |
10278 // Initialize the array with the given capacity. The function may | 10275 // Initialize the array with the given capacity. The function may |
10279 // fail due to out-of-memory situations, but only if the requested | 10276 // fail due to out-of-memory situations, but only if the requested |
10280 // capacity is non-zero. | 10277 // capacity is non-zero. |
10281 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); | 10278 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); |
10282 | 10279 |
10283 // Initializes the array to a certain length. | 10280 // Initializes the array to a certain length. |
10284 inline bool AllowsSetElementsLength(); | 10281 inline bool AllowsSetElementsLength(); |
10285 // Can cause GC. | 10282 // Can cause GC. |
10286 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( | 10283 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( |
10287 Handle<JSArray> array, | 10284 Handle<JSArray> array, |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11057 } else { | 11054 } else { |
11058 value &= ~(1 << bit_position); | 11055 value &= ~(1 << bit_position); |
11059 } | 11056 } |
11060 return value; | 11057 return value; |
11061 } | 11058 } |
11062 }; | 11059 }; |
11063 | 11060 |
11064 } } // namespace v8::internal | 11061 } } // namespace v8::internal |
11065 | 11062 |
11066 #endif // V8_OBJECTS_H_ | 11063 #endif // V8_OBJECTS_H_ |
OLD | NEW |