OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // store is available, it can be passed in source and source_holder is | 151 // store is available, it can be passed in source and source_holder is |
152 // ignored. | 152 // ignored. |
153 virtual void CopyElements( | 153 virtual void CopyElements( |
154 Handle<JSObject> source_holder, | 154 Handle<JSObject> source_holder, |
155 uint32_t source_start, | 155 uint32_t source_start, |
156 ElementsKind source_kind, | 156 ElementsKind source_kind, |
157 Handle<FixedArrayBase> destination, | 157 Handle<FixedArrayBase> destination, |
158 uint32_t destination_start, | 158 uint32_t destination_start, |
159 int copy_size, | 159 int copy_size, |
160 Handle<FixedArrayBase> source = Handle<FixedArrayBase>::null()) = 0; | 160 Handle<FixedArrayBase> source = Handle<FixedArrayBase>::null()) = 0; |
161 MUST_USE_RESULT virtual MaybeObject* CopyElements( | |
162 JSObject* source_holder, | |
163 uint32_t source_start, | |
164 ElementsKind source_kind, | |
165 FixedArrayBase* destination, | |
166 uint32_t destination_start, | |
167 int copy_size, | |
168 FixedArrayBase* source = NULL) = 0; | |
169 | 161 |
170 void CopyElements( | 162 void CopyElements( |
171 Handle<JSObject> from_holder, | 163 Handle<JSObject> from_holder, |
172 Handle<FixedArrayBase> to, | 164 Handle<FixedArrayBase> to, |
173 ElementsKind from_kind, | 165 ElementsKind from_kind, |
174 Handle<FixedArrayBase> from = Handle<FixedArrayBase>::null()) { | 166 Handle<FixedArrayBase> from = Handle<FixedArrayBase>::null()) { |
175 CopyElements(from_holder, 0, from_kind, to, 0, | 167 CopyElements(from_holder, 0, from_kind, to, 0, |
176 kCopyToEndAndInitializeToHole, from); | 168 kCopyToEndAndInitializeToHole, from); |
177 } | 169 } |
178 | 170 |
179 MUST_USE_RESULT MaybeObject* CopyElements(JSObject* from_holder, | |
180 FixedArrayBase* to, | |
181 ElementsKind from_kind, | |
182 FixedArrayBase* from = NULL) { | |
183 return CopyElements(from_holder, 0, from_kind, to, 0, | |
184 kCopyToEndAndInitializeToHole, from); | |
185 } | |
186 | |
187 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray( | 171 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray( |
188 Object* receiver, | 172 Object* receiver, |
189 JSObject* holder, | 173 JSObject* holder, |
190 FixedArray* to, | 174 FixedArray* to, |
191 FixedArrayBase* from = NULL) = 0; | 175 FixedArrayBase* from = NULL) = 0; |
192 | 176 |
193 // Returns a shared ElementsAccessor for the specified ElementsKind. | 177 // Returns a shared ElementsAccessor for the specified ElementsKind. |
194 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 178 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
195 ASSERT(elements_kind < kElementsKindCount); | 179 ASSERT(elements_kind < kElementsKindCount); |
196 return elements_accessors_[elements_kind]; | 180 return elements_accessors_[elements_kind]; |
(...skipping 29 matching lines...) Expand all Loading... |
226 | 210 |
227 void CheckArrayAbuse(JSObject* obj, const char* op, uint32_t key, | 211 void CheckArrayAbuse(JSObject* obj, const char* op, uint32_t key, |
228 bool allow_appending = false); | 212 bool allow_appending = false); |
229 | 213 |
230 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, | 214 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, |
231 Arguments* args); | 215 Arguments* args); |
232 | 216 |
233 } } // namespace v8::internal | 217 } } // namespace v8::internal |
234 | 218 |
235 #endif // V8_ELEMENTS_H_ | 219 #endif // V8_ELEMENTS_H_ |
OLD | NEW |