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 10167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10178 | 10178 |
10179 // Overload the length setter to skip write barrier when the length | 10179 // Overload the length setter to skip write barrier when the length |
10180 // is set to a smi. This matches the set function on FixedArray. | 10180 // is set to a smi. This matches the set function on FixedArray. |
10181 inline void set_length(Smi* length); | 10181 inline void set_length(Smi* length); |
10182 | 10182 |
10183 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, | 10183 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, |
10184 uint32_t index, | 10184 uint32_t index, |
10185 Handle<Object> value); | 10185 Handle<Object> value); |
10186 | 10186 |
10187 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); | 10187 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map); |
| 10188 static bool HasReadOnlyLength(Handle<JSArray> array); |
10188 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); | 10189 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); |
10189 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); | 10190 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); |
10190 | 10191 |
10191 // Initialize the array with the given capacity. The function may | 10192 // Initialize the array with the given capacity. The function may |
10192 // fail due to out-of-memory situations, but only if the requested | 10193 // fail due to out-of-memory situations, but only if the requested |
10193 // capacity is non-zero. | 10194 // capacity is non-zero. |
10194 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); | 10195 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); |
10195 | 10196 |
10196 // Initializes the array to a certain length. | 10197 // Initializes the array to a certain length. |
10197 inline bool AllowsSetElementsLength(); | 10198 inline bool AllowsSetElementsLength(); |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10961 } else { | 10962 } else { |
10962 value &= ~(1 << bit_position); | 10963 value &= ~(1 << bit_position); |
10963 } | 10964 } |
10964 return value; | 10965 return value; |
10965 } | 10966 } |
10966 }; | 10967 }; |
10967 | 10968 |
10968 } } // namespace v8::internal | 10969 } } // namespace v8::internal |
10969 | 10970 |
10970 #endif // V8_OBJECTS_H_ | 10971 #endif // V8_OBJECTS_H_ |
OLD | NEW |