Changeset 176622 in webkit
- Timestamp:
- Dec 1, 2014, 6:21:16 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/runtime/Identifier.h (modified) (1 diff)
-
JavaScriptCore/runtime/IdentifierInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/PrivateName.h (modified) (1 diff)
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/text/AtomicString.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r176601 r176622 1 2014-12-01 Andreas Kling <akling@apple.com> 2 3 Optimize constructing JSC::Identifier from AtomicString. 4 <https://webkit.org/b/139157> 5 6 Reviewed by Michael Saboff. 7 8 Add constructors for Identifier taking AtomicString and AtomicStringImpl. 9 This avoids branching on the string's isAtomic flag, which is obviously 10 always true for AtomicString & AtomicStringImpl. 11 12 Had to add a Identifier(const char*) constructor to resolve implicit 13 ambiguity between String / AtomicString. 14 15 Also made PrivateName::uid() return AtomicStringImpl* to take advantage 16 of the new constructor in a few places. 17 18 * runtime/Identifier.h: 19 (JSC::Identifier::Identifier): 20 * runtime/IdentifierInlines.h: 21 (JSC::Identifier::Identifier): 22 * runtime/PrivateName.h: 23 (JSC::PrivateName::uid): 24 1 25 2014-12-01 Alexey Proskuryakov <ap@apple.com> 2 26 -
trunk/Source/JavaScriptCore/runtime/Identifier.h
r176583 r176622 45 45 Identifier(VM* vm, const char (&characters)[charactersCount]) : m_string(add(vm, characters)) { ASSERT(m_string.impl()->isAtomic()); } 46 46 47 Identifier(ExecState*, AtomicStringImpl*); 48 Identifier(ExecState*, const AtomicString&); 47 49 Identifier(ExecState* exec, StringImpl* rep) : m_string(add(exec, rep)) { ASSERT(m_string.impl()->isAtomic()); } 48 50 Identifier(ExecState* exec, const String& s) : m_string(add(exec, s.impl())) { ASSERT(m_string.impl()->isAtomic()); } 51 Identifier(ExecState* exec, const char* s) : Identifier(exec, AtomicString(s)) { } 49 52 50 53 Identifier(VM* vm, const LChar* s, int length) : m_string(add(vm, s, length)) { ASSERT(m_string.impl()->isAtomic()); } -
trunk/Source/JavaScriptCore/runtime/IdentifierInlines.h
r165999 r176622 32 32 namespace JSC { 33 33 34 inline Identifier::Identifier(ExecState* exec, AtomicStringImpl* string) 35 : m_string(string) 36 { 37 #ifndef NDEBUG 38 checkCurrentAtomicStringTable(exec); 39 if (string) 40 ASSERT_WITH_MESSAGE(!string->length() || AtomicString::isInAtomicStringTable(string), "The atomic string comes from an other thread!"); 41 #else 42 UNUSED_PARAM(exec); 43 #endif 44 } 45 46 inline Identifier::Identifier(ExecState* exec, const AtomicString& string) 47 : m_string(string.string()) 48 { 49 #ifndef NDEBUG 50 checkCurrentAtomicStringTable(exec); 51 if (!string.isNull()) 52 ASSERT_WITH_MESSAGE(!string.length() || AtomicString::isInAtomicStringTable(string.impl()), "The atomic string comes from an other thread!"); 53 #else 54 UNUSED_PARAM(exec); 55 #endif 56 } 57 34 58 inline PassRef<StringImpl> Identifier::add(ExecState* exec, StringImpl* r) 35 59 { -
trunk/Source/JavaScriptCore/runtime/PrivateName.h
r156910 r176622 43 43 } 44 44 45 StringImpl* uid() const { return m_impl.get(); }45 AtomicStringImpl* uid() const { return static_cast<AtomicStringImpl*>(m_impl.get()); } 46 46 47 47 private: -
trunk/Source/WTF/ChangeLog
r176616 r176622 1 2014-12-01 Andreas Kling <akling@apple.com> 2 3 Optimize constructing JSC::Identifier from AtomicString. 4 <https://webkit.org/b/139157> 5 6 Reviewed by Michael Saboff. 7 8 Make AtomicString::isInAtomicStringTable() public so it can be used 9 in some Identifier assertions. 10 11 * wtf/text/AtomicString.h: 12 1 13 2014-12-01 Oliver Hunt <oliver@apple.com> 2 14 -
trunk/Source/WTF/wtf/text/AtomicString.h
r176275 r176622 205 205 } 206 206 207 #if !ASSERT_DISABLED 208 WTF_EXPORT_STRING_API static bool isInAtomicStringTable(StringImpl*); 209 #endif 210 207 211 private: 208 212 // The explicit constructors with AtomicString::ConstructFromLiteral must be used for literals. … … 216 220 WTF_EXPORT_STRING_API static AtomicStringImpl* findSlowCase(StringImpl&); 217 221 WTF_EXPORT_STRING_API static AtomicString fromUTF8Internal(const char*, const char*); 218 219 #if !ASSERT_DISABLED220 WTF_EXPORT_STRING_API static bool isInAtomicStringTable(StringImpl*);221 #endif222 222 }; 223 223
Note:
See TracChangeset
for help on using the changeset viewer.