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

Side by Side Diff: src/elements.h

Issue 1172683003: Use the LookupIterator for SetElement and friends (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update reconfigure data property for sloppy arguments Created 5 years, 6 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
« no previous file with comments | « src/ast.cc ('k') | src/elements.cc » ('j') | src/objects.h » ('J')
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 25 matching lines...) Expand all
36 Handle<JSObject> holder, 36 Handle<JSObject> holder,
37 uint32_t key, 37 uint32_t key,
38 Handle<FixedArrayBase> backing_store) = 0; 38 Handle<FixedArrayBase> backing_store) = 0;
39 39
40 inline bool HasElement( 40 inline bool HasElement(
41 Handle<JSObject> holder, 41 Handle<JSObject> holder,
42 uint32_t key) { 42 uint32_t key) {
43 return HasElement(holder, key, handle(holder->elements())); 43 return HasElement(holder, key, handle(holder->elements()));
44 } 44 }
45 45
46 inline Handle<Object> Set(Handle<JSObject> holder, uint32_t key,
47 Handle<Object> value) {
48 return Set(holder, key, handle(holder->elements()), value);
49 }
Igor Sheludko 2015/06/11 14:38:18 Empty line is missing.
46 // Returns the element with the specified key or undefined if there is no such 50 // Returns the element with the specified key or undefined if there is no such
47 // element. This method doesn't iterate up the prototype chain. The caller 51 // element. This method doesn't iterate up the prototype chain. The caller
48 // can optionally pass in the backing store to use for the check, which must 52 // can optionally pass in the backing store to use for the check, which must
49 // be compatible with the ElementsKind of the ElementsAccessor. If 53 // be compatible with the ElementsKind of the ElementsAccessor. If
50 // backing_store is NULL, the holder->elements() is used as the backing store. 54 // backing_store is NULL, the holder->elements() is used as the backing store.
51 virtual Handle<Object> Get(Handle<JSObject> holder, uint32_t key, 55 virtual Handle<Object> Get(Handle<JSObject> holder, uint32_t key,
52 Handle<FixedArrayBase> backing_store) = 0; 56 Handle<FixedArrayBase> backing_store) = 0;
53 57
54 inline Handle<Object> Get(Handle<JSObject> holder, uint32_t key) { 58 inline Handle<Object> Get(Handle<JSObject> holder, uint32_t key) {
55 return Get(holder, key, handle(holder->elements())); 59 return Get(holder, key, handle(holder->elements()));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // the index to a key using the KeyAt method on the NumberDictionary. 185 // the index to a key using the KeyAt method on the NumberDictionary.
182 virtual uint32_t GetKeyForIndex(FixedArrayBase* backing_store, 186 virtual uint32_t GetKeyForIndex(FixedArrayBase* backing_store,
183 uint32_t index) = 0; 187 uint32_t index) = 0;
184 virtual uint32_t GetIndexForKey(FixedArrayBase* backing_store, 188 virtual uint32_t GetIndexForKey(FixedArrayBase* backing_store,
185 uint32_t key) = 0; 189 uint32_t key) = 0;
186 virtual PropertyDetails GetDetails(FixedArrayBase* backing_store, 190 virtual PropertyDetails GetDetails(FixedArrayBase* backing_store,
187 uint32_t index) = 0; 191 uint32_t index) = 0;
188 virtual bool HasIndex(FixedArrayBase* backing_store, uint32_t key) = 0; 192 virtual bool HasIndex(FixedArrayBase* backing_store, uint32_t key) = 0;
189 193
190 private: 194 private:
195 virtual Handle<Object> Set(Handle<JSObject> holder, uint32_t key,
Igor Sheludko 2015/06/11 14:38:18 Please make it protected.
196 Handle<FixedArrayBase> backing_store,
197 Handle<Object> value) = 0;
198
191 static ElementsAccessor** elements_accessors_; 199 static ElementsAccessor** elements_accessors_;
192 const char* name_; 200 const char* name_;
193 201
194 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); 202 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor);
195 }; 203 };
196 204
197 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, 205 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key,
198 bool allow_appending = false); 206 bool allow_appending = false);
199 207
200 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( 208 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements(
201 Handle<JSArray> array, 209 Handle<JSArray> array,
202 Arguments* args); 210 Arguments* args);
203 211
204 } } // namespace v8::internal 212 } } // namespace v8::internal
205 213
206 #endif // V8_ELEMENTS_H_ 214 #endif // V8_ELEMENTS_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/elements.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698