diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/JavaScriptCore/runtime/JSString.h | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSString.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSString.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h index c95233deb..4ba9b79ad 100644 --- a/Source/JavaScriptCore/runtime/JSString.h +++ b/Source/JavaScriptCore/runtime/JSString.h @@ -67,7 +67,6 @@ namespace JSC { friend class JSGlobalData; friend class SpecializedThunkJIT; friend class JSRopeString; - friend class MarkStack; friend struct ThunkHelpers; typedef JSCell Base; @@ -92,7 +91,6 @@ namespace JSC { Base::finishCreation(globalData); m_length = length; m_is8Bit = m_value.impl()->is8Bit(); - m_isHashConstSingleton = false; } void finishCreation(JSGlobalData& globalData, size_t length, size_t cost) @@ -101,7 +99,6 @@ namespace JSC { Base::finishCreation(globalData); m_length = length; m_is8Bit = m_value.impl()->is8Bit(); - m_isHashConstSingleton = false; Heap::heap(this)->reportExtraMemoryCost(cost); } @@ -111,7 +108,6 @@ namespace JSC { Base::finishCreation(globalData); m_length = 0; m_is8Bit = true; - m_isHashConstSingleton = false; } public: @@ -143,9 +139,9 @@ namespace JSC { JSObject* toObject(ExecState*, JSGlobalObject*) const; double toNumber(ExecState*) const; - bool getStringPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); + bool getStringPropertySlot(ExecState*, PropertyName, PropertySlot&); bool getStringPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); - bool getStringPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&); + bool getStringPropertyDescriptor(ExecState*, PropertyName, PropertyDescriptor&); bool canGetIndex(unsigned i) { return i < m_length; } JSString* getIndex(ExecState*, unsigned); @@ -165,13 +161,9 @@ namespace JSC { protected: bool isRope() const { return m_value.isNull(); } bool is8Bit() const { return m_is8Bit; } - bool isHashConstSingleton() const { return m_isHashConstSingleton; } - void clearHashConstSingleton() { m_isHashConstSingleton = false; } - void setHashConstSingleton() { m_isHashConstSingleton = true; } // A string is represented either by a UString or a rope of fibers. bool m_is8Bit : 1; - bool m_isHashConstSingleton : 1; unsigned m_length; mutable UString m_value; @@ -181,7 +173,7 @@ namespace JSC { static JSObject* toThisObject(JSCell*, ExecState*); // Actually getPropertySlot, not getOwnPropertySlot (see JSCell). - static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); + static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); UString& string() { ASSERT(!isRope()); return m_value; } @@ -241,7 +233,6 @@ namespace JSC { Base::finishCreation(globalData); m_length = s1->length() + s2->length(); m_is8Bit = (s1->is8Bit() && s2->is8Bit()); - m_isHashConstSingleton = false; m_fibers[0].set(globalData, this, s1); m_fibers[1].set(globalData, this, s2); } @@ -251,7 +242,6 @@ namespace JSC { Base::finishCreation(globalData); m_length = s1->length() + s2->length() + s3->length(); m_is8Bit = (s1->is8Bit() && s2->is8Bit() && s3->is8Bit()); - m_isHashConstSingleton = false; m_fibers[0].set(globalData, this, s1); m_fibers[1].set(globalData, this, s2); m_fibers[2].set(globalData, this, s3); @@ -449,16 +439,16 @@ namespace JSC { inline JSString* jsNontrivialString(ExecState* exec, const char* s) { return jsNontrivialString(&exec->globalData(), s); } inline JSString* jsOwnedString(ExecState* exec, const UString& s) { return jsOwnedString(&exec->globalData(), s); } - ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) + ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot) { if (propertyName == exec->propertyNames().length) { slot.setValue(jsNumber(m_length)); return true; } - bool isStrictUInt32; - unsigned i = propertyName.toUInt32(isStrictUInt32); - if (isStrictUInt32 && i < m_length) { + unsigned i = propertyName.asIndex(); + if (i < m_length) { + ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail! slot.setValue(getIndex(exec, i)); return true; } |