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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // CopyElements, it copies all of elements from source after source_start to | 74 // CopyElements, it copies all of elements from source after source_start to |
75 // destination array, padding any remaining uninitialized elements in the | 75 // destination array, padding any remaining uninitialized elements in the |
76 // destination array with the hole. | 76 // destination array with the hole. |
77 static const int kCopyToEndAndInitializeToHole = -2; | 77 static const int kCopyToEndAndInitializeToHole = -2; |
78 | 78 |
79 // Copy all indices that have elements from |object| into the given | 79 // Copy all indices that have elements from |object| into the given |
80 // KeyAccumulator. For Dictionary-based element-kinds we filter out elements | 80 // KeyAccumulator. For Dictionary-based element-kinds we filter out elements |
81 // whose PropertyAttribute match |filter|. | 81 // whose PropertyAttribute match |filter|. |
82 virtual void CollectElementIndices(Handle<JSObject> object, | 82 virtual void CollectElementIndices(Handle<JSObject> object, |
83 Handle<FixedArrayBase> backing_store, | 83 Handle<FixedArrayBase> backing_store, |
84 KeyAccumulator* keys, | 84 KeyAccumulator* keys) = 0; |
85 uint32_t range = kMaxUInt32, | |
86 PropertyFilter filter = ALL_PROPERTIES, | |
87 uint32_t offset = 0) = 0; | |
88 | 85 |
89 inline void CollectElementIndices(Handle<JSObject> object, | 86 inline void CollectElementIndices(Handle<JSObject> object, |
90 KeyAccumulator* keys, | 87 KeyAccumulator* keys) { |
91 uint32_t range = kMaxUInt32, | 88 CollectElementIndices(object, handle(object->elements(), keys->isolate()), |
92 PropertyFilter filter = ALL_PROPERTIES, | 89 keys); |
93 uint32_t offset = 0) { | |
94 CollectElementIndices(object, handle(object->elements()), keys, range, | |
95 filter, offset); | |
96 } | 90 } |
97 | 91 |
98 virtual Maybe<bool> CollectValuesOrEntries( | 92 virtual Maybe<bool> CollectValuesOrEntries( |
99 Isolate* isolate, Handle<JSObject> object, | 93 Isolate* isolate, Handle<JSObject> object, |
100 Handle<FixedArray> values_or_entries, bool get_entries, int* nof_items, | 94 Handle<FixedArray> values_or_entries, bool get_entries, int* nof_items, |
101 PropertyFilter filter = ALL_PROPERTIES) = 0; | 95 PropertyFilter filter = ALL_PROPERTIES) = 0; |
102 | 96 |
103 // | |
104 virtual Handle<FixedArray> PrependElementIndices( | 97 virtual Handle<FixedArray> PrependElementIndices( |
105 Handle<JSObject> object, Handle<FixedArrayBase> backing_store, | 98 Handle<JSObject> object, Handle<FixedArrayBase> backing_store, |
106 Handle<FixedArray> keys, GetKeysConversion convert, | 99 Handle<FixedArray> keys, GetKeysConversion convert, |
107 PropertyFilter filter = ALL_PROPERTIES) = 0; | 100 PropertyFilter filter = ALL_PROPERTIES) = 0; |
108 | 101 |
109 inline Handle<FixedArray> PrependElementIndices( | 102 inline Handle<FixedArray> PrependElementIndices( |
110 Handle<JSObject> object, Handle<FixedArray> keys, | 103 Handle<JSObject> object, Handle<FixedArray> keys, |
111 GetKeysConversion convert, PropertyFilter filter = ALL_PROPERTIES) { | 104 GetKeysConversion convert, PropertyFilter filter = ALL_PROPERTIES) { |
112 return PrependElementIndices(object, handle(object->elements()), keys, | 105 return PrependElementIndices(object, handle(object->elements()), keys, |
113 convert, filter); | 106 convert, filter); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 bool allow_appending = false); | 187 bool allow_appending = false); |
195 | 188 |
196 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 189 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
197 Handle<JSArray> array, | 190 Handle<JSArray> array, |
198 Arguments* args); | 191 Arguments* args); |
199 | 192 |
200 } // namespace internal | 193 } // namespace internal |
201 } // namespace v8 | 194 } // namespace v8 |
202 | 195 |
203 #endif // V8_ELEMENTS_H_ | 196 #endif // V8_ELEMENTS_H_ |
OLD | NEW |