Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index ba690ecab52c1cfafbe4a2e511134fc247a4328d..664d8cf481c28d8d1b696574922bfe2a0bb032f7 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -630,8 +630,10 @@ enum CompareResult { |
| WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \ |
| +class ElementsHandler; |
| class StringStream; |
| class ObjectVisitor; |
| +class DictionaryElementsHandlerImpl; |
| struct ValueInfo : public Malloced { |
| ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { } |
| @@ -1488,6 +1490,7 @@ class JSObject: public JSReceiver { |
| inline void initialize_elements(); |
| MUST_USE_RESULT inline MaybeObject* ResetElements(); |
| inline ElementsKind GetElementsKind(); |
| + inline ElementsHandler* GetElementsHandler(); |
| inline bool HasFastElements(); |
| inline bool HasFastDoubleElements(); |
| inline bool HasDictionaryElements(); |
| @@ -1733,11 +1736,6 @@ class JSObject: public JSReceiver { |
| MaybeObject* GetElementWithReceiver(Object* receiver, uint32_t index); |
| MaybeObject* GetElementWithInterceptor(Object* receiver, uint32_t index); |
| - // Get external element value at index if there is one and undefined |
| - // otherwise. Can return a failure if allocation of a heap number |
| - // failed. |
| - MaybeObject* GetExternalElement(uint32_t index); |
| - |
| // Replace the elements' backing store with fast elements of the given |
| // capacity. Update the length for JSArrays. Returns the new backing |
| // store. |
| @@ -2001,6 +1999,8 @@ class JSObject: public JSReceiver { |
| }; |
| private: |
| + friend class DictionaryElementsHandlerImpl; |
| + |
| MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, |
| Object* structure, |
| uint32_t index, |
| @@ -2021,7 +2021,7 @@ class JSObject: public JSReceiver { |
| StrictModeFlag strict_mode, |
| bool check_prototype); |
| - MaybeObject* GetElementPostInterceptor(Object* receiver, uint32_t index); |
| + // MaybeObject* GetElementPostInterceptor(Object* receiver, uint32_t index); |
|
Jakob Kummerow
2011/07/30 10:29:21
nit: remove the line instead of commenting it out.
danno
2011/07/30 13:10:10
Done.
|
| MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(String* name, |
| DeleteMode mode); |
| @@ -2092,6 +2092,7 @@ class FixedArray: public FixedArrayBase { |
| inline Object* get(int index); |
| // Setter that uses write barrier. |
| inline void set(int index, Object* value); |
| + inline bool is_the_hole(int index); |
| // Setter that doesn't need write barrier). |
| inline void set(int index, Smi* value); |
| @@ -2197,7 +2198,8 @@ class FixedDoubleArray: public FixedArrayBase { |
| inline void Initialize(NumberDictionary* from); |
| // Setter and getter for elements. |
| - inline double get(int index); |
| + inline double get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, double value); |
| inline void set_the_hole(int index); |
| @@ -3129,6 +3131,8 @@ class ExternalArray: public HeapObject { |
| inline int length(); |
| inline void set_length(int value); |
| + inline bool is_the_hole(int index) { return false; } |
| + |
| // [external_pointer]: The pointer to the external memory area backing this |
| // external array. |
| DECL_ACCESSORS(external_pointer, void) // Pointer to the data store. |
| @@ -3164,7 +3168,8 @@ class ExternalPixelArray: public ExternalArray { |
| inline uint8_t* external_pixel_pointer(); |
| // Setter and getter. |
| - inline uint8_t get(int index); |
| + inline uint8_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, uint8_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber and |
| @@ -3192,7 +3197,8 @@ class ExternalPixelArray: public ExternalArray { |
| class ExternalByteArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline int8_t get(int index); |
| + inline int8_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, int8_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3220,7 +3226,8 @@ class ExternalByteArray: public ExternalArray { |
| class ExternalUnsignedByteArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline uint8_t get(int index); |
| + inline uint8_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, uint8_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3248,7 +3255,8 @@ class ExternalUnsignedByteArray: public ExternalArray { |
| class ExternalShortArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline int16_t get(int index); |
| + inline int16_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, int16_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3276,7 +3284,8 @@ class ExternalShortArray: public ExternalArray { |
| class ExternalUnsignedShortArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline uint16_t get(int index); |
| + inline uint16_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, uint16_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3304,7 +3313,8 @@ class ExternalUnsignedShortArray: public ExternalArray { |
| class ExternalIntArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline int32_t get(int index); |
| + inline int32_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, int32_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3332,7 +3342,8 @@ class ExternalIntArray: public ExternalArray { |
| class ExternalUnsignedIntArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline uint32_t get(int index); |
| + inline uint32_t get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, uint32_t value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3360,7 +3371,8 @@ class ExternalUnsignedIntArray: public ExternalArray { |
| class ExternalFloatArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline float get(int index); |
| + inline float get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, float value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |
| @@ -3388,7 +3400,8 @@ class ExternalFloatArray: public ExternalArray { |
| class ExternalDoubleArray: public ExternalArray { |
| public: |
| // Setter and getter. |
| - inline double get(int index); |
| + inline double get_scalar(int index); |
| + inline MaybeObject* get(int index); |
| inline void set(int index, double value); |
| // This accessor applies the correct conversion from Smi, HeapNumber |