| 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 "allocation.h" | 8 #include "allocation.h" |
| 9 #include "assert-scope.h" | 9 #include "assert-scope.h" |
| 10 #include "builtins.h" | 10 #include "builtins.h" |
| (...skipping 10319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10330 DECL_ACCESSORS(length, Object) | 10330 DECL_ACCESSORS(length, Object) |
| 10331 | 10331 |
| 10332 // Overload the length setter to skip write barrier when the length | 10332 // Overload the length setter to skip write barrier when the length |
| 10333 // is set to a smi. This matches the set function on FixedArray. | 10333 // is set to a smi. This matches the set function on FixedArray. |
| 10334 inline void set_length(Smi* length); | 10334 inline void set_length(Smi* length); |
| 10335 | 10335 |
| 10336 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, | 10336 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, |
| 10337 uint32_t index, | 10337 uint32_t index, |
| 10338 Handle<Object> value); | 10338 Handle<Object> value); |
| 10339 | 10339 |
| 10340 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); |
| 10341 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); |
| 10342 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); |
| 10343 |
| 10340 // Initialize the array with the given capacity. The function may | 10344 // Initialize the array with the given capacity. The function may |
| 10341 // fail due to out-of-memory situations, but only if the requested | 10345 // fail due to out-of-memory situations, but only if the requested |
| 10342 // capacity is non-zero. | 10346 // capacity is non-zero. |
| 10343 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); | 10347 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); |
| 10344 | 10348 |
| 10345 // Initializes the array to a certain length. | 10349 // Initializes the array to a certain length. |
| 10346 inline bool AllowsSetElementsLength(); | 10350 inline bool AllowsSetElementsLength(); |
| 10347 // Can cause GC. | 10351 // Can cause GC. |
| 10348 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( | 10352 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( |
| 10349 Handle<JSArray> array, | 10353 Handle<JSArray> array, |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11117 } else { | 11121 } else { |
| 11118 value &= ~(1 << bit_position); | 11122 value &= ~(1 << bit_position); |
| 11119 } | 11123 } |
| 11120 return value; | 11124 return value; |
| 11121 } | 11125 } |
| 11122 }; | 11126 }; |
| 11123 | 11127 |
| 11124 } } // namespace v8::internal | 11128 } } // namespace v8::internal |
| 11125 | 11129 |
| 11126 #endif // V8_OBJECTS_H_ | 11130 #endif // V8_OBJECTS_H_ |
| OLD | NEW |