| Index: src/elements.h
|
| ===================================================================
|
| --- src/elements.h (revision 9006)
|
| +++ src/elements.h (working copy)
|
| @@ -39,22 +39,51 @@
|
| public:
|
| ElementsAccessor() { }
|
| virtual ~ElementsAccessor() { }
|
| - virtual MaybeObject* GetWithReceiver(JSObject* obj,
|
| - Object* receiver,
|
| - uint32_t index) = 0;
|
| + virtual MaybeObject* Get(FixedArrayBase* backing_store,
|
| + uint32_t key,
|
| + JSObject* holder,
|
| + Object* receiver) = 0;
|
|
|
| - virtual MaybeObject* Delete(JSObject* obj,
|
| - uint32_t index,
|
| + virtual MaybeObject* Delete(JSObject* holder,
|
| + uint32_t key,
|
| JSReceiver::DeleteMode mode) = 0;
|
|
|
| + virtual MaybeObject* AddElementsToFixedArray(FixedArrayBase* from,
|
| + FixedArray* to,
|
| + JSObject* holder,
|
| + Object* receiver) = 0;
|
| +
|
| // Returns a shared ElementsAccessor for the specified ElementsKind.
|
| static ElementsAccessor* ForKind(JSObject::ElementsKind elements_kind) {
|
| ASSERT(elements_kind < JSObject::kElementsKindCount);
|
| return elements_accessors_[elements_kind];
|
| }
|
|
|
| + static ElementsAccessor* ForArray(FixedArrayBase* array);
|
| +
|
| static void InitializeOncePerProcess();
|
|
|
| + protected:
|
| + friend class NonStrictArgumentsElementsAccessor;
|
| +
|
| + virtual uint32_t GetCapacity(FixedArrayBase* backing_store) = 0;
|
| +
|
| + virtual bool HasElementAtIndex(FixedArrayBase* backing_store,
|
| + uint32_t index,
|
| + JSObject* holder,
|
| + Object* receiver) = 0;
|
| +
|
| + // Element handlers distinguish between indexes and keys when the manipulate
|
| + // elements. Indexes refer to elements in terms of their location in the
|
| + // underlying storage's backing store representation, and are between 0
|
| + // GetCapacity. Keys refer to elements in terms of the value that would be
|
| + // specific in JavaScript to access the element. In most implementations, keys
|
| + // are equivalent to indexes, and GetKeyForIndex returns the same value it is
|
| + // passed. In the NumberDictionary ElementsAccessor, GetKeyForIndex maps the
|
| + // index to a key using the KeyAt method on the NumberDictionary.
|
| + virtual uint32_t GetKeyForIndex(FixedArrayBase* backing_store,
|
| + uint32_t index) = 0;
|
| +
|
| private:
|
| static ElementsAccessor** elements_accessors_;
|
|
|
|
|