| 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_ELEMENTS_H_ | 5 #ifndef V8_ELEMENTS_H_ |
| 6 #define V8_ELEMENTS_H_ | 6 #define V8_ELEMENTS_H_ |
| 7 | 7 |
| 8 #include "src/elements-kind.h" | 8 #include "src/elements-kind.h" |
| 9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 inline void CopyElements( | 153 inline void CopyElements( |
| 154 Handle<JSObject> from_holder, | 154 Handle<JSObject> from_holder, |
| 155 Handle<FixedArrayBase> to, | 155 Handle<FixedArrayBase> to, |
| 156 ElementsKind from_kind) { | 156 ElementsKind from_kind) { |
| 157 CopyElements( | 157 CopyElements( |
| 158 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole); | 158 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole); |
| 159 } | 159 } |
| 160 | 160 |
| 161 MUST_USE_RESULT virtual MaybeHandle<FixedArray> AddElementsToFixedArray( | 161 MUST_USE_RESULT virtual MaybeHandle<FixedArray> AddElementsToFixedArray( |
| 162 Handle<Object> receiver, Handle<JSObject> holder, Handle<FixedArray> to, | 162 Handle<JSObject> receiver, Handle<FixedArray> to, |
| 163 Handle<FixedArrayBase> from, FixedArray::KeyFilter filter) = 0; | 163 FixedArray::KeyFilter filter) = 0; |
| 164 | |
| 165 MUST_USE_RESULT inline MaybeHandle<FixedArray> AddElementsToFixedArray( | |
| 166 Handle<Object> receiver, Handle<JSObject> holder, Handle<FixedArray> to, | |
| 167 FixedArray::KeyFilter filter) { | |
| 168 return AddElementsToFixedArray(receiver, holder, to, | |
| 169 handle(holder->elements()), filter); | |
| 170 } | |
| 171 | 164 |
| 172 // Returns a shared ElementsAccessor for the specified ElementsKind. | 165 // Returns a shared ElementsAccessor for the specified ElementsKind. |
| 173 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 166 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
| 174 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 167 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
| 175 return elements_accessors_[elements_kind]; | 168 return elements_accessors_[elements_kind]; |
| 176 } | 169 } |
| 177 | 170 |
| 178 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); | 171 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); |
| 179 | 172 |
| 180 static void InitializeOncePerProcess(); | 173 static void InitializeOncePerProcess(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 207 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 200 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
| 208 bool allow_appending = false); | 201 bool allow_appending = false); |
| 209 | 202 |
| 210 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 203 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
| 211 Handle<JSArray> array, | 204 Handle<JSArray> array, |
| 212 Arguments* args); | 205 Arguments* args); |
| 213 | 206 |
| 214 } } // namespace v8::internal | 207 } } // namespace v8::internal |
| 215 | 208 |
| 216 #endif // V8_ELEMENTS_H_ | 209 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |