Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: src/elements.h

Issue 2521043005: [elements] Add CreateFromArrayLike fast-path for JS_ARRAY_TYPE (Closed)
Patch Set: merge with master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // semantics) 168 // semantics)
169 virtual Maybe<int64_t> IndexOfValue(Isolate* isolate, 169 virtual Maybe<int64_t> IndexOfValue(Isolate* isolate,
170 Handle<JSObject> receiver, 170 Handle<JSObject> receiver,
171 Handle<Object> value, uint32_t start, 171 Handle<Object> value, uint32_t start,
172 uint32_t length) = 0; 172 uint32_t length) = 0;
173 173
174 virtual void CopyElements(Handle<FixedArrayBase> source, 174 virtual void CopyElements(Handle<FixedArrayBase> source,
175 ElementsKind source_kind, 175 ElementsKind source_kind,
176 Handle<FixedArrayBase> destination, int size) = 0; 176 Handle<FixedArrayBase> destination, int size) = 0;
177 177
178 virtual Handle<FixedArray> CreateListFromArray(Isolate* isolate,
179 Handle<JSArray> array) = 0;
180
178 protected: 181 protected:
179 friend class LookupIterator; 182 friend class LookupIterator;
180 183
181 // Element handlers distinguish between entries and indices when they 184 // Element handlers distinguish between entries and indices when they
182 // manipulate elements. Entries refer to elements in terms of their location 185 // manipulate elements. Entries refer to elements in terms of their location
183 // in the underlying storage's backing store representation, and are between 0 186 // in the underlying storage's backing store representation, and are between 0
184 // and GetCapacity. Indices refer to elements in terms of the value that would 187 // and GetCapacity. Indices refer to elements in terms of the value that would
185 // be specified in JavaScript to access the element. In most implementations, 188 // be specified in JavaScript to access the element. In most implementations,
186 // indices are equivalent to entries. In the NumberDictionary 189 // indices are equivalent to entries. In the NumberDictionary
187 // ElementsAccessor, entries are mapped to an index using the KeyAt method on 190 // ElementsAccessor, entries are mapped to an index using the KeyAt method on
(...skipping 22 matching lines...) Expand all
210 bool allow_appending = false); 213 bool allow_appending = false);
211 214
212 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( 215 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements(
213 Handle<JSArray> array, 216 Handle<JSArray> array,
214 Arguments* args); 217 Arguments* args);
215 218
216 } // namespace internal 219 } // namespace internal
217 } // namespace v8 220 } // namespace v8
218 221
219 #endif // V8_ELEMENTS_H_ 222 #endif // V8_ELEMENTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698