| 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 <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 10124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10135 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); | 10135 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); |
| 10136 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); | 10136 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); |
| 10137 | 10137 |
| 10138 // Initialize the array with the given capacity. The function may | 10138 // Initialize the array with the given capacity. The function may |
| 10139 // fail due to out-of-memory situations, but only if the requested | 10139 // fail due to out-of-memory situations, but only if the requested |
| 10140 // capacity is non-zero. | 10140 // capacity is non-zero. |
| 10141 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); | 10141 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); |
| 10142 | 10142 |
| 10143 // If the JSArray has fast elements, and new_length would result in | 10143 // If the JSArray has fast elements, and new_length would result in |
| 10144 // normalization, returns true. | 10144 // normalization, returns true. |
| 10145 bool SetLengthWouldNormalize(uint32_t new_length); |
| 10145 static inline bool SetLengthWouldNormalize(Heap* heap, uint32_t new_length); | 10146 static inline bool SetLengthWouldNormalize(Heap* heap, uint32_t new_length); |
| 10146 | 10147 |
| 10147 // Initializes the array to a certain length. | 10148 // Initializes the array to a certain length. |
| 10148 inline bool AllowsSetLength(); | 10149 inline bool AllowsSetLength(); |
| 10149 | 10150 |
| 10150 static void SetLength(Handle<JSArray> array, uint32_t length); | 10151 static void SetLength(Handle<JSArray> array, uint32_t length); |
| 10151 // Same as above but will also queue splice records if |array| is observed. | 10152 // Same as above but will also queue splice records if |array| is observed. |
| 10152 static MaybeHandle<Object> ObservableSetLength(Handle<JSArray> array, | 10153 static MaybeHandle<Object> ObservableSetLength(Handle<JSArray> array, |
| 10153 uint32_t length); | 10154 uint32_t length); |
| 10154 | 10155 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10809 } else { | 10810 } else { |
| 10810 value &= ~(1 << bit_position); | 10811 value &= ~(1 << bit_position); |
| 10811 } | 10812 } |
| 10812 return value; | 10813 return value; |
| 10813 } | 10814 } |
| 10814 }; | 10815 }; |
| 10815 | 10816 |
| 10816 } } // namespace v8::internal | 10817 } } // namespace v8::internal |
| 10817 | 10818 |
| 10818 #endif // V8_OBJECTS_H_ | 10819 #endif // V8_OBJECTS_H_ |
| OLD | NEW |