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

Side by Side Diff: src/elements.h

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a basic impl in ElementsAccessor, cleanup %ArrayIncludes_Slow, lots of new tests Created 4 years, 5 months 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 virtual Handle<Object> Pop(Handle<JSArray> receiver) = 0; 146 virtual Handle<Object> Pop(Handle<JSArray> receiver) = 0;
147 147
148 virtual Handle<Object> Shift(Handle<JSArray> receiver) = 0; 148 virtual Handle<Object> Shift(Handle<JSArray> receiver) = 0;
149 149
150 virtual Handle<SeededNumberDictionary> Normalize(Handle<JSObject> object) = 0; 150 virtual Handle<SeededNumberDictionary> Normalize(Handle<JSObject> object) = 0;
151 151
152 virtual uint32_t GetCapacity(JSObject* holder, 152 virtual uint32_t GetCapacity(JSObject* holder,
153 FixedArrayBase* backing_store) = 0; 153 FixedArrayBase* backing_store) = 0;
154 154
155 // Check an Object's own elements for an element (using SameValueZero
156 // semantics)
157 virtual Maybe<bool> IncludesValue(Isolate* isolate, Handle<JSObject> receiver,
158 Handle<Object> value, uint32_t start,
159 uint32_t length) = 0;
160
155 protected: 161 protected:
156 friend class LookupIterator; 162 friend class LookupIterator;
157 163
158 // Element handlers distinguish between entries and indices when they 164 // Element handlers distinguish between entries and indices when they
159 // manipulate elements. Entries refer to elements in terms of their location 165 // manipulate elements. Entries refer to elements in terms of their location
160 // in the underlying storage's backing store representation, and are between 0 166 // in the underlying storage's backing store representation, and are between 0
161 // and GetCapacity. Indices refer to elements in terms of the value that would 167 // and GetCapacity. Indices refer to elements in terms of the value that would
162 // be specified in JavaScript to access the element. In most implementations, 168 // be specified in JavaScript to access the element. In most implementations,
163 // indices are equivalent to entries. In the NumberDictionary 169 // indices are equivalent to entries. In the NumberDictionary
164 // ElementsAccessor, entries are mapped to an index using the KeyAt method on 170 // ElementsAccessor, entries are mapped to an index using the KeyAt method on
(...skipping 22 matching lines...) Expand all
187 bool allow_appending = false); 193 bool allow_appending = false);
188 194
189 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( 195 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements(
190 Handle<JSArray> array, 196 Handle<JSArray> array,
191 Arguments* args); 197 Arguments* args);
192 198
193 } // namespace internal 199 } // namespace internal
194 } // namespace v8 200 } // namespace v8
195 201
196 #endif // V8_ELEMENTS_H_ 202 #endif // V8_ELEMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698