diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-15 09:57:36 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-15 09:57:36 (GMT) |
commit | 336dfcef05cb63df0a6d550b59a4badc7a0f01c1 (patch) | |
tree | a218ec97413e0c8ebc9600ac5db9b2adea485b32 /src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h | |
parent | e44d64510e019e5d3b379b704cfb824e0d7ccc9d (diff) | |
download | Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.zip Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.gz Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.bz2 |
Merge of master
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h index e280022..ea490d8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h @@ -25,7 +25,7 @@ namespace JSC { - typedef HashMap<unsigned, JSValuePtr> SparseArrayValueMap; + typedef HashMap<unsigned, JSValue> SparseArrayValueMap; struct ArrayStorage { unsigned m_length; @@ -33,7 +33,7 @@ namespace JSC { unsigned m_numValuesInVector; SparseArrayValueMap* m_sparseValueMap; void* lazyCreationData; // A JSArray subclass can use this to fill the vector lazily. - JSValuePtr m_vector[1]; + JSValue m_vector[1]; }; class JSArray : public JSObject { @@ -42,47 +42,49 @@ namespace JSC { public: explicit JSArray(PassRefPtr<Structure>); JSArray(PassRefPtr<Structure>, unsigned initialLength); - JSArray(ExecState*, PassRefPtr<Structure>, const ArgList& initialValues); + JSArray(PassRefPtr<Structure>, const ArgList& initialValues); virtual ~JSArray(); virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); - virtual void put(ExecState*, unsigned propertyName, JSValuePtr); // FIXME: Make protected and add setItem. + virtual void put(ExecState*, unsigned propertyName, JSValue); // FIXME: Make protected and add setItem. - static const ClassInfo info; + static JS_EXPORTDATA const ClassInfo info; unsigned length() const { return m_storage->m_length; } void setLength(unsigned); // OK to use on new arrays, but not if it might be a RegExpMatchArray. void sort(ExecState*); - void sort(ExecState*, JSValuePtr compareFunction, CallType, const CallData&); + void sort(ExecState*, JSValue compareFunction, CallType, const CallData&); + void sortNumeric(ExecState*, JSValue compareFunction, CallType, const CallData&); - void push(ExecState*, JSValuePtr); - JSValuePtr pop(); + void push(ExecState*, JSValue); + JSValue pop(); bool canGetIndex(unsigned i) { return i < m_fastAccessCutoff; } - JSValuePtr getIndex(unsigned i) + JSValue getIndex(unsigned i) { ASSERT(canGetIndex(i)); return m_storage->m_vector[i]; } bool canSetIndex(unsigned i) { return i < m_fastAccessCutoff; } - JSValuePtr setIndex(unsigned i, JSValuePtr v) + JSValue setIndex(unsigned i, JSValue v) { ASSERT(canSetIndex(i)); return m_storage->m_vector[i] = v; } - void fillArgList(ExecState*, ArgList&); + void fillArgList(ExecState*, MarkedArgumentBuffer&); + void copyToRegisters(ExecState*, Register*, uint32_t); - static PassRefPtr<Structure> createStructure(JSValuePtr prototype) + static PassRefPtr<Structure> createStructure(JSValue prototype) { return Structure::create(prototype, TypeInfo(ObjectType)); } protected: - virtual void put(ExecState*, const Identifier& propertyName, JSValuePtr, PutPropertySlot&); + virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); virtual bool deleteProperty(ExecState*, const Identifier& propertyName); virtual bool deleteProperty(ExecState*, unsigned propertyName); virtual void getPropertyNames(ExecState*, PropertyNameArray&); @@ -95,7 +97,7 @@ namespace JSC { virtual const ClassInfo* classInfo() const { return &info; } bool getOwnPropertySlotSlowCase(ExecState*, unsigned propertyName, PropertySlot&); - void putSlowCase(ExecState*, unsigned propertyName, JSValuePtr); + void putSlowCase(ExecState*, unsigned propertyName, JSValue); bool increaseVectorLength(unsigned newLength); @@ -108,19 +110,21 @@ namespace JSC { ArrayStorage* m_storage; }; - JSArray* asArray(JSValuePtr); + JSArray* asArray(JSValue); JSArray* constructEmptyArray(ExecState*); JSArray* constructEmptyArray(ExecState*, unsigned initialLength); - JSArray* constructArray(ExecState*, JSValuePtr singleItemValue); + JSArray* constructArray(ExecState*, JSValue singleItemValue); JSArray* constructArray(ExecState*, const ArgList& values); - inline JSArray* asArray(JSValuePtr value) + inline JSArray* asArray(JSValue value) { ASSERT(asObject(value)->inherits(&JSArray::info)); return static_cast<JSArray*>(asObject(value)); } + inline bool isJSArray(JSGlobalData* globalData, JSValue v) { return v.isCell() && v.asCell()->vptr() == globalData->jsArrayVPtr; } + } // namespace JSC #endif // JSArray_h |