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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 virtual void Add(Handle<JSObject> object, uint32_t index, | 124 virtual void Add(Handle<JSObject> object, uint32_t index, |
125 Handle<Object> value, PropertyAttributes attributes, | 125 Handle<Object> value, PropertyAttributes attributes, |
126 uint32_t new_capacity) = 0; | 126 uint32_t new_capacity) = 0; |
127 | 127 |
128 // TODO(cbruni): Consider passing Arguments* instead of Object** depending on | 128 // TODO(cbruni): Consider passing Arguments* instead of Object** depending on |
129 // the requirements of future callers. | 129 // the requirements of future callers. |
130 virtual uint32_t Push(Handle<JSArray> receiver, | 130 virtual uint32_t Push(Handle<JSArray> receiver, |
131 Handle<FixedArrayBase> backing_store, Object** objects, | 131 Handle<FixedArrayBase> backing_store, Object** objects, |
132 uint32_t start, int direction) = 0; | 132 uint32_t start, int direction) = 0; |
133 | 133 |
| 134 virtual Handle<JSArray> Splice(Handle<JSArray> receiver, |
| 135 Handle<FixedArrayBase> backing_store, |
| 136 uint32_t start, uint32_t delete_count, |
| 137 Arguments args, uint32_t add_count) = 0; |
| 138 |
134 protected: | 139 protected: |
135 friend class LookupIterator; | 140 friend class LookupIterator; |
136 | 141 |
137 static ElementsAccessor* ForArray(FixedArrayBase* array); | 142 static ElementsAccessor* ForArray(FixedArrayBase* array); |
138 | 143 |
139 virtual uint32_t GetCapacity(JSObject* holder, | 144 virtual uint32_t GetCapacity(JSObject* holder, |
140 FixedArrayBase* backing_store) = 0; | 145 FixedArrayBase* backing_store) = 0; |
141 | 146 |
142 // Element handlers distinguish between entries and indices when they | 147 // Element handlers distinguish between entries and indices when they |
143 // manipulate elements. Entries refer to elements in terms of their location | 148 // manipulate elements. Entries refer to elements in terms of their location |
(...skipping 19 matching lines...) Expand all Loading... |
163 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t index, | 168 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t index, |
164 bool allow_appending = false); | 169 bool allow_appending = false); |
165 | 170 |
166 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 171 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
167 Handle<JSArray> array, | 172 Handle<JSArray> array, |
168 Arguments* args); | 173 Arguments* args); |
169 | 174 |
170 } } // namespace v8::internal | 175 } } // namespace v8::internal |
171 | 176 |
172 #endif // V8_ELEMENTS_H_ | 177 #endif // V8_ELEMENTS_H_ |
OLD | NEW |