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 30 matching lines...) Expand all Loading... |
41 class ElementsAccessor { | 41 class ElementsAccessor { |
42 public: | 42 public: |
43 explicit ElementsAccessor(const char* name) : name_(name) { } | 43 explicit ElementsAccessor(const char* name) : name_(name) { } |
44 virtual ~ElementsAccessor() { } | 44 virtual ~ElementsAccessor() { } |
45 | 45 |
46 virtual ElementsKind kind() const = 0; | 46 virtual ElementsKind kind() const = 0; |
47 const char* name() const { return name_; } | 47 const char* name() const { return name_; } |
48 | 48 |
49 // Checks the elements of an object for consistency, asserting when a problem | 49 // Checks the elements of an object for consistency, asserting when a problem |
50 // is found. | 50 // is found. |
51 virtual void Validate(JSObject* obj) = 0; | 51 virtual void Validate(Handle<JSObject> obj) = 0; |
52 | 52 |
53 // Returns true if a holder contains an element with the specified key | 53 // Returns true if a holder contains an element with the specified key |
54 // without iterating up the prototype chain. The caller can optionally pass | 54 // without iterating up the prototype chain. The caller can optionally pass |
55 // in the backing store to use for the check, which must be compatible with | 55 // in the backing store to use for the check, which must be compatible with |
56 // the ElementsKind of the ElementsAccessor. If backing_store is NULL, the | 56 // the ElementsKind of the ElementsAccessor. If backing_store is NULL, the |
57 // holder->elements() is used as the backing store. | 57 // holder->elements() is used as the backing store. |
58 virtual bool HasElement( | 58 virtual bool HasElement( |
59 Handle<Object> receiver, | 59 Handle<Object> receiver, |
60 Handle<JSObject> holder, | 60 Handle<JSObject> holder, |
61 uint32_t key, | 61 uint32_t key, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 void CheckArrayAbuse(JSObject* obj, const char* op, uint32_t key, | 274 void CheckArrayAbuse(JSObject* obj, const char* op, uint32_t key, |
275 bool allow_appending = false); | 275 bool allow_appending = false); |
276 | 276 |
277 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, | 277 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, |
278 Arguments* args); | 278 Arguments* args); |
279 | 279 |
280 } } // namespace v8::internal | 280 } } // namespace v8::internal |
281 | 281 |
282 #endif // V8_ELEMENTS_H_ | 282 #endif // V8_ELEMENTS_H_ |
OLD | NEW |