| 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" |
| 11 #include "src/keys.h" | 11 #include "src/key-accumulator.h" |
| 12 #include "src/objects.h" | 12 #include "src/objects.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 // Abstract base class for handles that can operate on objects with differing | 17 // Abstract base class for handles that can operate on objects with differing |
| 18 // ElementsKinds. | 18 // ElementsKinds. |
| 19 class ElementsAccessor { | 19 class ElementsAccessor { |
| 20 public: | 20 public: |
| 21 explicit ElementsAccessor(const char* name) : name_(name) { } | 21 explicit ElementsAccessor(const char* name) : name_(name) { } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 inline void CollectElementIndices(Handle<JSObject> object, | 93 inline void CollectElementIndices(Handle<JSObject> object, |
| 94 KeyAccumulator* keys, | 94 KeyAccumulator* keys, |
| 95 uint32_t range = kMaxUInt32, | 95 uint32_t range = kMaxUInt32, |
| 96 PropertyFilter filter = ALL_PROPERTIES, | 96 PropertyFilter filter = ALL_PROPERTIES, |
| 97 uint32_t offset = 0) { | 97 uint32_t offset = 0) { |
| 98 CollectElementIndices(object, handle(object->elements()), keys, range, | 98 CollectElementIndices(object, handle(object->elements()), keys, range, |
| 99 filter, offset); | 99 filter, offset); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // | |
| 103 virtual Handle<FixedArray> PrependElementIndices( | |
| 104 Handle<JSObject> object, Handle<FixedArrayBase> backing_store, | |
| 105 Handle<FixedArray> keys, GetKeysConversion convert, | |
| 106 PropertyFilter filter = ALL_PROPERTIES) = 0; | |
| 107 | |
| 108 inline Handle<FixedArray> PrependElementIndices( | |
| 109 Handle<JSObject> object, Handle<FixedArray> keys, | |
| 110 GetKeysConversion convert, PropertyFilter filter = ALL_PROPERTIES) { | |
| 111 return PrependElementIndices(object, handle(object->elements()), keys, | |
| 112 convert, filter); | |
| 113 } | |
| 114 | |
| 115 virtual void AddElementsToKeyAccumulator(Handle<JSObject> receiver, | 102 virtual void AddElementsToKeyAccumulator(Handle<JSObject> receiver, |
| 116 KeyAccumulator* accumulator, | 103 KeyAccumulator* accumulator, |
| 117 AddKeyConversion convert) = 0; | 104 AddKeyConversion convert) = 0; |
| 118 | 105 |
| 119 virtual void GrowCapacityAndConvert(Handle<JSObject> object, | 106 virtual void GrowCapacityAndConvert(Handle<JSObject> object, |
| 120 uint32_t capacity) = 0; | 107 uint32_t capacity) = 0; |
| 121 | 108 |
| 122 static void InitializeOncePerProcess(); | 109 static void InitializeOncePerProcess(); |
| 123 static void TearDown(); | 110 static void TearDown(); |
| 124 | 111 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 bool allow_appending = false); | 183 bool allow_appending = false); |
| 197 | 184 |
| 198 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 185 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
| 199 Handle<JSArray> array, | 186 Handle<JSArray> array, |
| 200 Arguments* args); | 187 Arguments* args); |
| 201 | 188 |
| 202 } // namespace internal | 189 } // namespace internal |
| 203 } // namespace v8 | 190 } // namespace v8 |
| 204 | 191 |
| 205 #endif // V8_ELEMENTS_H_ | 192 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |