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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // GetCapacity. Keys refer to elements in terms of the value that would be | 246 // GetCapacity. Keys refer to elements in terms of the value that would be |
247 // specified in JavaScript to access the element. In most implementations, | 247 // specified in JavaScript to access the element. In most implementations, |
248 // keys are equivalent to indexes, and GetKeyForIndex returns the same value | 248 // keys are equivalent to indexes, and GetKeyForIndex returns the same value |
249 // it is passed. In the NumberDictionary ElementsAccessor, GetKeyForIndex maps | 249 // it is passed. In the NumberDictionary ElementsAccessor, GetKeyForIndex maps |
250 // the index to a key using the KeyAt method on the NumberDictionary. | 250 // the index to a key using the KeyAt method on the NumberDictionary. |
251 virtual uint32_t GetKeyForIndex(Handle<FixedArrayBase> backing_store, | 251 virtual uint32_t GetKeyForIndex(Handle<FixedArrayBase> backing_store, |
252 uint32_t index) = 0; | 252 uint32_t index) = 0; |
253 | 253 |
254 // TODO(ishell): Non-handlified versions, used only by accessors' | 254 // TODO(ishell): Non-handlified versions, used only by accessors' |
255 // implementations. To be removed once elements.cc is handlified. | 255 // implementations. To be removed once elements.cc is handlified. |
256 MUST_USE_RESULT virtual MaybeObject* Get( | |
257 Object* receiver, | |
258 JSObject* holder, | |
259 uint32_t key, | |
260 FixedArrayBase* backing_store) = 0; | |
261 | |
262 MUST_USE_RESULT virtual PropertyAttributes GetAttributes( | 256 MUST_USE_RESULT virtual PropertyAttributes GetAttributes( |
263 Object* receiver, | 257 Object* receiver, |
264 JSObject* holder, | 258 JSObject* holder, |
265 uint32_t key, | 259 uint32_t key, |
266 FixedArrayBase* backing_store) = 0; | 260 FixedArrayBase* backing_store) = 0; |
267 | 261 |
268 MUST_USE_RESULT virtual PropertyType GetType( | 262 MUST_USE_RESULT virtual PropertyType GetType( |
269 Object* receiver, | 263 Object* receiver, |
270 JSObject* holder, | 264 JSObject* holder, |
271 uint32_t key, | 265 uint32_t key, |
272 FixedArrayBase* backing_store) = 0; | 266 FixedArrayBase* backing_store) = 0; |
273 | 267 |
274 private: | 268 private: |
275 static ElementsAccessor** elements_accessors_; | 269 static ElementsAccessor** elements_accessors_; |
276 const char* name_; | 270 const char* name_; |
277 | 271 |
278 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); | 272 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); |
279 }; | 273 }; |
280 | 274 |
281 void CheckArrayAbuse(JSObject* obj, const char* op, uint32_t key, | 275 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
282 bool allow_appending = false); | 276 bool allow_appending = false); |
283 | 277 |
284 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, | 278 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, |
285 Arguments* args); | 279 Arguments* args); |
286 | 280 |
287 } } // namespace v8::internal | 281 } } // namespace v8::internal |
288 | 282 |
289 #endif // V8_ELEMENTS_H_ | 283 #endif // V8_ELEMENTS_H_ |
OLD | NEW |