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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 MUST_USE_RESULT inline MaybeHandle<FixedArray> AddElementsToFixedArray( | 173 MUST_USE_RESULT inline MaybeHandle<FixedArray> AddElementsToFixedArray( |
174 Handle<Object> receiver, Handle<JSObject> holder, Handle<FixedArray> to, | 174 Handle<Object> receiver, Handle<JSObject> holder, Handle<FixedArray> to, |
175 FixedArray::KeyFilter filter) { | 175 FixedArray::KeyFilter filter) { |
176 return AddElementsToFixedArray(receiver, holder, to, | 176 return AddElementsToFixedArray(receiver, holder, to, |
177 handle(holder->elements()), filter); | 177 handle(holder->elements()), filter); |
178 } | 178 } |
179 | 179 |
180 // Returns a shared ElementsAccessor for the specified ElementsKind. | 180 // Returns a shared ElementsAccessor for the specified ElementsKind. |
181 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 181 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
182 DCHECK(elements_kind < kElementsKindCount); | 182 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
183 return elements_accessors_[elements_kind]; | 183 return elements_accessors_[elements_kind]; |
184 } | 184 } |
185 | 185 |
186 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); | 186 static ElementsAccessor* ForArray(Handle<FixedArrayBase> array); |
187 | 187 |
188 static void InitializeOncePerProcess(); | 188 static void InitializeOncePerProcess(); |
189 static void TearDown(); | 189 static void TearDown(); |
190 | 190 |
191 protected: | 191 protected: |
192 friend class SloppyArgumentsElementsAccessor; | 192 friend class SloppyArgumentsElementsAccessor; |
(...skipping 21 matching lines...) Expand all Loading... |
214 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 214 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
215 bool allow_appending = false); | 215 bool allow_appending = false); |
216 | 216 |
217 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 217 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
218 Handle<JSArray> array, | 218 Handle<JSArray> array, |
219 Arguments* args); | 219 Arguments* args); |
220 | 220 |
221 } } // namespace v8::internal | 221 } } // namespace v8::internal |
222 | 222 |
223 #endif // V8_ELEMENTS_H_ | 223 #endif // V8_ELEMENTS_H_ |
OLD | NEW |