1 // Copyright 2018 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_OBJECTS_ELEMENTS_INL_H_
6 #define V8_OBJECTS_ELEMENTS_INL_H_
7
8 #include "src/common/globals.h"
9 #include "src/objects/elements.h"
10
11 #include "src/handles/handles-inl.h"
12 #include "src/objects/objects-inl.h"
13
14 namespace v8 {
15 namespace internal {
16
17 V8_WARN_UNUSED_RESULT inline ExceptionStatus
CollectElementIndices(Handle<JSObject> object,KeyAccumulator * keys)18 ElementsAccessor::CollectElementIndices(Handle<JSObject> object,
19 KeyAccumulator* keys) {
20 return CollectElementIndices(
21 object, handle(object->elements(), keys->isolate()), keys);
22 }
23
PrependElementIndices(Handle<JSObject> object,Handle<FixedArray> keys,GetKeysConversion convert,PropertyFilter filter)24 inline MaybeHandle<FixedArray> ElementsAccessor::PrependElementIndices(
25 Handle<JSObject> object, Handle<FixedArray> keys, GetKeysConversion convert,
26 PropertyFilter filter) {
27 return PrependElementIndices(object,
28 handle(object->elements(), object->GetIsolate()),
29 keys, convert, filter);
30 }
31
HasElement(JSObject holder,uint32_t index,PropertyFilter filter)32 inline bool ElementsAccessor::HasElement(JSObject holder, uint32_t index,
33 PropertyFilter filter) {
34 return HasElement(holder, index, holder.elements(), filter);
35 }
36
37 } // namespace internal
38 } // namespace v8
39
40 #endif // V8_OBJECTS_ELEMENTS_INL_H_
41