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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 ElementsKind from_kind) { | 95 ElementsKind from_kind) { |
96 CopyElements( | 96 CopyElements( |
97 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole); | 97 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole); |
98 } | 98 } |
99 | 99 |
100 virtual void GrowCapacityAndConvert(Handle<JSObject> object, | 100 virtual void GrowCapacityAndConvert(Handle<JSObject> object, |
101 uint32_t capacity) = 0; | 101 uint32_t capacity) = 0; |
102 | 102 |
103 virtual void AddElementsToKeyAccumulator(Handle<JSObject> receiver, | 103 virtual void AddElementsToKeyAccumulator(Handle<JSObject> receiver, |
104 KeyAccumulator* accumulator, | 104 KeyAccumulator* accumulator, |
105 FixedArray::KeyFilter filter) = 0; | 105 KeyFilter filter) = 0; |
106 | 106 |
107 // Returns a shared ElementsAccessor for the specified ElementsKind. | 107 // Returns a shared ElementsAccessor for the specified ElementsKind. |
108 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 108 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
109 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 109 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
110 return elements_accessors_[elements_kind]; | 110 return elements_accessors_[elements_kind]; |
111 } | 111 } |
112 | 112 |
113 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); | 113 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); |
114 | 114 |
115 static void InitializeOncePerProcess(); | 115 static void InitializeOncePerProcess(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 bool allow_appending = false); | 186 bool allow_appending = false); |
187 | 187 |
188 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 188 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
189 Handle<JSArray> array, | 189 Handle<JSArray> array, |
190 Arguments* args); | 190 Arguments* args); |
191 | 191 |
192 } // namespace internal | 192 } // namespace internal |
193 } // namespace v8 | 193 } // namespace v8 |
194 | 194 |
195 #endif // V8_ELEMENTS_H_ | 195 #endif // V8_ELEMENTS_H_ |
OLD | NEW |