OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 25 matching lines...) Expand all Loading... |
36 // Abstract base class for handles that can operate on objects with differing | 36 // Abstract base class for handles that can operate on objects with differing |
37 // ElementsKinds. | 37 // ElementsKinds. |
38 class ElementsAccessor { | 38 class ElementsAccessor { |
39 public: | 39 public: |
40 ElementsAccessor() { } | 40 ElementsAccessor() { } |
41 virtual ~ElementsAccessor() { } | 41 virtual ~ElementsAccessor() { } |
42 virtual MaybeObject* GetWithReceiver(JSObject* obj, | 42 virtual MaybeObject* GetWithReceiver(JSObject* obj, |
43 Object* receiver, | 43 Object* receiver, |
44 uint32_t index) = 0; | 44 uint32_t index) = 0; |
45 | 45 |
| 46 virtual MaybeObject* Delete(JSObject* obj, |
| 47 uint32_t index, |
| 48 JSReceiver::DeleteMode mode) = 0; |
| 49 |
46 // Returns a shared ElementsAccessor for the specified ElementsKind. | 50 // Returns a shared ElementsAccessor for the specified ElementsKind. |
47 static ElementsAccessor* ForKind(JSObject::ElementsKind elements_kind) { | 51 static ElementsAccessor* ForKind(JSObject::ElementsKind elements_kind) { |
48 ASSERT(elements_kind < JSObject::kElementsKindCount); | 52 ASSERT(elements_kind < JSObject::kElementsKindCount); |
49 return elements_accessors_[elements_kind]; | 53 return elements_accessors_[elements_kind]; |
50 } | 54 } |
51 | 55 |
52 static void InitializeOncePerProcess(); | 56 static void InitializeOncePerProcess(); |
53 | 57 |
54 private: | 58 private: |
55 static ElementsAccessor** elements_accessors_; | 59 static ElementsAccessor** elements_accessors_; |
56 | 60 |
57 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); | 61 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); |
58 }; | 62 }; |
59 | 63 |
60 } } // namespace v8::internal | 64 } } // namespace v8::internal |
61 | 65 |
62 #endif // V8_ELEMENTS_H_ | 66 #endif // V8_ELEMENTS_H_ |
OLD | NEW |