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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 Handle<Object> value, uint32_t start, | 163 Handle<Object> value, uint32_t start, |
164 uint32_t length) = 0; | 164 uint32_t length) = 0; |
165 | 165 |
166 // Check an Object's own elements for the index of an element (using SameValue | 166 // Check an Object's own elements for the index of an element (using SameValue |
167 // semantics) | 167 // semantics) |
168 virtual Maybe<int64_t> IndexOfValue(Isolate* isolate, | 168 virtual Maybe<int64_t> IndexOfValue(Isolate* isolate, |
169 Handle<JSObject> receiver, | 169 Handle<JSObject> receiver, |
170 Handle<Object> value, uint32_t start, | 170 Handle<Object> value, uint32_t start, |
171 uint32_t length) = 0; | 171 uint32_t length) = 0; |
172 | 172 |
| 173 virtual void CopyElements(Handle<FixedArrayBase> source, |
| 174 ElementsKind source_kind, |
| 175 Handle<FixedArrayBase> destination, int size) = 0; |
| 176 |
173 protected: | 177 protected: |
174 friend class LookupIterator; | 178 friend class LookupIterator; |
175 | 179 |
176 // Element handlers distinguish between entries and indices when they | 180 // Element handlers distinguish between entries and indices when they |
177 // manipulate elements. Entries refer to elements in terms of their location | 181 // manipulate elements. Entries refer to elements in terms of their location |
178 // in the underlying storage's backing store representation, and are between 0 | 182 // in the underlying storage's backing store representation, and are between 0 |
179 // and GetCapacity. Indices refer to elements in terms of the value that would | 183 // and GetCapacity. Indices refer to elements in terms of the value that would |
180 // be specified in JavaScript to access the element. In most implementations, | 184 // be specified in JavaScript to access the element. In most implementations, |
181 // indices are equivalent to entries. In the NumberDictionary | 185 // indices are equivalent to entries. In the NumberDictionary |
182 // ElementsAccessor, entries are mapped to an index using the KeyAt method on | 186 // ElementsAccessor, entries are mapped to an index using the KeyAt method on |
(...skipping 22 matching lines...) Expand all Loading... |
205 bool allow_appending = false); | 209 bool allow_appending = false); |
206 | 210 |
207 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 211 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
208 Handle<JSArray> array, | 212 Handle<JSArray> array, |
209 Arguments* args); | 213 Arguments* args); |
210 | 214 |
211 } // namespace internal | 215 } // namespace internal |
212 } // namespace v8 | 216 } // namespace v8 |
213 | 217 |
214 #endif // V8_ELEMENTS_H_ | 218 #endif // V8_ELEMENTS_H_ |
OLD | NEW |